Example #1
0
        public GameScreen(Game1 game)
        {
            this.game = game;
            this.runState = GameState.FadeIn;

            loadNewLevel();
        }
Example #2
0
        public TitleScreen(Game1 game, string label, Texture2D font, Vector2 pos)
        {
            this.game = game;
            this.label = label;
            this.font = font;
            this.posi = pos;

            this.runState = TitleState.DisplayText;
        }
Example #3
0
        public Bullet(Map map, Vector2 loc, Game1.Directions dir, Game1.Aspects asp)
        {
            currentMap = map;
            location = loc;
            moveDir = dir;
            aspect = asp;
            inert = false;

            texture = new Rectangle(0, (int)asp * 6, 6, 6);
        }
Example #4
0
        public Enemy(EnemyDef ident, Vector2 loc, Map map, GameScreen screen, Game1.Aspects aspect = Game1.Aspects.None)
        {
            this.identity = ident;
            this.location = loc;
            this.currentMap = map;
            this.currentScreen = screen;

            this.faceDir = Game1.Directions.Down;
            this.currentFrame = 0;
            this.stallCount = 0;

            if (aspect == Game1.Aspects.None)
                this.aspect = (Game1.Aspects)r.Next(0, 3);
            else
                this.aspect = aspect;
        }
Example #5
0
 public bool takeDamage(Game1.Aspects asp)
 {
     // Returns true if enemy is killed
     if (asp == this.aspect)
         return true;
     else
         return false;
 }
Example #6
0
        private void Move(Game1.Directions move_dir)
        {
            Vector2 move_vec = new Vector2(0, 0);
            switch (move_dir)
            {
                case Game1.Directions.Down:
                    move_vec = new Vector2(0, 2);
                    break;
                case Game1.Directions.Up:
                    move_vec = new Vector2(0, -2);
                    break;
                case Game1.Directions.Left:
                    move_vec = new Vector2(-2, 0);
                    break;
                case Game1.Directions.Right:
                    move_vec = new Vector2(2, 0);
                    break;
                default:
                    break; // Something has gone wrong
            }

            this.Move(move_vec);
        }
Example #7
0
 static void Main()
 {
     using (var game = new Game1())
         game.Run();
 }
Example #8
0
 public TitleScreen(Game1 game)
 {
     this.runState = TitleState.TitleScreen;
     this.game = game;
     this.font = Game1.texCollection.arcadeFont;
 }