Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
566 B
1
Indexable
Never
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Energia : MonoBehaviour
{
    public int energia;
    // Start is called before the first frame update
    void Start()
    {
        energia = 0;
    }

    // Update is called once per frame
    void Update()
    {
        if (energia < 1000) energia++;

        if ( Input.GetKeyDown("space"))
        {
            if (energia >= 200)
            {
                Debug.Log("super attack");
                energia = energia - 200;
            }
            }
    }
}