コード例 #1
0
 public Block(ContentManager content,
              SPoint position,
              SpaceInvaders gameRoot) :
     base(content, position, "Block", BLOCK_WIDTH, gameRoot)
 {
     m_gameObjectType = GameObjectType.Block;
 }
コード例 #2
0
        public Bullet(ContentManager content, SPoint position, SpaceInvaders gameRoot, SVector2D velocity, Color color) :
            base(content, position, "Bullet", BULLET_WIDTH, gameRoot)
        {
            m_gameObjectType       = GameObjectType.Bullet;
            m_velocity             = velocity;
            m_accumulatedFlickTime = 0.0;
            m_visibleState         = false;

            m_color = color;
        }
コード例 #3
0
        public Alien(ContentManager content, SPoint position, SpaceInvaders gameRoot, bool virt, int layer, AlienBehaviour behaviour) :
            base(content, position, "Alien1", ALIEN_WIDTH, gameRoot)
        {
            m_gameObjectType = GameObjectType.Alien;
            m_isVirtualAlien = virt;
            m_goingRight     = true;

            m_hiddenPosition     = m_position;
            m_accumulatedTimePos = 0.0;
            m_layer = layer;

            m_gameRoot.GetAliensCountPerRow()[layer]++;

            m_behaviour                = behaviour;
            m_behaviourIndex           = 0;
            m_accumulatedBehaviourTime = 0.0;
        }
コード例 #4
0
        public GameObject(ContentManager content,
                          SPoint position,
                          string texutreFilename,
                          double width,
                          SpaceInvaders gameRoot)
        {
            m_content         = content;
            m_position        = position;
            m_textureFileName = texutreFilename;
            m_width           = width;

            m_texture = m_content.Load <Texture2D>(m_textureFileName);

            m_gameRoot       = gameRoot;
            m_gameObjectType = GameObjectType.Default;

            m_dead = false;
        }
コード例 #5
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            m_spaceInvaders = new SpaceInvaders(Content);
        }
コード例 #6
0
 public Player(ContentManager content, SPoint position, SpaceInvaders gameRoot) :
     base(content, position, "Player", PLAYER_WIDTH, gameRoot)
 {
     m_gameObjectType = GameObjectType.Player;
     m_reloadingTime  = PLAYER_TIME_TO_RELOAD;
 }