コード例 #1
0
ファイル: Goomba.cs プロジェクト: yjean0624/CSE3902
 public Goomba(Vector2 location) : base(location)
 {
     state   = new LeftMovingGoombaState(this);
     sprite  = SpriteMachine.Instance.CreateSprite(SpriteMachine.SpriteTag.Goomba);
     Physics = new Physics(location);
     Physics.yAcceleration = Config.GetGravity();
 }
コード例 #2
0
ファイル: Goomba.cs プロジェクト: KingKumar/mario
 public Goomba(Vector2 location,int isMovingRight,Level level)
 {
     this.location = location;
     this.level = level;
     this.isMovingRight = 1;
     iGoomba = GoombaFactory.CreateWalkingGoomba(level);
 }
コード例 #3
0
ファイル: Goomba.cs プロジェクト: gen-xu/MelloMario
 public Goomba(IWorld world, Point location, IListener <IGameObject> listener) : base(
         world,
         location,
         listener,
         new Point(32, 32),
         32)
 {
     SoundEventArgs = new SoundArgs();
     state          = new GoombaStates.Normal(this);
     UpdateSprite();
 }
コード例 #4
0
 public void Update()
 {
     if (state is GoombaSmashedState && deathTimer == IEnemyObjectConstants.STOMPEDGOOMBADELAYTIME)
     {
         location.Y += IEnemyObjectConstants.VANISH;
         deathTimer = 0;
         state = new GoombaWalkingLeftState(this);
     }
     else if (state is GoombaSmashedState)
     {
         deathTimer++;
     }
     if (!isHit)
     {
         location = physics.Update(location);
     }
     sprite.Update();
 }
コード例 #5
0
ファイル: Goomba.cs プロジェクト: KingKumar/mario
 public void TakeDamage()
 {
     iGoomba = GoombaFactory.CreateDeadGoomba(level);
     isDead = true;
     isLethal = false;
     goombaX = 0;
     goombaY = 0;
     level.game.sounds.Kick();
 }
コード例 #6
0
 public Goomba(Game1 game)
 {
     myGame = game;
     physics = new MarioGamePhysics();
     state = new GoombaWalkingLeftState(this);
 }