Exemplo n.º 1
0
        public virtual void Movement()
        {
            if (move == CheckMovement.RightMovement)
            {
                X += Speed * Engine.DeltaTime;

                if (Engine.Timer.Get("Cooldown") <= 0)
                {
                    move = CheckMovement.LeftMovement;
                    Engine.Timer.Set("Cooldown", 2f);
                }
                    
            }

            if (move == CheckMovement.LeftMovement)
            {
                X -= Speed * Engine.DeltaTime;

                if (Engine.Timer.Get("Cooldown") <= 0)
                {
                    move = CheckMovement.RightMovement;
                    Engine.Timer.Set("Cooldown", 2f);
                }
            }
        }
Exemplo n.º 2
0
		public virtual void Movement()
		{
			if (move == CheckMovement.RightMovement)
			{

				X += Speed * Engine.DeltaTime;

				if (HasCollisions())
					move = CheckMovement.LeftMovement;
			}

			if (move == CheckMovement.LeftMovement)
			{
				X -= Speed * Engine.DeltaTime;

				if (HasCollisions())
					move = CheckMovement.RightMovement;
			}
			var lastY = Y;
			Y += 100 * Engine.DeltaTime;
			if (CheckCollisions().Count > 0)
			{
				Y = lastY;
			}
		}
Exemplo n.º 3
0
 public EnemyFire(int width, int height, int X, int Y, bool isEasy, string hitBoxName) : base(width, height, isEasy, X, Y)
 {
     move = CheckMovement.RightMovement;
     if (isEasy)
     {
         Health = 1;
     }
     else
     {
         Health = 2;
     }
 }
Exemplo n.º 4
0
 public EnemyAir(int width, int height, bool isEasy, string hitBoxName, int posX, int posY) : base(width, height, isEasy,posX,posY, hitBoxName)
 {
     move = CheckMovement.RightMovement;
     if (isEasy)
     {
         Health = 1;
     }
     else
     {
         Health = 2;
     }
 }
Exemplo n.º 5
0
        public virtual void Movement()
        {

            if (move == CheckMovement.RightMovement)
            {
                X += Speed * Engine.DeltaTime;
                if (HasCollisions())
                    move = CheckMovement.LeftMovement;
            }

            if (move == CheckMovement.LeftMovement)
            {
                X -= Speed * Engine.DeltaTime;
                if (HasCollisions())
                    move = CheckMovement.RightMovement;
            }
        }