package com.ezardlabs.lostsector.levels;

import com.ezardlabs.dethsquare.*;
import com.ezardlabs.lostsector.Game;
import com.ezardlabs.lostsector.MapManager;
import com.ezardlabs.lostsector.SurvivalManager;
import com.ezardlabs.lostsector.objects.CameraMovement;
import com.ezardlabs.lostsector.objects.Player;
import com.ezardlabs.lostsector.objects.hud.HUD;
import com.ezardlabs.lostsector.objects.warframes.Frost;

public class SurvivalLevel extends Level {
	private static CameraMovement cm = new CameraMovement();
	public SurvivalManager survivalManager = null;

	@Override
	public void onLoad() {
		MapManager.loadMap("Tiny_Sur");

		HUD.init();

		createPlayer();

		AudioSource as = new AudioSource();
		as.play(new AudioSource.AudioClip("audio/theme.ogg"));
		survivalManager = new SurvivalManager(MapManager.enemySpawns);
		GameObject.instantiate(new GameObject("Camera", new Camera(true), cm, as), new Vector2());
		GameObject.instantiate(new GameObject("SurvivalManager", survivalManager), new Vector2());

		TextureAtlas fontTA = new TextureAtlas("fonts/atlas.png", "fonts/atlas.txt");
		GameObject.instantiate(
				new GameObject(
						"MainMenuWIP",
						new GuiText("DEV BUILD : WORK IN PROGRESS!", fontTA, 30)
				),
				new Vector2(10, 10)
		);
	}

	public static void createPlayer() {
		Game.players = new GameObject[]{new GameObject("Player", new Player(), new Renderer(),
				new Animator(), new Frost(), new Collider(200, 200), new Rigidbody())};
		GameObject.instantiate(Game.players[0], MapManager.playerSpawn);

		cm.smoothFollow(Game.players[0].transform);
	}
}

@@ -1258,16 +1258,527 @@
 10)%0A%09%09);
+%0A%0A%09%09GameObject.instantiate(new GameObject(%22Survival Score%22, new GuiText(%22%22, fontTA, 40), new%0A%09%09%09%09Script() %7B%0A%09%09%09%09%09private GuiText guiText;%0A%09%09%09%09%09private int lastScore = -1;%0A%0A%09%09%09%09%09@Override%0A%09%09%09%09%09public void start() %7B%0A%09%09%09%09%09%09guiText = gameObject.getComponent(GuiText.class);%0A%09%09%09%09%09%7D%0A%0A%09%09%09%09%09@Override%0A%09%09%09%09%09public void update() %7B%0A%09%09%09%09%09%09if (survivalManager.score != lastScore) %7B%0A%09%09%09%09%09%09%09lastScore = survivalManager.score;%0A%09%09%09%09%09%09%09guiText.setText(%22Enemies killed: %22 + lastScore);%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D),%09new Vector2(10, 10));
 %0A%09%7D%0A%0A%09pu

Add survival score indicator