|
3 | 3 | import io.exterminator3618.client.Exterminator3618; |
4 | 4 | import io.exterminator3618.client.api.ApiClient; |
5 | 5 | import io.exterminator3618.client.api.RoomStatus; |
| 6 | +import io.exterminator3618.client.components.Ball; |
6 | 7 | import io.exterminator3618.client.components.TextButton; |
7 | 8 | import org.slf4j.Logger; |
8 | 9 | import org.slf4j.LoggerFactory; |
|
11 | 12 | import java.util.LinkedList; |
12 | 13 | import java.util.Queue; |
13 | 14 |
|
14 | | -import static io.exterminator3618.client.Constants.POLL_INTERVAL_MS; |
| 15 | +import static io.exterminator3618.client.Constants.*; |
| 16 | +import static io.exterminator3618.client.Constants.BALL_HEIGHT; |
| 17 | +import static io.exterminator3618.client.Constants.BALL_REGION_NAME; |
| 18 | +import static io.exterminator3618.client.Constants.BALL_SPEED; |
| 19 | +import static io.exterminator3618.client.Constants.BALL_WIDTH; |
| 20 | +import static io.exterminator3618.client.Constants.WINDOW_HEIGHT; |
15 | 21 |
|
16 | 22 | public class OnlineGameScreen extends GameScreen { |
17 | 23 |
|
@@ -42,7 +48,15 @@ public OnlineGameScreen(Exterminator3618 game) { |
42 | 48 | log.error("Failed to fetch initial room status"); |
43 | 49 | throw new IllegalStateException("Failed to launch online game screen"); |
44 | 50 | } |
45 | | - loadLevel(Integer.parseInt(mapCode.substring(5)), null); |
| 51 | + loadLevel(Integer.parseInt(mapCode.substring(5)), new Ball( |
| 52 | + WINDOW_WIDTH / 2 - BALL_WIDTH / 2, |
| 53 | + WINDOW_HEIGHT / 2 - BALL_HEIGHT / 2, |
| 54 | + BALL_WIDTH, |
| 55 | + BALL_HEIGHT, |
| 56 | + BALL_REGION_NAME, |
| 57 | + BALL_SPEED, |
| 58 | + 67 |
| 59 | + )); |
46 | 60 | startTime = System.currentTimeMillis(); |
47 | 61 | statusPollingThread.start(); |
48 | 62 | } |
@@ -90,10 +104,10 @@ private void pollStatus() { |
90 | 104 | public void render(float delta) { |
91 | 105 | super.render(delta); |
92 | 106 | renderer.begin(); |
93 | | - renderer.setFontSize(14); |
| 107 | + renderer.setFontSize(24); |
94 | 108 | synchronized (playerStates) { |
95 | 109 | for (int i = 0; i < playerStates.size(); i++) { |
96 | | - renderer.drawText(playerStates.get(i), 50, 850 - i * 30); |
| 110 | + renderer.drawText(playerStates.get(i), 1400, 400 - i * 50); |
97 | 111 | } |
98 | 112 | } |
99 | 113 | renderer.setFontSize(36); |
|
0 commit comments