public Digdug(Hose hose) { originalPosition = new Vector2(START_POSITION_X, START_POSITION_Y); Visible = true; source = new Rectangle(536, 176, 56, 56); this.hose = hose; }
public Monster(Hose hose, int X, int Y, String assetName, Rock[] rocks, int monster_speed) { deadWatch = new Stopwatch(); walkWatch = new Stopwatch(); this.monster_speed = monster_speed; this.rocks = rocks; multiplier = 1; Visible = true; this.X = X; this.Y = Y; originalPosition = new Vector2(X * 56, Y * 56); Position = new Vector2(X * 56, Y * 56); source = new Rectangle(56, 0, 56, 56); this.hose = hose; this.assetName = assetName; fire = new Fire(); if (assetName.Equals("fygar")) { multiplier = 2; } stopwatch = new Stopwatch(); fireWatch = new Stopwatch(); ghostWatch = new Stopwatch(); timeAsGhost = new Stopwatch(); fireWatch.Start(); ghostWatch.Start(); walkWatch.Start(); growCount = 0; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here pause = false; win = false; levelReset(); hose = new Hose(); digdug = new Digdug(hose); rocks[0] = new Rock(5, 5); rocks[1] = new Rock(9, 10); rocks[2] = new Rock(14, 3); currentKeyboardState = Keyboard.GetState(); pauseCounter = 0; monsters1[0] = new Monster(hose, 1, 3, "pooka", rocks, 2); monsters1[1] = new Monster(hose, 5, 9, "fygar", rocks, 2); monsters1[2] = new Monster(hose, 12, 2, "pooka", rocks, 2); monsters1[3] = new Monster(hose, 11, 10, "pooka", rocks, 2); monsters2[0] = new Monster(hose, 1, 3, "pooka", rocks, 4); monsters2[1] = new Monster(hose, 5, 9, "fygar", rocks, 4); monsters2[2] = new Monster(hose, 12, 2, "pooka", rocks, 4); monsters2[3] = new Monster(hose, 11, 10, "pooka", rocks, 4); monsters2[4] = new Monster(hose, 1, 4, "fygar", rocks, 4); monsters2[5] = new Monster(hose, 13, 2, "fygar", rocks, 4); deadMonsters = 0; score = 0; levelnum = 1; lives = 2; stopwatch.Start(); base.Initialize(); }