Exemplo n.º 1
0
 public GameManager(Game game, GraphicsDeviceManager graphics)
     : base(game)
 {
     level = new LoveStar.Level(game, graphics);
     player = new LoveStar.Player(game, graphics);
     Entities = new LoveStar.Entity[12];
     Entities[0] = new LoveStar.Entity(LoveStar.EntityName.LevelExits, game, graphics);
     Entities[1] = new LoveStar.Entity(LoveStar.EntityName.Empty, game, graphics);
 }
Exemplo n.º 2
0
 public Entity Update(GameTime gameTime, Tools.KeyPress keyPress, Player Player, Level level)
 {
     if (enName == EntityName.LevelExits)
     {
         if (level.getLevelNumber() == 1)
         {
             if (Player.Position.X < 0)
             {
                 level.changeLevelTo(3);
             }
         }
         if (level.getLevelNumber() == 3)
         {
             if (Player.Position.X > level.getLevelSize().X)
             {
                 level.changeLevelTo(1);
             }
         }
     }
     return this;
 }
Exemplo n.º 3
0
        public Window_Return_Info Update(GameTime gameTime, Tools.KeyPress keyPress, Window_Return_Info window_Return_Info)
        {
            window_Return_Info.windowTransition = false;
            window_Return_Info.newState = Game_Window_State.Game;

            level = level.Update(gameTime, keyPress, level);
            if (level.shouldPlayerShift() == true)
            {
                player.Position = level.getPlayerStartPosition();
                Tools.Camera.offset.X = player.Position.X - (GraphicsDevice.Viewport.Width / 2);
            }
            player = player.Update(gameTime, keyPress, player);

            for (int i = 0; i >= 0; i++)
            {
                if (Entities[i].IsUsed() != true)
                {
                    break;
                }
                else
                {
                    Entities[i].Update(gameTime, keyPress, player, level);
                }
            }

            CameraPosition(level, player);

            return window_Return_Info;
        }
Exemplo n.º 4
0
        public Player Update(GameTime gameTime, Tools.KeyPress keyPress, Player Player)
        {
            Proto_Movement(gameTime, keyPress);
            FrameBasedMovement(gameTime);

            return Player;
        }