本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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");
}
示例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();
}