public bool Update(GameTime gameTime, GameUnit playerX) { flightAngle += AngularVelocity * (float)gameTime.ElapsedGameTime.TotalMilliseconds; facing = x + Units.HalfTile > playerX ? CaveStory.SpriteState.HorizontalFacing.Left : CaveStory.SpriteState.HorizontalFacing.Right; y = flightCenterY + FlightAmplitude * (float)Math.Sin(MathHelper.ToRadians(flightAngle)); sprites[SpriteState].Update(); return(alive); }
public FirstCaveBat(ContentManager Content, GameUnit x, GameUnit y) { sprites = new Dictionary <BatSpriteState, Sprite>(); this.x = x; this.y = y; flightCenterY = y; alive = true; flightAngle = 0.0f; facing = CaveStory.SpriteState.HorizontalFacing.Right; damageText = new FloatingNumber(Content, FloatingNumber.NumberType.Damage); InitializeSprites(Content); }
public FirstCaveBat(ContentManager Content, GameUnit x, GameUnit y) { sprites = new Dictionary<BatSpriteState, Sprite>(); this.x = x; this.y = y; flightCenterY = y; alive = true; flightAngle = 0.0f; facing = CaveStory.SpriteState.HorizontalFacing.Right; damageText = new FloatingNumber(Content, FloatingNumber.NumberType.Damage); InitializeSprites(Content); }
public DeathCloudParticle(ContentManager Content, GameUnit centerX, GameUnit centerY, VelocityUnit speed, DegreesUnit angle) { this.centerX = centerX - Units.HalfTile; this.centerY = centerY - Units.HalfTile; this.speed = speed; offset = new PolarVector(0, angle); sprite = new AnimatedSprite(Content, SpriteName, Units.TileToPixel(SourceX), Units.TileToPixel(SourceY), Units.TileToPixel(SourceWidth), Units.TileToPixel(SourceHeight), Fps, NumFrames); }
public PolarVector(GameUnit magnitude, DegreesUnit angle) { this.magnitude = magnitude; this.angle = angle; }
public bool Update(GameTime gameTime, GameUnit playerX) { flightAngle += AngularVelocity * (float)gameTime.ElapsedGameTime.TotalMilliseconds; facing = x + Units.HalfTile > playerX ? CaveStory.SpriteState.HorizontalFacing.Left : CaveStory.SpriteState.HorizontalFacing.Right; y = flightCenterY + FlightAmplitude * (float)Math.Sin(MathHelper.ToRadians(flightAngle)); sprites[SpriteState].Update(); return alive; }