public void init() { gameMain = GameMain.getInstance(); materialManager = Materials.getInstance(); mapManager = MapManager.getInstance(); taskManager = TaskManager.getInstance(); // set up buttons UIButton addScientist = new UIButton("New Scientist", Color.Black); addScientist.y = 600 - addScientist.height; addScientist.onClickAction(addNewScientist); addToGUI(addScientist); UIButton addFlash = new UIButton("Wally", Color.Red); addFlash.y = 543; addFlash.onClickAction(bringtheflash); addToGUI(addFlash); Dictionary <int, string> mtrls = new Dictionary <int, string>(); mtrls.Add(Materials.NONE, "None"); mtrls.Add(Materials.WALL, "Wall"); mtrls.Add(2, "Chair"); mtrls.Add(3, "Pavement"); int btnNum = 2; foreach (KeyValuePair <int, string> e in mtrls) { // do something with entry.Value or entry.Key UIButton btn = new UIButton(); btn.text = "M: " + e.Value; btn.x = 0; btn.y = GameMain.gameHeight - (30 * btnNum) - 30; btn.val = e.Key; btn.onClickAction(material_select); addToGUI(btn); btnNum++; } // Texts TextField wel_txt = new TextField(); wel_txt.text = "I've been expecting you, Mr Kuan."; wel_txt.x = 50; wel_txt.y = 200; addToGUI(wel_txt); // Instructions TextField overText = new TextField(); overText.text = "Game Objective: Just complete this one, simple, easy experiment in 30 days"; overText.x = 10; overText.y = 10; overText.setColour(Color.Wheat); addToGUI(overText); TextField instruc_1 = new TextField(); instruc_1.text = "Step 1: Chemicals Amalgamation"; instruc_1.x = GameMain.gameWidth; instruc_1.y = 30; instruc_1.setColour(Color.White); addToGUI(instruc_1); TextField instruc_2 = new TextField(); instruc_2.text = "Step 2: Recrystalization Reaction"; instruc_2.x = GameMain.gameWidth; instruc_2.y = 30; instruc_2.setColour(Color.White * 0.5f); addToGUI(instruc_2); TextField instruc_3 = new TextField(); instruc_3.text = "Step 3: Product desiccation and collection"; instruc_3.x = GameMain.gameWidth; instruc_3.y = 30; instruc_3.setColour(Color.White * 0.2f); addToGUI(instruc_3); TweenManager.To(instruc_1, Tween.PropType.X, 10, 1000, Easing.Equations.QuartEaseOut); TweenManager.To(instruc_2, Tween.PropType.X, 300, 1500, Easing.Equations.QuartEaseOut); TweenManager.To(instruc_3, Tween.PropType.X, 600, 2000, Easing.Equations.QuartEaseOut); fps_txt = new TextField(); fps_txt.x = GameMain.gameWidth - fps_txt.getWidth(); fps_txt.y = 5; addToGUI(fps_txt); }
public Worker(string imgsrc) : base(imgsrc) { characterType = CharacterType.WORKER; mapManager = MapManager.getInstance(); }