public override void enterState() { new Background("bgs/bgtile", 0, 0); RenderingEngine.camera.setScale(Constants.GAMESCALE * (Constants.DEBUG ? 1366f / 1920f : 1)); RenderingEngine.camera.setPosition(new Vector2(1920 / 2, 1080 / 2)); RenderingEngine.ambientLight = Color.Gray; RenderingEngine.UI.addText(ai_data = new HUDText("AI Level", new Vector2(1250, 20), customfont, Color.White)); RenderingEngine.UI.addText(time = new HUDText("Timer", new Vector2(50, 20), customfont, Color.White)); timer = Constants.TIMEINTRO + Constants.TIMEMILLIS; map = new Map(mapname, content); players = new Player[4]; scores = new HUDText[4]; large = new HUDText("Starting", new Vector2(880, 500), customfont2, Color.White); RenderingEngine.UI.addText(large); toggles = new bool[4]; this.spawns = map.spawns; for (int i = 0; i < 4; i++) { players[i] = new Player(map.spawns, i + 1, this); scores[i] = new HUDText("0", new Vector2(500 + i * 140, 20), customfont, (i == 0 ? Color.Red : (i == 1 ? Color.Yellow : (i == 2 ? Color.LightGreen : Color.Blue)))); RenderingEngine.UI.addText(scores[i]); toggles[i] = false; } //SoundManager.PlayMusicLooped("sound/4614(2)"); fs = File.Open("dw_kb_" + DateTime.Now.Hour + "-" + DateTime.Now.Minute + "-" + DateTime.Now.Second + ".txt", FileMode.OpenOrCreate, FileAccess.Write); writeString(mapname); }
public Disk(Player p, String name, Vector2 position, Color light) { player = p; animation = Animation.createSingleFrameAnimation(name, position, 0.85f); disklight = new Light(light, animation.position, Constants.DISKLIGHTPOWER * 2, Constants.DISKLIGHTSIZE); diskVelocity = Constants.DISKVELOCITY; diskRadius = Constants.DISKRADIUS; diskPierce = false; }