Beispiel #1
0
 public PlayerController(int num)
 {
     number        = num;
     input         = ShootingGame.GetGameDevice().GetInputState();
     fireTimer     = new Timer(0.1f);
     fireDirection = new Vector2(0, -1);
 }
Beispiel #2
0
 public Laser()
     : base("laser", BulletType.ENEMY, ColiderType.LINE, 50)
 {
     colider = new Line(Vector2.Zero, new Vector2(0, 1), 50);
     time    = new Timer(1.0f);
     time2   = new Timer(1.0f);
     sound   = ShootingGame.GetGameDevice().GetSound();
 }
Beispiel #3
0
 public BackGround(string name)
 {
     this.name  = name;
     drawOrigin = new Vector2(0, 1);
     moveSpeed  = 100;
     position   = Vector2.Zero;
     position2  = new Vector2(0, -ShootingGame.GetGameDevice().GetRenderer().Textures[name].Height);
 }
Beispiel #4
0
 public Ending(IScene playScene)
 {
     gameDevice     = ShootingGame.GetGameDevice();
     this.playScene = playScene;
     renderer       = gameDevice.GetRenderer();
     sound          = gameDevice.GetSound();
     input          = gameDevice.GetInputState();
 }
Beispiel #5
0
 public Title()
 {
     gameDevice = ShootingGame.GetGameDevice();
     renderer   = gameDevice.GetRenderer();
     sound      = gameDevice.GetSound();
     input      = gameDevice.GetInputState();
     startText  = new StartText();
     endFlag    = false;
 }
Beispiel #6
0
 public GamePlay()
 {
     gameDevice = ShootingGame.GetGameDevice();
     renderer   = gameDevice.GetRenderer();
     sound      = gameDevice.GetSound();
     input      = gameDevice.GetInputState();
     map        = new Map();
     endTime    = new Timer(180.0f);
 }
Beispiel #7
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public Load()
        {
            renderer = ShootingGame.GetGameDevice().GetRenderer();
            sound    = ShootingGame.GetGameDevice().GetSound();

            textureLoader = new TextureLoader(renderer, TextureList());
            bgmLoader     = new BGMLoader(sound, BGMList());
            seLoader      = new SELoader(sound, SEList());
        }
Beispiel #8
0
 public Player(string name, int hp, float moveSpeed, IController controller, BulletFactory bulletFactory) : base(name, hp, controller, bulletFactory)
 {
     safeColider     = damegeColider;
     damegeColider   = new Circle(Vector2.Zero, 1f);
     this.moveSpeed  = moveSpeed;
     nowState        = State.START;
     startTimer      = new Timer(1.0f);
     flashTimer      = new Timer(0.1f);
     invincibleTimer = new Timer(1.5f);
     alpha           = 1.0f;
     sound           = ShootingGame.GetGameDevice().GetSound();
 }
Beispiel #9
0
        public Character(string name, int hp, IController controller, BulletFactory bulletFactory = null)
            : base(name)
        {
            this.hp = hp;
            nowHp   = hp;
            SetDamegeColider(new Circle(Vector2.Zero, ShootingGame.GetGameDevice().GetRenderer().Textures[name].Width / 2));
            SetEquip(controller, bulletFactory);

            //アニメションを設置
            deadAnime = new Animation(ShootingGame.GetGameDevice().GetRenderer(), "deadAnime", 0.1f, false);
            animationPlayer.SetAnimation(deadAnime);
        }
Beispiel #10
0
        public void Update(GameTime gameTime)
        {
            position  += drawOrigin * moveSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds * Parameters.GameSpeed;
            position2 += drawOrigin * moveSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds * Parameters.GameSpeed;

            if (position.Y > Screen.Height)
            {
                position.Y = position2.Y - ShootingGame.GetGameDevice().GetRenderer().Textures[name].Height;
            }
            if (position2.Y > Screen.Height)
            {
                position2.Y = position.Y - ShootingGame.GetGameDevice().GetRenderer().Textures[name].Height;
            }
        }
Beispiel #11
0
        public void GetControl(GameTime gameTime, ref Vector2 position, ref Vector2 velocity, ref BulletFactory bf)
        {
            fireTimer.Update(gameTime, Parameters.GameSpeed);

            velocity  = input.Velocity() * player.MoveSpeed;
            position += velocity * (float)gameTime.ElapsedGameTime.TotalSeconds * Parameters.GameSpeed;

            position = Vector2.Clamp(position, Vector2.Zero, new Vector2(Screen.GameWidth, Screen.GameHeight));

            if (input.CheckDownKey(Keys.Space, Buttons.RightTrigger) && fireTimer.IsTime())
            {
                bf.Fire(fireDirection * 1000);
                fireTimer.Initialize();
                ShootingGame.GetGameDevice().GetSound().PlaySE("shot");
            }
        }
Beispiel #12
0
 public Enemy(string name, int hp, IController controller, BulletFactory bulletFactroy) : base(name, hp, controller, bulletFactroy)
 {
     nowState = State.NORMAL;
     sound    = ShootingGame.GetGameDevice().GetSound();
     isAnim   = false;
 }
Beispiel #13
0
 public EnemyBulletTest() : base("enemybullet", BulletType.ENEMY, ColiderType.CIRLCE, 50)
 {
     colider = new Circle(Vector2.Zero, ShootingGame.GetGameDevice().GetRenderer().Textures["enemybullet"].Width / 2);
 }
Beispiel #14
0
 public void Init()
 {
     position  = new Vector2(0, 0);
     position2 = new Vector2(0, -ShootingGame.GetGameDevice().GetRenderer().Textures[name].Height);
 }
Beispiel #15
0
 public MyTestBullet() : base("circlebullet", BulletType.PLAYER, ColiderType.CIRLCE, 10)
 {
     colider = new Circle(Vector2.Zero, ShootingGame.GetGameDevice().GetRenderer().Textures["circlebullet"].Width / 2);
 }
Beispiel #16
0
 public DiffusionBullet() : base("enemybullet", BulletType.ENEMY, ColiderType.CIRLCE, 50)
 {
     colider = new Circle(Vector2.Zero, ShootingGame.GetGameDevice().GetRenderer().Textures["enemybullet"].Width / 2);
     fire    = new Timer(1.0f);
 }