public void nextLevel() { this.level++; GameObject pGameObjCol; // store columns GameObject.Name[] columns = { GameObject.Name.AlienColumn_0, GameObject.Name.AlienColumn_1, GameObject.Name.AlienColumn_2, GameObject.Name.AlienColumn_3, GameObject.Name.AlienColumn_4, GameObject.Name.AlienColumn_5, GameObject.Name.AlienColumn_6, GameObject.Name.AlienColumn_7, GameObject.Name.AlienColumn_8, GameObject.Name.AlienColumn_9, GameObject.Name.AlienColumn_10 }; AlienFactory alienFactory = new AlienFactory(SpriteBatch.Name.Aliens, SpriteBatch.Name.Boxes); for (int i = 0; i < 11; i++) { // create column and add to column composite pGameObjCol = alienFactory.create(columns[i], AlienCategory.Type.Column); // add children to children composite pGameObjCol.add(alienFactory.create(GameObject.Name.Squid, AlienCategory.Type.Squid, 80.0f + 40 * i, 850.0f)); pGameObjCol.add(alienFactory.create(GameObject.Name.Crab, AlienCategory.Type.Crab, 80.0f + 40 * i, 800.0f)); pGameObjCol.add(alienFactory.create(GameObject.Name.Crab, AlienCategory.Type.Crab, 80.0f + 40 * i, 750.0f)); pGameObjCol.add(alienFactory.create(GameObject.Name.Octopus, AlienCategory.Type.Octopus, 80.0f + 40 * i, 700.0f)); pGameObjCol.add(alienFactory.create(GameObject.Name.Octopus, AlienCategory.Type.Octopus, 80.0f + 40 * i, 650.0f)); // add column to alien group composite this.add(pGameObjCol); } if (level > 1) { this.deltaX = 10 * (level - 1); this.deltaX += this.speedUp; this.goingDown = false; this.moveForward = true; TimeEvent pTimeEvent = TimerMan.Find(TimeEvent.Name.SquidAnimation); pTimeEvent.setDeltaTime(0.75f); pTimeEvent = TimerMan.Find(TimeEvent.Name.OctopusAnimation); pTimeEvent.setDeltaTime(0.75f); pTimeEvent = TimerMan.Find(TimeEvent.Name.CrabAnimation); pTimeEvent.setDeltaTime(0.75f); } }
public void addDifficult() { TimeEvent pTimeEvent = TimerMan.Find(TimeEvent.Name.SquidAnimation); float currDelta = pTimeEvent.getDeltaTime(); pTimeEvent.setDeltaTime(currDelta - 0.15f); pTimeEvent = TimerMan.Find(TimeEvent.Name.OctopusAnimation); currDelta = pTimeEvent.getDeltaTime(); pTimeEvent.setDeltaTime(currDelta - 0.15f); pTimeEvent = TimerMan.Find(TimeEvent.Name.CrabAnimation); currDelta = pTimeEvent.getDeltaTime(); pTimeEvent.setDeltaTime(currDelta - 0.15f); this.deltaX++; }