Ejemplo n.º 1
0
 public Dynamic(World world, Vector2 pos, Vector2 size, Texture2D tex)
     : base(world)
 {
     m_pos  = pos;
     m_size = size;
     m_tex  = tex;
 }
Ejemplo n.º 2
0
        public Enemy(World world, Vector2 pos, Vector2 size, Texture2D tex, Rectangle[] enemyAlive, Rectangle[] enemyDying)
            : base(world, pos, size, tex)
        {
            isVisible = true;

            m_enemyAlive = enemyAlive;
            m_enemyDying = enemyDying;
        }
Ejemplo n.º 3
0
        int step = 8; //How many pixels you want the invaders to move

        #endregion Fields

        #region Constructors

        public Enemies(World world)
        {
            m_enemies = new Enemy[ROWS, COLS];
            m_world = world;

            for (int r = 0; r < ROWS; r += 1)
                for (int c = 0; c < COLS; c += 1)
                {
                    Enemy enemy = null;

                    Vector2 position = new Vector2(20, 125) + new Vector2(30 * (c + 1), 25 * (r + 1));

                    switch(r) {
                        case 0: {
                            enemy = new Enemy(world, position, new Vector2(28, 20), world.m_texInvadersSheet, m_Enemy3Playing, m_EnemyDying);
                            enemy.points = 30;
                        } break;

                        case 1: {
                            enemy = new Enemy(world, position, new Vector2(28, 20), world.m_texInvadersSheet, m_Enemy2Playing, m_EnemyDying);
                            enemy.points = 20;
                        } break;

                        case 2: {
                            enemy = new Enemy(world, position, new Vector2(28, 20), world.m_texInvadersSheet, m_Enemy2Playing, m_EnemyDying);
                            enemy.points = 20;
                        } break;

                        case 3: {
                            enemy = new Enemy(world, position, new Vector2(28, 20), world.m_texInvadersSheet, m_Enemy1Playing, m_EnemyDying);
                            enemy.points = 10;
                        } break;

                        case 4: {
                            enemy = new Enemy(world, position, new Vector2(28, 20), world.m_texInvadersSheet, m_Enemy1Playing, m_EnemyDying);
                            enemy.points = 10;
                        } break;
                    }
                    world.m_entities.Add(enemy);
                    m_enemies[r, c] = enemy;
                }
        }
Ejemplo n.º 4
0
 public Entity(World world) { m_world = world; }
Ejemplo n.º 5
0
 public SpaceShip(World world, Vector2 pos, Vector2 size, Texture2D tex, bool inverse = false)
     : base(world, pos, size, tex)
 {
     m_inverse = inverse;
     rndBullet = new Random();
 }
Ejemplo n.º 6
0
 public Barrier(World world, Vector2 pos, Vector2 size, Texture2D tex)
     : base(world, pos, size, tex)
 {
 }
Ejemplo n.º 7
0
 public BulletPlayer(World world, Vector2 pos, Vector2 size, Texture2D tex)
     : base(world, pos, size, tex)
 {
     m_bulletCount++;
 }
Ejemplo n.º 8
0
 public BulletSpaceship(World world, Vector2 pos, Vector2 size, Texture2D tex)
     : base(world, pos, size, tex)
 {
 }
Ejemplo n.º 9
0
 public Player(World world, Vector2 pos, Vector2 size, Texture2D tex)
     : base(world, pos, size, tex)
 {
     isVisible = true;
 }
Ejemplo n.º 10
0
 static void Main()
 {
     using (var game = new World())
         game.Run();
 }