Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

using UnityEngine;

using System.Collections;
public class Ejercicio1 : MonoBehaviour {
int health = 30;
int powerUps = 2;
bool isPowerUpActive;
// Use this for initialization
void Start () {
if (health <= 30 && powerUps > 0){
powerUps--;
isPowerUpActive = true;

}
Debug.Log("PowerUpActive " + isPowerUpActive + " PowerUps " + powerUps);
}

using UnityEngine;
using System.Collections;
public class Ejercicio2 : MonoBehaviour {
int life = 10;
int coins = 0;
// Use this for initialization
void Start () {
for (int i = 0; i < 10; i++) {
coins++;
}

Debug.Log ("El valor es: " + coins * 2);


}

using UnityEngine;
using System.Collections;
public class Ejercicio3 : MonoBehaviour {
int a = 2;
int b = 9;
// Use this for initialization
void Start () {
while(a % b != 0 ) {
Debug.Log("a no es divisible entre b");
a++;
}
}

You might also like