Devlop your game

Make, share and learn.

Sunday, April 12, 2020

Basic count game

First game is pretty simple. It's just a begining. There is more to come if you haven't check it out watch it here. If you think you want to make it here are the scripts that I have used in it. You can use as reference and play with it to get different results or copy it. I have included very very basic concepts every game include like using UI, scripting playing with parameters. Hopefully you found it helpful. There are lots to come.
It's UI:

Download the game from here : Countgame

Script

For menu controller:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class menucontroller : MonoBehaviour
{
    public void endgame()
    {
        Application.Quit();
    }
}

Make sure the script name is same as you are making

For game controller:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class gamecontroller : MonoBehaviour
{
    public Text counttext;
    float i=0;
    void Start()
    {
        i=0;
    }
    public void count()
    {
        i++;
        counttext.text=i.ToString();
    }
}

Make sure the script name is same as you are making

No comments:

Post a Comment