@@ -94,6 +94,7 @@ public Game() {
9494 getFrame ().setLocationRelativeTo (null );
9595 getFrame ().setVisible (true );
9696
97+ requestFocus ();
9798 setDevMode (false );
9899 setClosing (false );
99100 }
@@ -172,6 +173,25 @@ public static int getMap() {
172173 return map ;
173174 }
174175
176+ public void setMap (String Map_str ) {
177+ setLevel (new LevelHandler (Map_str ));
178+ if (alternateCols [0 ]) {
179+ Game .setShirtCol (240 );
180+ }
181+ if (!alternateCols [0 ]) {
182+ Game .setShirtCol (111 );
183+ }
184+ if (alternateCols [1 ]) {
185+ Game .setFaceCol (310 );
186+ }
187+ if (!alternateCols [1 ]) {
188+ Game .setFaceCol (543 );
189+ }
190+ setPlayer (new Player (level , 100 , 100 , input ,
191+ getJdata_UserName (), shirtCol , faceCol ));
192+ level .addEntity (player );
193+ }
194+
175195 public static void setMap (int map ) {
176196 Game .map = map ;
177197 }
@@ -284,25 +304,6 @@ public static void setClosing(boolean closing) {
284304 Game .closingMode = closing ;
285305 }
286306
287- public void setMap (String Map_str ) {
288- setLevel (new LevelHandler (Map_str ));
289- if (alternateCols [0 ]) {
290- Game .setShirtCol (240 );
291- }
292- if (!alternateCols [0 ]) {
293- Game .setShirtCol (111 );
294- }
295- if (alternateCols [1 ]) {
296- Game .setFaceCol (310 );
297- }
298- if (!alternateCols [1 ]) {
299- Game .setFaceCol (543 );
300- }
301- setPlayer (new Player (level , 100 , 100 , input ,
302- getJdata_UserName (), shirtCol , faceCol ));
303- level .addEntity (player );
304- }
305-
306307 public void init () {
307308 setGame (this );
308309 int index = 0 ;
0 commit comments