当前位置: 首页>>代码示例>>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;未经允许,请勿转载。