Ejemplo n.º 1
0
 public GameWorld(Shooter game)
     : base(game)
 {
     entities = new List<Entity>();
     temp = new List<Action>();
     camera = new Camera(0,0);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Shooter game = new Shooter())
     {
         game.Run();
     }
 }
Ejemplo n.º 3
0
 bool CheckForPlayer(out Shooter.Direction dir)
 {
     int x = this._lastX; int y = this._lastY;
     dir = Shooter.Direction.Up;
     for (y--; y > 1; y--)
     {
         if (Game.MainGame.Board[x, y] == -1)
         {
             if (IsPlayeronSpot(x, y))
                 return true;
         }
         else
             break;
     }
     y = this._lastY;
     dir = Shooter.Direction.Down;
     for (y++; y < Game.MainGame.Board.MaxHeight; y++)
     {
         if (Game.MainGame.Board[x, y] == -1)
         {
             if (IsPlayeronSpot(x, y))
                 return true;
         }
         else
             break;
     }
     y = this._lastY;
     dir = Shooter.Direction.Left;
     for (x--; x > 1; x--)
     {
         if (Game.MainGame.Board[x, y] == -1)
         {
             if (IsPlayeronSpot(x, y))
                 return true;
         }
         else
             break;
     }
     x = this._lastX;
     dir = Shooter.Direction.Right;
     for (x++; x < Game.MainGame.Board.MaxWidth; x++)
     {
         if (Game.MainGame.Board[x, y] == -1)
         {
             if (IsPlayeronSpot(x, y))
                 return true;
         }
         else
             break;
     }
     return false;
 }
Ejemplo n.º 4
0
        public LevelManager(Shooter shooter, ContentManager content)
        {
            this.shooter = shooter;

            Texture2D image = content.Load<Texture2D>("levels");

            imageWidth = image.Width;
            imageHeight = image.Height;

            map = new uint[imageWidth * imageHeight];

            image.GetData<uint>(map);

            for (int a = 0; a < map.Length; a++)
                map[a] = ((map[a] & 0x000000FF) << 24) | ((map[a] & 0x0000FF00) << 8) | ((map[a] & 0x0000FF0000) >> 8) | ((map[a] & 0xFF000000) >> 24);
        }
Ejemplo n.º 5
0
        public Transition(Shooter shooter, GameWorld oldWorld, GameWorld newWorld, int direction, Player player)
            : base(shooter)
        {
            this.oldWorld = oldWorld;
            this.newWorld = newWorld;
            this.player = player;

            switch (direction)
            {
                case RIGHT: vx = 1; break;
                case LEFT: vx = -1; break;
                case DOWN: vy = 1; break;
                case UP: vy = -1; break;
            }

            newWorld.Camera.x = 32 * 20 * -vx;
            newWorld.Camera.y = 24 * 20 * -vy;
        }
Ejemplo n.º 6
0
 static void Main()
 {
     using (var game = new Shooter())
         game.Run();
 }
Ejemplo n.º 7
0
 public Screen(Shooter game)
 {
     this.game = game;
 }
Ejemplo n.º 8
0
 public WinScreen(Shooter shooter)
     : base(shooter)
 {
     Stats.endTime = DateTime.Now.Ticks / 10000;
 }
Ejemplo n.º 9
0
 public TitleScreen(Shooter shooter)
     : base(shooter)
 {
 }