コード例 #1
0
ファイル: Player.cs プロジェクト: wuwenhuang/RobotContra
        public Player(Texture2D texture, Vector2 position)
            : base(texture, position, new Vector2(70, 130))
        {
            weapon = new Weapon(this, GameplayScreen.main.content.Load<Texture2D>("Weapon/rifle"), new Vector2(5,35), new Vector2(100,30));
            healthBar = new Health(this);

            this.setDead(false);
            this.AddChild(weapon);
            this.AddChild(healthBar);
            this.setBulletType(BulletType.NORMAL, 15.0f);
        }
コード例 #2
0
ファイル: Enemy.cs プロジェクト: wuwenhuang/RobotContra
        public Enemy(Texture2D texture, Vector2 Position, Vector2 Size, float speed)
            : base(texture, Position, Size)
        {
            this.speed = speed;
            this.currentState = CharacterState.MOVELEFT;

            healthBar = new Health(this);
            this.AddChild(healthBar);
            this.isAlive = false;
            this.setDead(false);
        }