コード例 #1
0
ファイル: FirstCaveBat.cs プロジェクト: mrhaboobi/CaveStory
 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);
 }
コード例 #2
0
ファイル: FirstCaveBat.cs プロジェクト: mrhaboobi/CaveStory
 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);
 }
コード例 #3
0
ファイル: FirstCaveBat.cs プロジェクト: coler706/CaveStory
 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);
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 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);
 }
コード例 #6
0
ファイル: PolarVector.cs プロジェクト: mrhaboobi/CaveStory
 public PolarVector(GameUnit magnitude, DegreesUnit angle)
 {
     this.magnitude = magnitude;
     this.angle     = angle;
 }
コード例 #7
0
ファイル: FirstCaveBat.cs プロジェクト: coler706/CaveStory
 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;
 }
コード例 #8
0
ファイル: PolarVector.cs プロジェクト: coler706/CaveStory
 public PolarVector(GameUnit magnitude, DegreesUnit angle)
 {
     this.magnitude = magnitude;
     this.angle = angle;
 }