Skip to content

Commit a413e46

Browse files
committed
Merge remote-tracking branch 'origin/aside'
2 parents c878ba8 + 7833518 commit a413e46

File tree

6 files changed

+48
-4
lines changed

6 files changed

+48
-4
lines changed

res/JSplashScreen.jar

5.04 KB
Binary file not shown.

res/levels/water_level.png

316 Bytes
Loading

res/splash/splash.png

9.65 KB
Loading

res/sprite_sheet.png

115 Bytes
Loading

src/com/redomar/game/Game.java

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.awt.BorderLayout;
44
import java.awt.Canvas;
5+
import java.awt.Color;
56
import java.awt.Dimension;
67
import java.awt.Graphics;
78
import java.awt.image.BufferStrategy;
@@ -19,6 +20,7 @@
1920
import com.redomar.game.net.GameClient;
2021
import com.redomar.game.net.GameServer;
2122
import com.redomar.game.net.packets.Packet00Login;
23+
import com.thehowtotutorial.splashscreen.JSplash;
2224

2325
public class Game extends Canvas implements Runnable {
2426

@@ -30,6 +32,8 @@ public class Game extends Canvas implements Runnable {
3032
public static final int SCALE = 3;
3133
public static final String NAME = "Game";
3234
public static Game game;
35+
private static int Jdata_Host;
36+
private static String Jdata_UserName;
3337

3438
private JFrame frame;
3539

@@ -50,7 +54,7 @@ public class Game extends Canvas implements Runnable {
5054

5155
private GameClient socketClient;
5256
private GameServer socketServer;
53-
57+
5458
public Game() {
5559
setMinimumSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));
5660
setMaximumSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));
@@ -87,7 +91,7 @@ public void init() {
8791
setLevel(new LevelHandler("/levels/water_level.png"));
8892

8993
setPlayer(new PlayerMP(getLevel(), 100, 100, input,
90-
JOptionPane.showInputDialog(this, "Enter a name"), null, -1));
94+
Jdata_UserName, null, -1));
9195

9296
level.addEntity(player);
9397
Packet00Login loginPacket = new Packet00Login(player.getUsername(), player.x, player.y);
@@ -104,7 +108,7 @@ public synchronized void start() {
104108
running = true;
105109
new Thread(this).start();
106110

107-
if (JOptionPane.showConfirmDialog(this, "Do you want to be the HOST?") == 0) {
111+
if (Jdata_Host == 0) {
108112
socketServer = new GameServer(this);
109113
socketServer.start();
110114
}
@@ -207,7 +211,41 @@ public void render() {
207211
}
208212

209213
public static void main(String[] args) {
210-
new Game().start();
214+
try {
215+
JSplash splash = new JSplash(Game.class.getResource("/splash/splash.png"), true, true, false, "v1.3 Alpha", null, Color.RED, Color.ORANGE);
216+
splash.splashOn();
217+
splash.setProgress(10, "Initializing Game");
218+
Thread.sleep(1500);
219+
splash.setProgress(25, "Loading Classes");
220+
Thread.sleep(1000);
221+
splash.setProgress(35, "Applying Configurations");
222+
Thread.sleep(1000);
223+
splash.setProgress(40, "Loading Sprites");
224+
Thread.sleep(1500);
225+
splash.setProgress(50, "Loading Textures");
226+
Thread.sleep(1000);
227+
splash.setProgress(60, "Loading Map");
228+
Thread.sleep(3000);
229+
splash.setProgress(80, "Configuring Map");
230+
Thread.sleep(1000);
231+
splash.setProgress(90, "Pulling InputPanes");
232+
Thread.sleep(1500);
233+
splash.setProgress(92, "Aquring data: Multiplayer");
234+
Thread.sleep(200);
235+
Jdata_Host = JOptionPane.showConfirmDialog(game, "Do you want to be the HOST?");
236+
Thread.sleep(200);
237+
if(Jdata_Host == 0){
238+
splash.setProgress(95, "Aquring data: Username");
239+
Thread.sleep(200);
240+
Jdata_UserName = JOptionPane.showInputDialog(game, "Enter a name");
241+
Thread.sleep(200);
242+
}
243+
splash.splashOff();
244+
new Game().start();
245+
} catch (Exception e) {
246+
e.printStackTrace();
247+
}
248+
211249
}
212250

213251
public JFrame getFrame() {

src/com/redomar/game/level/tiles/Tile.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ public abstract class Tile {
1818
public static final Tile WATER = new AnimatedTile(4, new int[][] {
1919
{ 0, 5 }, { 1, 5 }, { 2, 5 }, { 1, 5 } }, Colours.get(-1, 004, 115,
2020
-1), 0xFF0000FF, 1000);
21+
public static final Tile FLOWER_rose = new BasicTile(5, 4, 0, Colours.get(
22+
131, 151, 510, 553), 0xFFCCFF33);
23+
public static final Tile FLOWER_dandelion = new BasicTile(6, 4, 0,
24+
Colours.get(131, 151, 553, 510), 0xFFFFCC33);
25+
public static final Tile SAND = new BasicTile(7, 5, 0, Colours.get(-1, 553,
26+
554, 555), 0xFFFFFF99);
2127

2228
protected byte id;
2329
protected boolean solid;

0 commit comments

Comments
 (0)