public void update(float delta) {
		if (generateNewLevel)
			generate(currentLevel);
		if (startTime <= 0) {
			startTime = System.currentTimeMillis();
		}
		if (lives <= 0)
			gameover = true;
		for (int i = 0; i < entities.size(); i++) {
			entities.get(i).update(delta, this);
		}
		for (SwitchGate sg : switchGates) {
			if (sg != null) {
				for (int i = 0; i < sg.getGateSize(); i++) {
					if (sg.getOpen()) {
						setCell(0, sg.getGateX(i), sg.getGateY(i));
					}
					if (!sg.getOpen()) {
						setCell(0xAA, sg.getGateX(i), sg.getGateY(i));
					}
				}
			}
		}
	}