Example #1
0
        public Bullet(Game game, GameScreen screen, Team team, Vector2 position, Vector2 velocity)
            : base(game, screen, position, velocity)
        {
            this.team = team;

            //this.Sprite = Sprites.Bullet;
            if (team == Team.PLAYER)
            {
                //player shot
                width = 20;
                height = 8;
                bulletAnimation = new Animation(this.Game.Content, "Sprites/playershot2", width, height, 2, 15);

            }
            else
            {
                //enemy shot
                width = 17;
                height = 17;
                bulletAnimation = new Animation(this.Game.Content, "Sprites/enemyshot", width, height, 8, 15);

            }
            bulletAnimation.EnableRepeating();

            this.Layer = Layer.BULLET;
        }
 public ScoreDisplay(Game game, GameScreen screen, Vector2 position, long points, float size)
     : base(game, screen, position)
 {
     this.points = points;
     this.size = size;
     this.timer = (int)(180 * size);
     this.Layer = Layer.FRONT;
 }
 public GameJamComponent(Game game, GameScreen screen, Vector2 position, Vector2 velocity)
     : base(game)
 {
     this.Screen = screen;
     this.Position = position;
     this.Velocity = velocity;
     this.scale = 1;
     shipExplosion = game.Content.Load<SoundEffect>("SoundEffects/cannon");
 }
Example #4
0
 public Explosion(Game game, GameScreen screen, Vector2 position)
     : base(game, screen, position)
 {
     this.timer = 75;
     width = 64;
     height = 64;
     explosionAnimation = new Animation(this.Game.Content, "Sprites/explosion", width, height, 6, 6);
     this.Layer = Layer.EXPLOSION;
 }
Example #5
0
 public Asteroid(Game game, GameScreen screen, Vector2 position, Vector2 velocity)
     : base(game, screen, position, velocity)
 {
     this.Layer = Layer.ASTEROID;
     width = 32;
     height = 32;
     scale = 2;
     asteroidAnimation = new Animation(game.Content, "Sprites/asteroid2", width, height, 8, 8);
     asteroidAnimation.EnableRepeating();
 }
Example #6
0
 public Game1()
 {
     menuScreen = new MenuScreen(this);
     splashScreen = new SplashScreen(this);
     gameScreen = new GameScreen(this);
     creditsScreen = new CreditsScreen(this);
     storyScreen = new StoryScreen(this);
     graphics = new GraphicsDeviceManager(this);
     graphics.PreferredBackBufferHeight = SCREEN_HEIGHT;
     graphics.PreferredBackBufferWidth = SCREEN_WIDTH;
 }
Example #7
0
        public ZombieShip(Game game, GameScreen screen, Vector2 position, ZombieType type)
            : base(game, screen, position)
        {
            this.random = new Random();

            this.Layer = Layer.ZOMBIE;

            this.type = type;

            switch (this.type)
            {
                case ZombieType.FLOATER:
                    this.width = 58;
                    this.height = 76;
                    zombieAnimationFlying = new Animation(this.Game.Content, "Sprites/paraZombie", width, height, 4, 5);
                    zombieAnimationFlying.EnableRepeating();
                    this.Velocity = new Vector2(0, 1 + this.NextFloat());
                    this.pointValue = 5;
                    break;
                case ZombieType.SHOOTER:
                    this.width = 30;
                    this.height = 17;
                    zombieAnimationFlying = new Animation(this.Game.Content, "Sprites/zombieShip", width, height, 2, 15);
                    zombieAnimationFlying.EnableRepeating();
                    this.Velocity = new Vector2(-1 * (2 + 4 * this.NextFloat()), 0);
                    this.pointValue = 10;
                    break;
                case ZombieType.SLAMMER:
                    this.width = 32;
                    this.height = 17;
                    zombieAnimationFlying = new Animation(this.Game.Content, "Sprites/kamakazi", width, height, 2, 15);
                    zombieAnimationFlying.EnableRepeating();
                    this.Velocity = new Vector2(0, -9 * (1 + 2 * this.NextFloat()));
                    this.pointValue = 25;
                    break;
                case ZombieType.CANNON:
                    this.width = 32;
                    this.height = 22;
                    zombieAnimationFlying = new Animation(this.Game.Content, "Sprites/bomberZombie", width, height, 8, 5);
                    zombieAnimationFlying.EnableRepeating();
                    Vector2 diff = Vector2.Subtract(this.Position, this.Screen.Player.Position);
                    this.Velocity = new Vector2(-10, - 0.5f - (diff.Y / 30) - (diff.X / 120));
                    this.pointValue = 5;
                    break;
            }

            this.ResetTimer();
        }
Example #8
0
        public Boss(Game game, GameScreen screen)
            : base(game, screen, new Vector2(Game1.SCREEN_WIDTH + 10, (Game1.SCREEN_HEIGHT / 2) - 168))
        {
            this.random = new Random();

            this.height = 150;
            this.width = 150;
            this.scale = 3f;
            this.Layer = Layer.ZOMBIE;

            this.xSign = (400 * this.random.Next(2)) - 200;
            this.ySign = (200 * this.random.Next(2)) - 100;

            this.flash = 0;
            this.spawnTime = 120;
            this.explode = -1;
            this.aliveTime = 0;
            this.hp = 4 * this.Screen.GameSpeed;
            this.maxHp = this.hp;
        }
 public PlayerShip(Game game, GameScreen screen)
     : base(game, screen, new Vector2((Game1.SCREEN_WIDTH / 2) - 32, 450))
 {
     scale = 2;
     this.Layer = Layer.PLAYER;
 }
 public GameJamComponent(Game game, GameScreen screen, Vector2 position)
     : this(game, screen, position, new Vector2(0, 0))
 {
     shipExplosion = game.Content.Load<SoundEffect>("SoundEffects/cannon");
 }
 public ScoreDisplay(Game game, GameScreen screen, Vector2 position, long points)
     : this(game, screen, position, points, 1f / 3f)
 {
 }