コード例 #1
0
ファイル: tree.cs プロジェクト: glocklueng/STM32F4_RF
 public void Initialize(Animations animation, Vector2 position)
 {
     EnemyAnimation = animation;
     Position = position;
     Active = true;
     UpdateTransform();
 }
コード例 #2
0
ファイル: Enemy.cs プロジェクト: glocklueng/STM32F4_RF
 public void Initialize(Animations animation, Vector2 position)
 {
     EnemyAnimation = animation;
     Position = position;
     Active = true;
     Health = 10;
     Damage = 10;
     enemyMoveSpeed = 7f;
     Value = 100;
     UpdateTransform();
 }
コード例 #3
0
ファイル: Plane.cs プロジェクト: glocklueng/STM32F4_RF
        public void Initialize(Animations animation, Vector2 position)
        {
            this.PlayerAnimation = animation;
            this.Position = position;

            this.Active = true;

            this.Alive = true;

            this.StaticSpeed = 3f;
            this.speed = 3f;

            this.rotation = 0f;
            UpdateTransform();
        }
コード例 #4
0
ファイル: Game1.cs プロジェクト: glocklueng/STM32F4_RF
 private void AddTree()
 {
     Animations treeAnimation = new Animations();
     Vector2 position;
     int r = random.Next(0, 3);
     if (r == 0)
     {
         treeAnimation.Initialize(tree1Texture, Vector2.Zero, 160, 227, 1, 60, Color.White, 1f, true, 1);
         position = new Vector2(GraphicsDevice.Viewport.Width + tree1Texture.Width + random.Next(0, 150), (GraphicsDevice.Viewport.Height - ground) - tree1Texture.Height / 2);
     }
     else if(r == 1)
     {
         treeAnimation.Initialize(tree2Texture, Vector2.Zero, 124, 220, 1, 60, Color.White, 1f, true, 1);
         position = new Vector2(GraphicsDevice.Viewport.Width + tree2Texture.Width + random.Next(0,150), (GraphicsDevice.Viewport.Height - ground) - tree2Texture.Height / 2);
     }
     else {
         treeAnimation.Initialize(tree3Texture, Vector2.Zero, 128, 250, 1, 60, Color.White, 1f, true, 1);
         position = new Vector2(GraphicsDevice.Viewport.Width + tree3Texture.Width + random.Next(0, 150), (GraphicsDevice.Viewport.Height - ground) - tree3Texture.Height / 2);
     }
     tree Tre = new tree();
     Tre.Initialize(treeAnimation, position);
     tree.Add(Tre);
 }
コード例 #5
0
ファイル: Game1.cs プロジェクト: glocklueng/STM32F4_RF
 private void AddEnemy()
 {
     Animations enemyAnimation = new Animations();
     enemyAnimation.Initialize(enemyTexture, Vector2.Zero, 178, 60, 1, 60, Color.White, 1f, true, 1);
     Vector2 position = new Vector2(GraphicsDevice.Viewport.Width + enemyTexture.Width, random.Next(50, GraphicsDevice.Viewport.Height - 350));
     Enemy enemy = new Enemy();
     enemy.Initialize(enemyAnimation, position);
     enemies.Add(enemy);
 }
コード例 #6
0
ファイル: Game1.cs プロジェクト: glocklueng/STM32F4_RF
 private void AddExplosion(Vector2 position)
 {
     Animations explosion = new Animations();
     explosion.Initialize(explosionTexture, position, 134, 134, 12, 60, Color.White, 1f, false, 1);
     explosions.Add(explosion);
 }
コード例 #7
0
ファイル: Game1.cs プロジェクト: glocklueng/STM32F4_RF
        protected override void LoadContent()
        {
            
            spriteBatch = new SpriteBatch(GraphicsDevice);


            Animations playerAnimation = new Animations();
            Texture2D playerTexture = Content.Load<Texture2D>("plane3");
            playerAnimation.Initialize(playerTexture, Vector2.Zero, 164, 55, 6, 20, Color.White, 1f, true, 1);
            playerPosition = new Vector2(170, 155);

            player.Initialize(playerAnimation, playerPosition);

            enemyTexture = Content.Load<Texture2D>("f16");

            explosionTexture = Content.Load<Texture2D>("explosion2");

            tree1Texture = Content.Load<Texture2D>("treeA");
            tree2Texture = Content.Load<Texture2D>("treeB");
            tree3Texture = Content.Load<Texture2D>("treeC");

            lampaon = Content.Load<Texture2D>("lampaon");
            lampaoff = Content.Load<Texture2D>("lampaoff");
            recLamp = new Rectangle(30, 500, 70, 70);

            sky = Content.Load<Texture2D>("sky");

            BACKGROUNDS = new AllBackground(this.Content, player);
        }