public override void activate(ContentHandler content, Zone currentZone, string activationCode) { switch (activationCode) { case "STATIONARY": stationary = true; setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type][activationCode], content.getObjectContentHandler().getObjectAnimationOffsets()[type][activationCode]); break; case "PUSH_UP": stationary = false; moveUp(currentZone); setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type][activationCode], content.getObjectContentHandler().getObjectAnimationOffsets()[type][activationCode]); break; case "PUSH_DOWN": stationary = false; moveDown(currentZone); setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type][activationCode], content.getObjectContentHandler().getObjectAnimationOffsets()[type][activationCode]); break; case "PUSH_RIGHT": stationary = false; moveRight(currentZone); setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type][activationCode], content.getObjectContentHandler().getObjectAnimationOffsets()[type][activationCode]); break; case "PUSH_LEFT": stationary = false; moveLeft(currentZone); setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type][activationCode], content.getObjectContentHandler().getObjectAnimationOffsets()[type][activationCode]); break; default: break; } }
public void loadZones(ContentHandler content, int zoneNumber) { if (zoneNumber < 0) { testZoneFactory.loadZones(content); } }
public GameInit(ContentManager content) { player = new Player(); contentHandler = new ContentHandler(content); paintHandler = new PaintHandler(this); inventoryPaintHandler = new InventoryPaintHandler(this); keyHandler = new KeyHandler(this); inventoryKeyHandler = new InventoryKeyHandler(this); chatPaintHandler = new ChatPaintHandler(this); chatKeyHandler = new ChatKeyHandler(this); gameState = new GameState(); zoneFactory = new ZoneFactory(); }
public override void activate(ContentHandler content, Zone currentZone, string activationCode) { switch (activationCode) { case "STATIONARY": stationary = true; if (energy == 6) { setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type][activationCode], content.getObjectContentHandler().getObjectAnimationOffsets()[type][activationCode]); } else if (energy == 4) { setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type]["STATIONARY_DEPLETED1"], content.getObjectContentHandler().getObjectAnimationOffsets()[type]["STATIONARY_DEPLETED1"]); } else if (energy == 2) { setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type]["STATIONARY_DEPLETED2"], content.getObjectContentHandler().getObjectAnimationOffsets()[type]["STATIONARY_DEPLETED2"]); } else { setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type]["STATIONARY_DEPLETED3"], content.getObjectContentHandler().getObjectAnimationOffsets()[type]["STATIONARY_DEPLETED3"]); } break; case "DRAIN": Console.WriteLine("DRAIIINN"); stationary = false; if (energy == 6) { Console.WriteLine("new animation"); energy -= 2; setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type]["DRAIN_0TO1"], content.getObjectContentHandler().getObjectAnimationOffsets()[type]["DRAIN_0TO1"]); } else if (energy == 4) { energy -= 2; setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type]["DRAIN_1TO2"], content.getObjectContentHandler().getObjectAnimationOffsets()[type]["DRAIN_1TO2"]); } else if (energy == 2) { energy -= 2; setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type]["DRAIN_2TO3"], content.getObjectContentHandler().getObjectAnimationOffsets()[type]["DRAIN_2TO3"]); } break; default: break; } }
public abstract void activate(ContentHandler content, Zone currentZone, string activationCode);
public void loadZones(ContentHandler content) { testTileZone = new TestTileZone(30, 30); testTileZone.setStationaryImages(content); testTileZone.setStationaryNPCImages(content); }
public void setStationaryNPCImages(ContentHandler content) { for (int i = 0; i < npcList.Count; i++) { int direction = npcList[i].getFacingDirection(); if (direction == 0) { npcList[i].setNewAnimation(content.getNPCContentHandler().getNPCImages()[npcList[i].getName()]["STATIONARY_UP"]); } else if (direction == 1) { npcList[i].setNewAnimation(content.getNPCContentHandler().getNPCImages()[npcList[i].getName()]["STATIONARY_DOWN"]); } else if (direction == 2) { npcList[i].setNewAnimation(content.getNPCContentHandler().getNPCImages()[npcList[i].getName()]["STATIONARY_RIGHT"]); } else if (direction == 3) { npcList[i].setNewAnimation(content.getNPCContentHandler().getNPCImages()[npcList[i].getName()]["STATIONARY_LEFT"]); } } }
public void setStationaryImages(ContentHandler content) { for (int i = 0; i < objectList.Count; i++) { objectList[i].activate(content, this, "STATIONARY"); } }