public void TestCollisionResponse_Megaman_Block_FromLeft(Megaman megaMan, Block block) { megaMan = new Megaman(new Vector2(50, 240), megamanGame.Content); block = new Block(new Vector2(100, 240), BlockState.Question, megaMan, megamanGame.Content); megaMan.RightCommand(); megaMan.ActionState.UpdatePosition(new Vector2(105, 240), gameTime); }
public StageFactory(MegamanGame game) { this.content = game.Content; this.game = game; this.megaman = game.Megaman; enemySpriteFactory = new EnemySpriteFactory(content); itemSpriteFactory = new ItemSpriteFactory(content); }
protected override void collect(Megaman megaman) { megaman.Coins++; megaman.Points += pointValue; if (megaman.Health < megaman.MaxHealth) { megaman.Health++; } }
public ControllerFactory(Scene scene, MegamanGame game, Megaman megaman) { this.scene = scene; this.game = game; this.megaman = megaman; bindings = new Dictionary<Tuple<Keys, Buttons>, ICommand>(); Reset(); }
protected override void Initialize() { Megaman = new Megaman(Content); sceneFactory = new StageFactory(this); sceneFactory.GetScene("start").Enter(); highscore = new HighScore(Megaman, graphics); base.Initialize(); }
public void TestMethod1() { Megaman mm = new Megaman(mmGame.Content); Block block = new Block(new Vector2(0, 0), BlockState.Pyramid, mm, mmGame.Content); block.Collide(mm); BlockState state = BlockState.Colliding; Assert.AreEqual(state, block.CurrentState); }
public HUD(ContentManager content, Megaman megaman, Stage stage) { characterTexture = content.Load<Texture2D>("items/megaman_helmet"); font = content.Load<SpriteFont>("Fonts/HUD_Font"); fullHealthbarTexture = content.Load<Texture2D>("HUD/full_health"); lifeTankTexture = content.Load<Texture2D>("items/life_tank"); emptyHealthbarTexture = content.Load<Texture2D>("HUD/no_health"); this.megaman = megaman; this.stage = stage; }
protected override void collect(Megaman megaman) { megaman.Lives++; if (megaman.MaxHealth - megaman.Health < 10) { megaman.Health = megaman.MaxHealth; } else { megaman.Health += 10; } }
public override void Reveal(Megaman megaman) { base.Reveal(megaman); if (megaman.Velocity.X >= 0) { this.acceleration.X = 30; } else { this.acceleration.X = -30; } }
public void ETankCollideZeroMegaman() { ETank tank = new ETank(mmGame.Content, new Vector2(0, 0)); Megaman mm = new Megaman(mmGame.Content); mm.CurrentPowerUpState = mm.PowerUpStateMachine.getState(MegamanState.Zero); mm.StateChanged(); tank.Collide(mm); IMegamanPowerUpState expectedState = mm.PowerUpStateMachine.getState(MegamanState.Zero); Assert.AreEqual(expectedState, mm.CurrentPowerUpState); }
public Block(Vector2 position, BlockState initialType, Megaman megaman, ContentManager content) { spriteFactory = new BlockSpriteFactory(content); stateMachine = new BlockStateMachine(this, megaman); currentState = stateMachine.GetState(BlockState.Normal); currentType = initialType; currentSprite = spriteFactory.GetSprite(BlockStateHelper.GetState(currentType, currentState)); currentSprite.Position = position; initialPosition = position; this.initialType = initialType; }
public void TestCollisionResponse_Megaman_Met_FromLeft() { megaMan = new Megaman(new Vector2(300, 354), megamanGame.Content); metWalking = new MetWalking(megamanGame.Content); metWalking.Position = new Vector2(400, 354); megaMan.ActionState.UpdatePosition(new Vector2(401, 354), gameTime); IMegamanPowerUpState actualState = megaMan.PowerUpState; IMegamanPowerUpState expectedState = megaMan.PowerUpStateMachine.getState(MegamanState.Dead); Assert.AreEqual(expectedState, actualState); }
protected override void collect(Megaman megaman) { megaman.ZeroTransition(); megaman.Points += pointValue; if (megaman.MaxHealth - megaman.Health < 10) { megaman.Health = megaman.MaxHealth; } else { megaman.Health += 10; } }
protected override void collect(Megaman megaman) { megaman.Points += pointValue; megaman.Points += 200; megaman.LargeTransition(); if (megaman.MaxHealth - megaman.Health < 5) { megaman.Health = megaman.MaxHealth; } else { megaman.Health += 5; } }
public override void Collide(ICollidable otherObject) { if (otherObject is Megaman && active) { sound.Play(); megaman = otherObject as Megaman; megaman.Coins++; megaman.Points += 200; if (megaman.Health < megaman.MaxHealth) { megaman.Health++; } active = false; } }
public override void Collide(ICollidable otherObject) { if (otherObject is Megaman && active) { sound.Play(); megaman = otherObject as Megaman; megaman.Lives++; if (megaman.MaxHealth - megaman.Health < 10) { megaman.Health = megaman.MaxHealth; } else { megaman.Health += 10; } active = false; } }
public HighScore(Megaman megaman, GraphicsDeviceManager graphics) { this.megaman = megaman; this.graphics = graphics; isDead = false; try { FileStream fileStream = new FileStream(HIGH_SCORE_FILE, FileMode.Open, FileAccess.Read); BinaryReader binaryReader = new BinaryReader(fileStream); highScore = binaryReader.ReadInt32(); binaryReader.Close(); fileStream.Close(); } catch (IOException) { highScore = 0; } }
public override void Collide(ICollidable otherObject) { if (otherObject is Megaman && active) { sound.Play(); megaman = otherObject as Megaman; megaman.LargeTransition(); megaman.Points += 1000; megaman.Points += 200; if (megaman.MaxHealth - megaman.Health < 5) { megaman.Health = megaman.MaxHealth; } else { megaman.Health += 5; } active = false; } }
public MMBullet2(ContentManager content, Rectangle mmBox, int direction, Megaman megaman) : base(new Rectangle(0, 0, 32, 32), new Rectangle(0, 0, 64, 64), 0, Vector2.Zero, content.Load<Texture2D>("megaman/MMBullet3")) { sound = content.Load<SoundEffect>("Sounds/mm7/MMShot1"); maxVelocity.X = 300; minVelocity.X = -300; velocity.X = 300 * direction; acceleration.X = 1 * direction; if (direction < 0) { position.X = mmBox.X - aabb.Width; } else { position.X = mmBox.X + mmBox.Width; } position.Y = mmBox.Y + (mmBox.Height / 2) - (aabb.Height / 2); this.megaman = megaman; }
public virtual void Reveal(Megaman megaman) { this.megaman = megaman; active = true; position = new Vector2(block.CurrentSprite.Position.X, block.CurrentSprite.Position.Y - 32); }
public void TestInitialize(Megaman megaMan, Block block) { this.megaMan = megaMan; this.block = block; }
public UpCommand(Megaman megaman) { this.megaman = megaman; }
public LeftCommand(Megaman megaman) { this.megaman = megaman; }
public BusterCommand(Megaman megaman) { this.megaman = megaman; }
public LivesTextSource(Megaman megaman) { this.megaman = megaman; }
public DownCommand(Megaman megaman) { this.megaman = megaman; }
protected abstract void collect(Megaman megaman);
public RightCommand(Megaman megaman) { this.megaman = megaman; }
public Buster(Megaman megaman) { this.megaman = megaman; }