New game
Download
Get Academic Plan
Share game
Fill in the Blanks
Fill in the Blanks

Condicionales en C# y Unity

Integrate it into your platform

You can integrate the game into an LMS compatible with LTI 1.1 or LTI 1.3 such as Canvas, Moodle, or Blackboard. This way, the scores will be automatically saved into the platform’s gradebook.
Download
You have exceeded the maximum number of games you can integrate into Google Classroom with your current Plan.

To integrate as many games as you want in Google Classroom, you need an Academic Plan or a Commercial Plan.

You have exceeded the maximum number of games you can integrate into Microsoft Teams with your current Plan.

To integrate as many games as you want in Microsoft Teams, you need an Academic Plan or a Commercial Plan.

Downloading games is an exclusive feature for users with an Academic Plan or a Commercial Plan.

Get your Academic Plan or your Commercial Plan now and start integrating your games into your LMS, website or blog.

If you wish, you can download a demo game here and test its integration:

Condicionales en C# y Unity

Fill in the Blanks

(3)
Played 95

About this activity

Condicionales en C# para Unity.

Created by

Mexico

Download the paper version to play

Make your own free game from our game creator
Compete against your friends to see who gets the best score in this game

Top Games

%
Anonymous
Anonymous
%
%
%
You have exceeded the maximum number of games you can print with your current Plan.

To print as many games as you want, you need an Academic Plan or a Commercial Plan.

Print your game
Condicionales en C# y Unity
 

Fill in the Blanks

Condicionales en C# y UnityOnline version

Condicionales en C# para Unity.

by Gabriel Barrón Rodríguez
1

En , las estructuras condicionales controlan el flujo de juego . En se usan para decidir qué hacer ante eventos , movimientos o colisiones . El ejemplo más común es ( condition ) { . . . } { . . . } , que ejecuta una rama u otra . También existe para manejar múltiples casos con un solo valor , y el operador ternario ? : para expresiones breves . Comprender estas herramientas permite crear IA sencilla , respuestas de enemigos y reacciones basadas en el estado del jugador .

2

Completa el condicional para que muestre el mensaje solo si la puntuación es mayor que 100

puntuacion = 120 ;

if ( )
{
Debug . ( " ¡ Puntaje alto ! " ) ;
}

3

Muestra un mensaje si el jugador tiene más de 3 vidas .

int vidas = 5 ;


( )
{
. Log ( " Jugador con buena cantidad de vidas " ) ;
}

4

Verifica si el nivel actual es igual a 10 .

nivel = 10 ;

( = = )
{
. ( " Nivel máximo alcanzado " ) ;
}

5

Muestra un mensaje según la cantidad de energía del jugador .

int = 40 ;

( energia = )
{
. Log ( " Energía suficiente " ) ;
}

{
Debug . ( " Energía baja " ) ;
}

6

Muestra un mensaje según la temperatura del entorno

temperatura = 30 . 5f ;

( )
{
Debug . Log ( " Hace calor " ) ;
}

{
. ( " Hace frío " ) ;
}

7

Evalúa si el jugador ha perdido todas sus vidas .

int vidas = 0 ;

( = = )
{
. Log ( " Game Over " ) ;
}

{
Debug . ( " Aún puedes continuar " ) ;
}

8

Ejemplo : Dos condiciones deben cumplirse

edad = 20 ;
tieneLicencia = true ;

( = && )
{
Debug . Log ( " Puedes conducir . " ) ;
}

{
Debug . Log ( " No cumples los requisitos para conducir . " ) ;
}

9

Ejemplo : Energía y vida del jugador

energia = 80 ;
int vida = 60 ;

( && > )
{
. ( " El jugador está en condiciones de pelear . " ) ;
}

{
Debug . Log ( " El jugador necesita descansar . " ) ;
}

10

Ejemplo : Una de las condiciones basta

monedas = 5 ;
tienePaseVIP = false ;

( > = | | tienePaseVIP )
{
. Log ( " Puedes entrar al área exclusiva . " ) ;
}

{
Debug . ( " No tienes acceso . " ) ;
}

11

Ejemplo : Batería o energía disponibles

int bateria = 0 ;
int energia = 30 ;

( > 0 | | energia 0 )
{
Debug . Log ( " El robot puede seguir funcionando . " ) ;
}

{
. ( " El robot se ha apagado . " ) ;
}

Are you sure you want to leave the page?

If you leave the page, you will lose your game progress.