當前位置: 首頁>>代碼示例>>C#>>正文


C# Animation.EnableRepeating方法代碼示例

本文整理匯總了C#中Animation.EnableRepeating方法的典型用法代碼示例。如果您正苦於以下問題:C# Animation.EnableRepeating方法的具體用法?C# Animation.EnableRepeating怎麽用?C# Animation.EnableRepeating使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Animation的用法示例。


在下文中一共展示了Animation.EnableRepeating方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Asteroid

 public Asteroid(Game game, GameScreen screen, Vector2 position, Vector2 velocity)
     : base(game, screen, position, velocity)
 {
     this.Layer = Layer.ASTEROID;
     width = 32;
     height = 32;
     scale = 2;
     asteroidAnimation = new Animation(game.Content, "Sprites/asteroid2", width, height, 8, 8);
     asteroidAnimation.EnableRepeating();
 }
開發者ID:sirchip,項目名稱:sadc-gamejam-test,代碼行數:10,代碼來源:Asteroid.cs

示例2: ZombieShip

        public ZombieShip(Game game, GameScreen screen, Vector2 position, ZombieType type)
            : base(game, screen, position)
        {
            this.random = new Random();

            this.Layer = Layer.ZOMBIE;

            this.type = type;

            switch (this.type)
            {
                case ZombieType.FLOATER:
                    this.width = 58;
                    this.height = 76;
                    zombieAnimationFlying = new Animation(this.Game.Content, "Sprites/paraZombie", width, height, 4, 5);
                    zombieAnimationFlying.EnableRepeating();
                    this.Velocity = new Vector2(0, 1 + this.NextFloat());
                    this.pointValue = 5;
                    break;
                case ZombieType.SHOOTER:
                    this.width = 30;
                    this.height = 17;
                    zombieAnimationFlying = new Animation(this.Game.Content, "Sprites/zombieShip", width, height, 2, 15);
                    zombieAnimationFlying.EnableRepeating();
                    this.Velocity = new Vector2(-1 * (2 + 4 * this.NextFloat()), 0);
                    this.pointValue = 10;
                    break;
                case ZombieType.SLAMMER:
                    this.width = 32;
                    this.height = 17;
                    zombieAnimationFlying = new Animation(this.Game.Content, "Sprites/kamakazi", width, height, 2, 15);
                    zombieAnimationFlying.EnableRepeating();
                    this.Velocity = new Vector2(0, -9 * (1 + 2 * this.NextFloat()));
                    this.pointValue = 25;
                    break;
                case ZombieType.CANNON:
                    this.width = 32;
                    this.height = 22;
                    zombieAnimationFlying = new Animation(this.Game.Content, "Sprites/bomberZombie", width, height, 8, 5);
                    zombieAnimationFlying.EnableRepeating();
                    Vector2 diff = Vector2.Subtract(this.Position, this.Screen.Player.Position);
                    this.Velocity = new Vector2(-10, - 0.5f - (diff.Y / 30) - (diff.X / 120));
                    this.pointValue = 5;
                    break;
            }

            this.ResetTimer();
        }
開發者ID:sirchip,項目名稱:sadc-gamejam-test,代碼行數:48,代碼來源:ZombieShip.cs

示例3: Initialize

 public override void Initialize()
 {
     bossAnimation = new Animation(this.Game.Content, "Sprites/boss1", 135, 109, 8, 7);
     bossAnimation.EnableRepeating();
     shipEntering = this.Game.Content.Load<SoundEffect>("SoundEffects/zombiedemon");
     shipExplosion = this.Game.Content.Load<SoundEffect>("SoundEffects/cannon");
     AudioManager.playSoundEffect(shipEntering);
     base.Initialize();
 }
開發者ID:sirchip,項目名稱:sadc-gamejam-test,代碼行數:9,代碼來源:Boss.cs

示例4: Initialize

 public override void Initialize()
 {
     width = 32;
     height = 16;
     this.lives = 0;
     shieldAnimation = new Animation(this.Game.Content, "Sprites/shield3", 40, 33, 4, 2);
     shieldAnimation.EnableRepeating();
     shipAnimationFlying = new Animation(this.Game.Content, "Sprites/playerShip", width, height, 2, 15);
     shipAnimationFlying.EnableRepeating();
     shipFiringSound = this.Game.Content.Load<SoundEffect>("SoundEffects/fire_laser1");
 }
開發者ID:jlturner85,項目名稱:sadc-gamejam-test,代碼行數:11,代碼來源:PlayerShip.cs

示例5: Initialize

 /// <summary>
 /// Allows the game component to perform any initialization it needs to before starting
 /// to run.  This is where it can query for any required services and load content.
 /// </summary>
 public override void Initialize()
 {
     selectedScreen = 4;//game screen
     int width = 32;
     int height = 16;
     gameMusic= game.Content.Load<Song>("Music/menumusic");
     shipAnimationFlying = new Animation(this.Game.Content, "Sprites/playerShip", width, height, 2, 15);
     texasAnimation = new Animation(this.game.Content,"Sprites/Texas_spriteSheet", 300, 300, 2, 15);
     //graphicsDevice = GameServices.GetService<GraphicsDevice>();
     spriteBatch = new SpriteBatch(game.GraphicsDevice);
     // TODO: Add your initialization code here
     content = game.Content;
     titleFont = content.Load<SpriteFont>("Fonts/titlefont");
     menuTickSound = content.Load<SoundEffect>("SoundEffects/fire_laser1");
     //texasSymbol = content.Load<Texture2D>("Sprites/Texas_spriteSheet");
     texasAnimation.EnableRepeating();
     shipAnimationFlying.EnableRepeating();
     ParallaxBackground.Initialize(this.content);
     base.Initialize();
 }
開發者ID:sirchip,項目名稱:sadc-gamejam-test,代碼行數:24,代碼來源:MenuScreen.cs


注:本文中的Animation.EnableRepeating方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。