diff --git a/HostGame.js b/HostGame.js
new file mode 100644
index 0000000..6c04f43
--- /dev/null
+++ b/HostGame.js
@@ -0,0 +1,22 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/HostGame.js b/HostGame.js
new file mode 100644
index 0000000..6c04f43
--- /dev/null
+++ b/HostGame.js
@@ -0,0 +1,22 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/HostGameClass.js b/HostGameClass.js
new file mode 100644
index 0000000..8d4564c
--- /dev/null
+++ b/HostGameClass.js
@@ -0,0 +1,23 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.showGameScreen();
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/HostGame.js b/HostGame.js
new file mode 100644
index 0000000..6c04f43
--- /dev/null
+++ b/HostGame.js
@@ -0,0 +1,22 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/HostGameClass.js b/HostGameClass.js
new file mode 100644
index 0000000..8d4564c
--- /dev/null
+++ b/HostGameClass.js
@@ -0,0 +1,23 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.showGameScreen();
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/LobbyScreen.js b/LobbyScreen.js
new file mode 100644
index 0000000..aa8c834
--- /dev/null
+++ b/LobbyScreen.js
@@ -0,0 +1,12 @@
+class LobbyScreen extends GameScreen
+{
+ constructor(screenController)
+ {
+ super(screenController);
+ this.players = [];
+ }
+
+ show()
+ {
+ }
+}
diff --git a/HostGame.js b/HostGame.js
new file mode 100644
index 0000000..6c04f43
--- /dev/null
+++ b/HostGame.js
@@ -0,0 +1,22 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/HostGameClass.js b/HostGameClass.js
new file mode 100644
index 0000000..8d4564c
--- /dev/null
+++ b/HostGameClass.js
@@ -0,0 +1,23 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.showGameScreen();
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/LobbyScreen.js b/LobbyScreen.js
new file mode 100644
index 0000000..aa8c834
--- /dev/null
+++ b/LobbyScreen.js
@@ -0,0 +1,12 @@
+class LobbyScreen extends GameScreen
+{
+ constructor(screenController)
+ {
+ super(screenController);
+ this.players = [];
+ }
+
+ show()
+ {
+ }
+}
diff --git a/client/index.html b/client/index.html
index 9b7e3b7..28ac3ae 100644
--- a/client/index.html
+++ b/client/index.html
@@ -52,9 +52,6 @@
-
-
-
diff --git a/HostGame.js b/HostGame.js
new file mode 100644
index 0000000..6c04f43
--- /dev/null
+++ b/HostGame.js
@@ -0,0 +1,22 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/HostGameClass.js b/HostGameClass.js
new file mode 100644
index 0000000..8d4564c
--- /dev/null
+++ b/HostGameClass.js
@@ -0,0 +1,23 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.showGameScreen();
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/LobbyScreen.js b/LobbyScreen.js
new file mode 100644
index 0000000..aa8c834
--- /dev/null
+++ b/LobbyScreen.js
@@ -0,0 +1,12 @@
+class LobbyScreen extends GameScreen
+{
+ constructor(screenController)
+ {
+ super(screenController);
+ this.players = [];
+ }
+
+ show()
+ {
+ }
+}
diff --git a/client/index.html b/client/index.html
index 9b7e3b7..28ac3ae 100644
--- a/client/index.html
+++ b/client/index.html
@@ -52,9 +52,6 @@
-
-
-
diff --git a/client/js/PlayerGame.js b/client/js/PlayerGame.js
new file mode 100644
index 0000000..d10f337
--- /dev/null
+++ b/client/js/PlayerGame.js
@@ -0,0 +1,25 @@
+class PlayerGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new SignupScreen(this, this.screenController);
+
+ this.network = new NetworkGameManager();
+ Game.Network = this.network;
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/HostGame.js b/HostGame.js
new file mode 100644
index 0000000..6c04f43
--- /dev/null
+++ b/HostGame.js
@@ -0,0 +1,22 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/HostGameClass.js b/HostGameClass.js
new file mode 100644
index 0000000..8d4564c
--- /dev/null
+++ b/HostGameClass.js
@@ -0,0 +1,23 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.showGameScreen();
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/LobbyScreen.js b/LobbyScreen.js
new file mode 100644
index 0000000..aa8c834
--- /dev/null
+++ b/LobbyScreen.js
@@ -0,0 +1,12 @@
+class LobbyScreen extends GameScreen
+{
+ constructor(screenController)
+ {
+ super(screenController);
+ this.players = [];
+ }
+
+ show()
+ {
+ }
+}
diff --git a/client/index.html b/client/index.html
index 9b7e3b7..28ac3ae 100644
--- a/client/index.html
+++ b/client/index.html
@@ -52,9 +52,6 @@
-
-
-
diff --git a/client/js/PlayerGame.js b/client/js/PlayerGame.js
new file mode 100644
index 0000000..d10f337
--- /dev/null
+++ b/client/js/PlayerGame.js
@@ -0,0 +1,25 @@
+class PlayerGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new SignupScreen(this, this.screenController);
+
+ this.network = new NetworkGameManager();
+ Game.Network = this.network;
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/index.html b/index.html
index 55a91f5..60e2379 100644
--- a/index.html
+++ b/index.html
@@ -1,8 +1,84 @@
Lost My Nuts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
diff --git a/HostGame.js b/HostGame.js
new file mode 100644
index 0000000..6c04f43
--- /dev/null
+++ b/HostGame.js
@@ -0,0 +1,22 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/HostGameClass.js b/HostGameClass.js
new file mode 100644
index 0000000..8d4564c
--- /dev/null
+++ b/HostGameClass.js
@@ -0,0 +1,23 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.showGameScreen();
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/LobbyScreen.js b/LobbyScreen.js
new file mode 100644
index 0000000..aa8c834
--- /dev/null
+++ b/LobbyScreen.js
@@ -0,0 +1,12 @@
+class LobbyScreen extends GameScreen
+{
+ constructor(screenController)
+ {
+ super(screenController);
+ this.players = [];
+ }
+
+ show()
+ {
+ }
+}
diff --git a/client/index.html b/client/index.html
index 9b7e3b7..28ac3ae 100644
--- a/client/index.html
+++ b/client/index.html
@@ -52,9 +52,6 @@
-
-
-
diff --git a/client/js/PlayerGame.js b/client/js/PlayerGame.js
new file mode 100644
index 0000000..d10f337
--- /dev/null
+++ b/client/js/PlayerGame.js
@@ -0,0 +1,25 @@
+class PlayerGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new SignupScreen(this, this.screenController);
+
+ this.network = new NetworkGameManager();
+ Game.Network = this.network;
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/index.html b/index.html
index 55a91f5..60e2379 100644
--- a/index.html
+++ b/index.html
@@ -1,8 +1,84 @@
Lost My Nuts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
diff --git a/index.js b/index.js
index 57fe4c9..469e75e 100644
--- a/index.js
+++ b/index.js
@@ -12,13 +12,6 @@
{
this.win = win;
win.showDevTools();
- const address = Object.values(os.networkInterfaces()).flatMap(i => i).filter(i => i.family == "IPv4" && !i.internal)[0].address
-
- var gameContainer = document.getElementById("gameContainer");
- Engine.InitEngine(gameContainer, { width: window.innerWidth, height: window.innerHeight, roundPixels: false} );
-
- var gameManager = new GameManager();
- gameManager.init("js/");
window.addEventListener('resize', this.resize.bind(this));
// start up express
@@ -36,12 +29,21 @@
maxReceivedFrameSize : 1024000,
});
- this.mode = new JoinMode();
-
// start listening
this.app.listen(HttpPort, () => console.log('HTTP server listening on port ' + HttpPort + '!'));
this.httpServer.listen(WsPort, () => console.log('WebSocket Server started on port ' + WsPort + '!'));
this.wsServer.on('request', this.connect.bind(this));
+
+ const address = Object.values(os.networkInterfaces()).flatMap(i => i).filter(i => i.family == "IPv4" && !i.internal)[0].address
+
+ var gameContainer = document.getElementById("gameContainer");
+ Engine.InitEngine(gameContainer, { width: window.innerWidth, height: window.innerHeight, roundPixels: false} );
+
+ Game.Server = wsServer;
+ Game.Address = address;
+
+ var gameManager = new GameManager();
+ gameManager.init("shared/js/", HostGame);
}
connect(req)
@@ -58,5 +60,4 @@
}
let win = nw.Window.get();
-console.log(win);
win.on("loaded", () => new LostMyNuts(win));
diff --git a/HostGame.js b/HostGame.js
new file mode 100644
index 0000000..6c04f43
--- /dev/null
+++ b/HostGame.js
@@ -0,0 +1,22 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/HostGameClass.js b/HostGameClass.js
new file mode 100644
index 0000000..8d4564c
--- /dev/null
+++ b/HostGameClass.js
@@ -0,0 +1,23 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.showGameScreen();
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/LobbyScreen.js b/LobbyScreen.js
new file mode 100644
index 0000000..aa8c834
--- /dev/null
+++ b/LobbyScreen.js
@@ -0,0 +1,12 @@
+class LobbyScreen extends GameScreen
+{
+ constructor(screenController)
+ {
+ super(screenController);
+ this.players = [];
+ }
+
+ show()
+ {
+ }
+}
diff --git a/client/index.html b/client/index.html
index 9b7e3b7..28ac3ae 100644
--- a/client/index.html
+++ b/client/index.html
@@ -52,9 +52,6 @@
-
-
-
diff --git a/client/js/PlayerGame.js b/client/js/PlayerGame.js
new file mode 100644
index 0000000..d10f337
--- /dev/null
+++ b/client/js/PlayerGame.js
@@ -0,0 +1,25 @@
+class PlayerGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new SignupScreen(this, this.screenController);
+
+ this.network = new NetworkGameManager();
+ Game.Network = this.network;
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/index.html b/index.html
index 55a91f5..60e2379 100644
--- a/index.html
+++ b/index.html
@@ -1,8 +1,84 @@
Lost My Nuts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
diff --git a/index.js b/index.js
index 57fe4c9..469e75e 100644
--- a/index.js
+++ b/index.js
@@ -12,13 +12,6 @@
{
this.win = win;
win.showDevTools();
- const address = Object.values(os.networkInterfaces()).flatMap(i => i).filter(i => i.family == "IPv4" && !i.internal)[0].address
-
- var gameContainer = document.getElementById("gameContainer");
- Engine.InitEngine(gameContainer, { width: window.innerWidth, height: window.innerHeight, roundPixels: false} );
-
- var gameManager = new GameManager();
- gameManager.init("js/");
window.addEventListener('resize', this.resize.bind(this));
// start up express
@@ -36,12 +29,21 @@
maxReceivedFrameSize : 1024000,
});
- this.mode = new JoinMode();
-
// start listening
this.app.listen(HttpPort, () => console.log('HTTP server listening on port ' + HttpPort + '!'));
this.httpServer.listen(WsPort, () => console.log('WebSocket Server started on port ' + WsPort + '!'));
this.wsServer.on('request', this.connect.bind(this));
+
+ const address = Object.values(os.networkInterfaces()).flatMap(i => i).filter(i => i.family == "IPv4" && !i.internal)[0].address
+
+ var gameContainer = document.getElementById("gameContainer");
+ Engine.InitEngine(gameContainer, { width: window.innerWidth, height: window.innerHeight, roundPixels: false} );
+
+ Game.Server = wsServer;
+ Game.Address = address;
+
+ var gameManager = new GameManager();
+ gameManager.init("shared/js/", HostGame);
}
connect(req)
@@ -58,5 +60,4 @@
}
let win = nw.Window.get();
-console.log(win);
win.on("loaded", () => new LostMyNuts(win));
diff --git a/node_modules/.bin/winrun b/node_modules/.bin/winrun
index e9fd763..96ea779 100644
--- a/node_modules/.bin/winrun
+++ b/node_modules/.bin/winrun
@@ -1,7 +1,5 @@
#! /usr/bin/env bash
-echo "TEST"
-
command=$1
args=$(printf '"`"%s`"",' "${@:2}") ; args=${args%,}
winrun_pid=$$
@@ -28,7 +26,6 @@
# Use tail to wait for the file to be populated
while read -r line; do
windows_pid=$(echo $line | tr -d '\r\n')
- echo "Windows_pid: $windows_pid"
break # we only need the first line
done < <(tail -f $pidfile)
rm $pidfile
@@ -38,8 +35,7 @@
fi
term() {
- echo "KILLING $windows_pid"
- taskkill.exe -f -pid $windows_pid
+ taskkill.exe -f -pid $windows_pid > /dev/null
}
trap term SIGTERM
diff --git a/HostGame.js b/HostGame.js
new file mode 100644
index 0000000..6c04f43
--- /dev/null
+++ b/HostGame.js
@@ -0,0 +1,22 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/HostGameClass.js b/HostGameClass.js
new file mode 100644
index 0000000..8d4564c
--- /dev/null
+++ b/HostGameClass.js
@@ -0,0 +1,23 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.showGameScreen();
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/LobbyScreen.js b/LobbyScreen.js
new file mode 100644
index 0000000..aa8c834
--- /dev/null
+++ b/LobbyScreen.js
@@ -0,0 +1,12 @@
+class LobbyScreen extends GameScreen
+{
+ constructor(screenController)
+ {
+ super(screenController);
+ this.players = [];
+ }
+
+ show()
+ {
+ }
+}
diff --git a/client/index.html b/client/index.html
index 9b7e3b7..28ac3ae 100644
--- a/client/index.html
+++ b/client/index.html
@@ -52,9 +52,6 @@
-
-
-
diff --git a/client/js/PlayerGame.js b/client/js/PlayerGame.js
new file mode 100644
index 0000000..d10f337
--- /dev/null
+++ b/client/js/PlayerGame.js
@@ -0,0 +1,25 @@
+class PlayerGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new SignupScreen(this, this.screenController);
+
+ this.network = new NetworkGameManager();
+ Game.Network = this.network;
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/index.html b/index.html
index 55a91f5..60e2379 100644
--- a/index.html
+++ b/index.html
@@ -1,8 +1,84 @@
Lost My Nuts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
diff --git a/index.js b/index.js
index 57fe4c9..469e75e 100644
--- a/index.js
+++ b/index.js
@@ -12,13 +12,6 @@
{
this.win = win;
win.showDevTools();
- const address = Object.values(os.networkInterfaces()).flatMap(i => i).filter(i => i.family == "IPv4" && !i.internal)[0].address
-
- var gameContainer = document.getElementById("gameContainer");
- Engine.InitEngine(gameContainer, { width: window.innerWidth, height: window.innerHeight, roundPixels: false} );
-
- var gameManager = new GameManager();
- gameManager.init("js/");
window.addEventListener('resize', this.resize.bind(this));
// start up express
@@ -36,12 +29,21 @@
maxReceivedFrameSize : 1024000,
});
- this.mode = new JoinMode();
-
// start listening
this.app.listen(HttpPort, () => console.log('HTTP server listening on port ' + HttpPort + '!'));
this.httpServer.listen(WsPort, () => console.log('WebSocket Server started on port ' + WsPort + '!'));
this.wsServer.on('request', this.connect.bind(this));
+
+ const address = Object.values(os.networkInterfaces()).flatMap(i => i).filter(i => i.family == "IPv4" && !i.internal)[0].address
+
+ var gameContainer = document.getElementById("gameContainer");
+ Engine.InitEngine(gameContainer, { width: window.innerWidth, height: window.innerHeight, roundPixels: false} );
+
+ Game.Server = wsServer;
+ Game.Address = address;
+
+ var gameManager = new GameManager();
+ gameManager.init("shared/js/", HostGame);
}
connect(req)
@@ -58,5 +60,4 @@
}
let win = nw.Window.get();
-console.log(win);
win.on("loaded", () => new LostMyNuts(win));
diff --git a/node_modules/.bin/winrun b/node_modules/.bin/winrun
index e9fd763..96ea779 100644
--- a/node_modules/.bin/winrun
+++ b/node_modules/.bin/winrun
@@ -1,7 +1,5 @@
#! /usr/bin/env bash
-echo "TEST"
-
command=$1
args=$(printf '"`"%s`"",' "${@:2}") ; args=${args%,}
winrun_pid=$$
@@ -28,7 +26,6 @@
# Use tail to wait for the file to be populated
while read -r line; do
windows_pid=$(echo $line | tr -d '\r\n')
- echo "Windows_pid: $windows_pid"
break # we only need the first line
done < <(tail -f $pidfile)
rm $pidfile
@@ -38,8 +35,7 @@
fi
term() {
- echo "KILLING $windows_pid"
- taskkill.exe -f -pid $windows_pid
+ taskkill.exe -f -pid $windows_pid > /dev/null
}
trap term SIGTERM
diff --git a/nodemon.json b/nodemon.json
index 2e9869f..1305d81 100644
--- a/nodemon.json
+++ b/nodemon.json
@@ -1,4 +1,5 @@
{
"signal":"SIGTERM",
- "exec":"npm start"
+ "exec":"npm start",
+ "ext":"js,html"
}
diff --git a/HostGame.js b/HostGame.js
new file mode 100644
index 0000000..6c04f43
--- /dev/null
+++ b/HostGame.js
@@ -0,0 +1,22 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/HostGameClass.js b/HostGameClass.js
new file mode 100644
index 0000000..8d4564c
--- /dev/null
+++ b/HostGameClass.js
@@ -0,0 +1,23 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.showGameScreen();
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/LobbyScreen.js b/LobbyScreen.js
new file mode 100644
index 0000000..aa8c834
--- /dev/null
+++ b/LobbyScreen.js
@@ -0,0 +1,12 @@
+class LobbyScreen extends GameScreen
+{
+ constructor(screenController)
+ {
+ super(screenController);
+ this.players = [];
+ }
+
+ show()
+ {
+ }
+}
diff --git a/client/index.html b/client/index.html
index 9b7e3b7..28ac3ae 100644
--- a/client/index.html
+++ b/client/index.html
@@ -52,9 +52,6 @@
-
-
-
diff --git a/client/js/PlayerGame.js b/client/js/PlayerGame.js
new file mode 100644
index 0000000..d10f337
--- /dev/null
+++ b/client/js/PlayerGame.js
@@ -0,0 +1,25 @@
+class PlayerGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new SignupScreen(this, this.screenController);
+
+ this.network = new NetworkGameManager();
+ Game.Network = this.network;
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/index.html b/index.html
index 55a91f5..60e2379 100644
--- a/index.html
+++ b/index.html
@@ -1,8 +1,84 @@
Lost My Nuts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
diff --git a/index.js b/index.js
index 57fe4c9..469e75e 100644
--- a/index.js
+++ b/index.js
@@ -12,13 +12,6 @@
{
this.win = win;
win.showDevTools();
- const address = Object.values(os.networkInterfaces()).flatMap(i => i).filter(i => i.family == "IPv4" && !i.internal)[0].address
-
- var gameContainer = document.getElementById("gameContainer");
- Engine.InitEngine(gameContainer, { width: window.innerWidth, height: window.innerHeight, roundPixels: false} );
-
- var gameManager = new GameManager();
- gameManager.init("js/");
window.addEventListener('resize', this.resize.bind(this));
// start up express
@@ -36,12 +29,21 @@
maxReceivedFrameSize : 1024000,
});
- this.mode = new JoinMode();
-
// start listening
this.app.listen(HttpPort, () => console.log('HTTP server listening on port ' + HttpPort + '!'));
this.httpServer.listen(WsPort, () => console.log('WebSocket Server started on port ' + WsPort + '!'));
this.wsServer.on('request', this.connect.bind(this));
+
+ const address = Object.values(os.networkInterfaces()).flatMap(i => i).filter(i => i.family == "IPv4" && !i.internal)[0].address
+
+ var gameContainer = document.getElementById("gameContainer");
+ Engine.InitEngine(gameContainer, { width: window.innerWidth, height: window.innerHeight, roundPixels: false} );
+
+ Game.Server = wsServer;
+ Game.Address = address;
+
+ var gameManager = new GameManager();
+ gameManager.init("shared/js/", HostGame);
}
connect(req)
@@ -58,5 +60,4 @@
}
let win = nw.Window.get();
-console.log(win);
win.on("loaded", () => new LostMyNuts(win));
diff --git a/node_modules/.bin/winrun b/node_modules/.bin/winrun
index e9fd763..96ea779 100644
--- a/node_modules/.bin/winrun
+++ b/node_modules/.bin/winrun
@@ -1,7 +1,5 @@
#! /usr/bin/env bash
-echo "TEST"
-
command=$1
args=$(printf '"`"%s`"",' "${@:2}") ; args=${args%,}
winrun_pid=$$
@@ -28,7 +26,6 @@
# Use tail to wait for the file to be populated
while read -r line; do
windows_pid=$(echo $line | tr -d '\r\n')
- echo "Windows_pid: $windows_pid"
break # we only need the first line
done < <(tail -f $pidfile)
rm $pidfile
@@ -38,8 +35,7 @@
fi
term() {
- echo "KILLING $windows_pid"
- taskkill.exe -f -pid $windows_pid
+ taskkill.exe -f -pid $windows_pid > /dev/null
}
trap term SIGTERM
diff --git a/nodemon.json b/nodemon.json
index 2e9869f..1305d81 100644
--- a/nodemon.json
+++ b/nodemon.json
@@ -1,4 +1,5 @@
{
"signal":"SIGTERM",
- "exec":"npm start"
+ "exec":"npm start",
+ "ext":"js,html"
}
diff --git a/session.vim b/session.vim
new file mode 100644
index 0000000..f09aa60
--- /dev/null
+++ b/session.vim
@@ -0,0 +1,282 @@
+let SessionLoad = 1
+if &cp | set nocp | endif
+let s:cpo_save=&cpo
+set cpo&vim
+imap
+inoremap pumvisible() ? "\" : "\"
+inoremap pumvisible() ? "\" : "\"
+inoremap pumvisible() ? "\" : "\"
+nnoremap :TmuxNavigateLeft
+nnoremap :TmuxNavigateDown
+nnoremap :TmuxNavigateUp
+nnoremap :TmuxNavigateRight
+map (ctrlp)
+nnoremap :TmuxNavigatePrevious
+nnoremap \d :YcmShowDetailedDiagnostic
+xmap \ge CamelCaseMotion_ge
+xmap \e CamelCaseMotion_e
+xmap \b CamelCaseMotion_b
+xmap \w CamelCaseMotion_w
+omap \ge CamelCaseMotion_ge
+omap \e CamelCaseMotion_e
+omap \b CamelCaseMotion_b
+omap \w CamelCaseMotion_w
+nmap \ge CamelCaseMotion_ge
+nmap \e CamelCaseMotion_e
+nmap \b CamelCaseMotion_b
+nmap \w CamelCaseMotion_w
+nmap \ucc TextTMakeUpperCamelCaseLine
+xmap \uc TextTMakeUpperCamelCaseVisual
+nmap \uc TextTMakeUpperCamelCaseOperator
+nmap \scc TextTMakeSnakeCaseLine
+xmap \sc TextTMakeSnakeCaseVisual
+nmap \sc TextTMakeSnakeCaseOperator
+nmap \ccc TextTMakeCamelCaseLine
+xmap \cc TextTMakeCamelCaseVisual
+nmap \cc TextTMakeCamelCaseOperator
+vnoremap \c :call CopyMarkWithCursor("<", ">")
+nnoremap \c :set opfunc=OpSysCopyMark
g@
+vmap gx NetrwBrowseXVis
+nmap gx NetrwBrowseX
+xmap g. (visualrepeatForceBuiltInRepeat)
+xmap i\ge CamelCaseMotion_ige
+xmap i\e CamelCaseMotion_ie
+xmap i\b CamelCaseMotion_ib
+xmap i\w CamelCaseMotion_iw
+omap i\ge CamelCaseMotion_ige
+omap i\e CamelCaseMotion_ie
+omap i\b CamelCaseMotion_ib
+omap i\w CamelCaseMotion_iw
+vnoremap NetrwBrowseXVis :call netrw#BrowseXVis()
+nnoremap NetrwBrowseX :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX()))
+xnoremap 30_(CaptureVirtCol) visualrepeat#CaptureVirtCol()
+map (ctrlp)
+nnoremap (ctrlp) :CtrlPBuffile
+vnoremap CamelCaseMotion_ige :call camelcasemotion#InnerMotion('ge',v:count1)
+vnoremap CamelCaseMotion_ie :call camelcasemotion#InnerMotion('e',v:count1)
+vnoremap CamelCaseMotion_ib :call camelcasemotion#InnerMotion('b',v:count1)
+vnoremap CamelCaseMotion_iw :call camelcasemotion#InnerMotion('w',v:count1)
+onoremap CamelCaseMotion_ige :call camelcasemotion#InnerMotion('ge',v:count1)
+onoremap CamelCaseMotion_ie :call camelcasemotion#InnerMotion('e',v:count1)
+onoremap CamelCaseMotion_ib :call camelcasemotion#InnerMotion('b',v:count1)
+onoremap CamelCaseMotion_iw :call camelcasemotion#InnerMotion('w',v:count1)
+vnoremap CamelCaseMotion_ge :call camelcasemotion#Motion('ge',v:count1,'v')
+vnoremap CamelCaseMotion_e :call camelcasemotion#Motion('e',v:count1,'v')
+vnoremap CamelCaseMotion_b :call camelcasemotion#Motion('b',v:count1,'v')
+vnoremap CamelCaseMotion_w :call camelcasemotion#Motion('w',v:count1,'v')
+onoremap CamelCaseMotion_ge :call camelcasemotion#Motion('ge',v:count1,'o')
+onoremap CamelCaseMotion_e :call camelcasemotion#Motion('e',v:count1,'o')
+onoremap CamelCaseMotion_b :call camelcasemotion#Motion('b',v:count1,'o')
+onoremap CamelCaseMotion_w :call camelcasemotion#Motion('w',v:count1,'o')
+nnoremap CamelCaseMotion_ge :call camelcasemotion#Motion('ge',v:count1,'n')
+nnoremap CamelCaseMotion_e :call camelcasemotion#Motion('e',v:count1,'n')
+nnoremap CamelCaseMotion_b :call camelcasemotion#Motion('b',v:count1,'n')
+nnoremap CamelCaseMotion_w :call camelcasemotion#Motion('w',v:count1,'n')
+nnoremap TextTMakeUpperCamelCaseOperator TextTransform#Arbitrary#Expression('MakeUpperCamelCase', 'TextRMakeUpperCamelCase')
+nnoremap TextTMakeSnakeCaseOperator TextTransform#Arbitrary#Expression('MakeSnakeCase', 'TextRMakeSnakeCase')
+vnoremap 19_TextTRecordPos TextTransform#Arbitrary#SetTriggerPos()
+nnoremap TextTMakeCamelCaseOperator TextTransform#Arbitrary#Expression('MakeCamelCase', 'TextRMakeCamelCase')
+nnoremap 19_Reselect '1v' . (visualmode() !=# 'V' && &selection ==# 'exclusive' ? ' ' : '') . '"' . v:register
+nnoremap :TmuxNavigatePrevious
+nnoremap :TmuxNavigateRight
+nnoremap :TmuxNavigateUp
+nnoremap :TmuxNavigateDown
+nnoremap :TmuxNavigateLeft
+inoremap pumvisible() ? "\" : "\ "
+let &cpo=s:cpo_save
+unlet s:cpo_save
+set autoindent
+set backspace=indent,eol,start
+set belloff=all
+set completeopt=preview,menuone
+set cpoptions=aAceFsB
+set fileencodings=ucs-bom,utf-8,default,latin1
+set fillchars=vert:|,fold:-,vert:│
+set nofixendofline
+set foldlevelstart=99
+set helplang=en
+set hidden
+set mouse=a
+set pyxversion=3
+set ruler
+set runtimepath=~/.vim,~/.vim/plugged/onehalf/vim,~/.vim/plugged/QFEnter,~/.vim/bundle/CamelCaseMotion,~/.vim/bundle/JustDo,~/.vim/bundle/YouCompleteMe,~/.vim/bundle/ctrlp.vim,~/.vim/bundle/dracula-vim,~/.vim/bundle/html5.vim,~/.vim/bundle/night_owl_light.vim,~/.vim/bundle/vim-TextTransform,~/.vim/bundle/vim-colors-solarized,~/.vim/bundle/vim-easymotion,~/.vim/bundle/vim-ingo-library,~/.vim/bundle/vim-javascript,~/.vim/bundle/vim-localrc,~/.vim/bundle/vim-repeat,~/.vim/bundle/vim-tmux-navigator,~/.vim/bundle/vim-visualrepeat,~/.vim/bundle/yats.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim82,/usr/share/vim/vimfiles/after,~/.vim/bundle/vim-javascript/after,~/.vim/bundle/html5.vim/after,~/.vim/bundle/dracula-vim/after,~/.vim/after
+set sessionoptions=blank,buffers,folds,help,options,tabpages,winsize,terminal,sesdir
+set shiftwidth=4
+set shortmess=filnxtToOSc
+set softtabstop=4
+set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc,.snap
+set tabstop=4
+set termguicolors
+let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0
+let v:this_session=expand(":p")
+silent only
+silent tabonly
+exe "cd " . escape(expand(":p:h"), ' ')
+if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
+ let s:wipebuf = bufnr('%')
+endif
+set shortmess=aoO
+argglobal
+%argdel
+edit ../fusion/prototype/client/js/Game/GameManager.js
+set splitbelow splitright
+set nosplitbelow
+set nosplitright
+wincmd t
+set winminheight=0
+set winheight=1
+set winminwidth=0
+set winwidth=1
+argglobal
+setlocal keymap=
+setlocal noarabic
+setlocal autoindent
+setlocal backupcopy=
+setlocal balloonexpr=
+setlocal nobinary
+setlocal nobreakindent
+setlocal breakindentopt=
+setlocal bufhidden=
+setlocal buflisted
+setlocal buftype=
+setlocal nocindent
+setlocal cinkeys=0{,0},0),0],:,0#,!^F,o,O,e
+setlocal cinoptions=
+setlocal cinwords=if,else,while,do,for,switch
+setlocal colorcolumn=
+setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
+setlocal commentstring=//%s
+setlocal complete=.,w,b,u,t,i
+setlocal concealcursor=
+setlocal conceallevel=0
+setlocal completefunc=
+setlocal nocopyindent
+setlocal cryptmethod=
+setlocal nocursorbind
+setlocal nocursorcolumn
+set cursorline
+setlocal cursorline
+setlocal cursorlineopt=both
+setlocal define=\\(^\\s*(*async\\s\\+function\\|(*function\\)\\|^\\s*\\(\\*\\|static\\|async\\|get\\|set\\|\\i\\+\\.\\)\\|^\\s*\\(\\ze\\i\\+\\)\\(([^)]*).*{$\\|\\s*[:=,]\\)\\|^\\s*\\(export\\s\\+\\|export\\s\\+default\\s\\+\\)*\\(var\\|let\\|const\\|function\\|class\\)\\|\\
+setlocal dictionary=
+setlocal nodiff
+setlocal equalprg=
+setlocal errorformat=
+setlocal noexpandtab
+if &filetype != 'javascript'
+setlocal filetype=javascript
+endif
+setlocal nofixendofline
+setlocal foldcolumn=0
+setlocal foldenable
+setlocal foldexpr=0
+setlocal foldignore=#
+setlocal foldlevel=99
+setlocal foldmarker={{{,}}}
+setlocal foldmethod=manual
+setlocal foldminlines=1
+setlocal foldnestmax=20
+setlocal foldtext=foldtext()
+setlocal formatexpr=
+setlocal formatoptions=croql
+setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s*
+setlocal formatprg=
+setlocal grepprg=
+setlocal iminsert=0
+setlocal imsearch=-1
+setlocal include=
+setlocal includeexpr=
+setlocal indentexpr=GetJavascriptIndent()
+setlocal indentkeys=0{,0},0),0],:,0#,!^F,o,O,e,0],0)
+setlocal noinfercase
+setlocal iskeyword=@,48-57,_,192-255,$
+setlocal keywordprg=
+setlocal nolinebreak
+setlocal nolisp
+setlocal lispwords=
+setlocal nolist
+setlocal makeencoding=
+setlocal makeprg=
+setlocal matchpairs=(:),{:},[:]
+setlocal modeline
+setlocal modifiable
+setlocal nrformats=bin,octal,hex
+set number
+setlocal number
+setlocal numberwidth=4
+setlocal omnifunc=javascriptcomplete#CompleteJS
+setlocal path=.,,
+setlocal nopreserveindent
+setlocal nopreviewwindow
+setlocal quoteescape=\\
+setlocal noreadonly
+setlocal norelativenumber
+setlocal norightleft
+setlocal rightleftcmd=search
+setlocal noscrollbind
+setlocal scrolloff=-1
+setlocal shiftwidth=4
+setlocal noshortname
+setlocal showbreak=
+setlocal sidescrolloff=-1
+setlocal signcolumn=auto
+setlocal nosmartindent
+setlocal softtabstop=4
+setlocal nospell
+setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+
+setlocal spellfile=
+setlocal spelllang=en
+setlocal spelloptions=
+setlocal statusline=
+setlocal suffixesadd=.js,.jsx,.es,.es6,.cjs,.mjs,.jsm,.vue,.json
+setlocal swapfile
+setlocal synmaxcol=3000
+if &syntax != 'javascript'
+setlocal syntax=javascript
+endif
+setlocal tabstop=4
+setlocal tagcase=
+setlocal tagfunc=
+setlocal tags=
+setlocal termwinkey=
+setlocal termwinscroll=10000
+setlocal termwinsize=
+setlocal textwidth=0
+setlocal thesaurus=
+setlocal noundofile
+setlocal undolevels=-123456
+setlocal varsofttabstop=
+setlocal vartabstop=
+setlocal wincolor=
+setlocal nowinfixheight
+setlocal nowinfixwidth
+setlocal wrap
+setlocal wrapmargin=0
+silent! normal! zE
+let s:l = 28 - ((12 * winheight(0) + 33) / 66)
+if s:l < 1 | let s:l = 1 | endif
+exe s:l
+normal! zt
+28
+normal! 0
+tabnext 1
+badd +36 index.js
+badd +37 node_modules/.bin/winrun
+badd +4 client/index.html
+badd +75 index.html
+badd +283 /mnt/c/Projects/fusion/prototype/client/index.html
+badd +0 ../fusion/prototype/client/js/Game/GameManager.js
+if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0
+ silent exe 'bwipe ' . s:wipebuf
+endif
+unlet! s:wipebuf
+set winheight=1 winwidth=20 shortmess=filnxtToOSc
+set winminheight=1 winminwidth=1
+let s:sx = expand(":p:r")."x.vim"
+if filereadable(s:sx)
+ exe "source " . fnameescape(s:sx)
+endif
+let &so = s:so_save | let &siso = s:siso_save
+doautoall SessionLoadPost
+unlet SessionLoad
+" vim: set ft=vim :
diff --git a/HostGame.js b/HostGame.js
new file mode 100644
index 0000000..6c04f43
--- /dev/null
+++ b/HostGame.js
@@ -0,0 +1,22 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/HostGameClass.js b/HostGameClass.js
new file mode 100644
index 0000000..8d4564c
--- /dev/null
+++ b/HostGameClass.js
@@ -0,0 +1,23 @@
+class HostGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new LobbyScreen(this, this.screenController);
+
+ this.showGameScreen();
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/LobbyScreen.js b/LobbyScreen.js
new file mode 100644
index 0000000..aa8c834
--- /dev/null
+++ b/LobbyScreen.js
@@ -0,0 +1,12 @@
+class LobbyScreen extends GameScreen
+{
+ constructor(screenController)
+ {
+ super(screenController);
+ this.players = [];
+ }
+
+ show()
+ {
+ }
+}
diff --git a/client/index.html b/client/index.html
index 9b7e3b7..28ac3ae 100644
--- a/client/index.html
+++ b/client/index.html
@@ -52,9 +52,6 @@
-
-
-
diff --git a/client/js/PlayerGame.js b/client/js/PlayerGame.js
new file mode 100644
index 0000000..d10f337
--- /dev/null
+++ b/client/js/PlayerGame.js
@@ -0,0 +1,25 @@
+class PlayerGame extends Engine.GameBase
+{
+ constructor(rootDrawable)
+ {
+ super(rootDrawable);
+
+ this.gameScreen = new SignupScreen(this, this.screenController);
+
+ this.network = new NetworkGameManager();
+ Game.Network = this.network;
+
+ this.gameScreen.show();
+ }
+
+ resolutionChanged(width, height)
+ {
+ this.gameScreen.resolutionChanged(width, height);
+ }
+
+ update(timeElapsed)
+ {
+ super.update(timeElapsed);
+ }
+
+}
diff --git a/index.html b/index.html
index 55a91f5..60e2379 100644
--- a/index.html
+++ b/index.html
@@ -1,8 +1,84 @@
Lost My Nuts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
diff --git a/index.js b/index.js
index 57fe4c9..469e75e 100644
--- a/index.js
+++ b/index.js
@@ -12,13 +12,6 @@
{
this.win = win;
win.showDevTools();
- const address = Object.values(os.networkInterfaces()).flatMap(i => i).filter(i => i.family == "IPv4" && !i.internal)[0].address
-
- var gameContainer = document.getElementById("gameContainer");
- Engine.InitEngine(gameContainer, { width: window.innerWidth, height: window.innerHeight, roundPixels: false} );
-
- var gameManager = new GameManager();
- gameManager.init("js/");
window.addEventListener('resize', this.resize.bind(this));
// start up express
@@ -36,12 +29,21 @@
maxReceivedFrameSize : 1024000,
});
- this.mode = new JoinMode();
-
// start listening
this.app.listen(HttpPort, () => console.log('HTTP server listening on port ' + HttpPort + '!'));
this.httpServer.listen(WsPort, () => console.log('WebSocket Server started on port ' + WsPort + '!'));
this.wsServer.on('request', this.connect.bind(this));
+
+ const address = Object.values(os.networkInterfaces()).flatMap(i => i).filter(i => i.family == "IPv4" && !i.internal)[0].address
+
+ var gameContainer = document.getElementById("gameContainer");
+ Engine.InitEngine(gameContainer, { width: window.innerWidth, height: window.innerHeight, roundPixels: false} );
+
+ Game.Server = wsServer;
+ Game.Address = address;
+
+ var gameManager = new GameManager();
+ gameManager.init("shared/js/", HostGame);
}
connect(req)
@@ -58,5 +60,4 @@
}
let win = nw.Window.get();
-console.log(win);
win.on("loaded", () => new LostMyNuts(win));
diff --git a/node_modules/.bin/winrun b/node_modules/.bin/winrun
index e9fd763..96ea779 100644
--- a/node_modules/.bin/winrun
+++ b/node_modules/.bin/winrun
@@ -1,7 +1,5 @@
#! /usr/bin/env bash
-echo "TEST"
-
command=$1
args=$(printf '"`"%s`"",' "${@:2}") ; args=${args%,}
winrun_pid=$$
@@ -28,7 +26,6 @@
# Use tail to wait for the file to be populated
while read -r line; do
windows_pid=$(echo $line | tr -d '\r\n')
- echo "Windows_pid: $windows_pid"
break # we only need the first line
done < <(tail -f $pidfile)
rm $pidfile
@@ -38,8 +35,7 @@
fi
term() {
- echo "KILLING $windows_pid"
- taskkill.exe -f -pid $windows_pid
+ taskkill.exe -f -pid $windows_pid > /dev/null
}
trap term SIGTERM
diff --git a/nodemon.json b/nodemon.json
index 2e9869f..1305d81 100644
--- a/nodemon.json
+++ b/nodemon.json
@@ -1,4 +1,5 @@
{
"signal":"SIGTERM",
- "exec":"npm start"
+ "exec":"npm start",
+ "ext":"js,html"
}
diff --git a/session.vim b/session.vim
new file mode 100644
index 0000000..f09aa60
--- /dev/null
+++ b/session.vim
@@ -0,0 +1,282 @@
+let SessionLoad = 1
+if &cp | set nocp | endif
+let s:cpo_save=&cpo
+set cpo&vim
+imap
+inoremap pumvisible() ? "\" : "\"
+inoremap pumvisible() ? "\" : "\"
+inoremap pumvisible() ? "\" : "\"
+nnoremap :TmuxNavigateLeft
+nnoremap :TmuxNavigateDown
+nnoremap :TmuxNavigateUp
+nnoremap :TmuxNavigateRight
+map (ctrlp)
+nnoremap :TmuxNavigatePrevious
+nnoremap \d :YcmShowDetailedDiagnostic
+xmap \ge CamelCaseMotion_ge
+xmap \e CamelCaseMotion_e
+xmap \b CamelCaseMotion_b
+xmap \w CamelCaseMotion_w
+omap \ge CamelCaseMotion_ge
+omap \e CamelCaseMotion_e
+omap \b CamelCaseMotion_b
+omap \w CamelCaseMotion_w
+nmap \ge CamelCaseMotion_ge
+nmap \e CamelCaseMotion_e
+nmap \b CamelCaseMotion_b
+nmap \w CamelCaseMotion_w
+nmap \ucc TextTMakeUpperCamelCaseLine
+xmap \uc TextTMakeUpperCamelCaseVisual
+nmap \uc TextTMakeUpperCamelCaseOperator
+nmap \scc TextTMakeSnakeCaseLine
+xmap \sc TextTMakeSnakeCaseVisual
+nmap \sc TextTMakeSnakeCaseOperator
+nmap \ccc TextTMakeCamelCaseLine
+xmap \cc TextTMakeCamelCaseVisual
+nmap \cc TextTMakeCamelCaseOperator
+vnoremap \c :call CopyMarkWithCursor("<", ">")
+nnoremap \c :set opfunc=OpSysCopyMark
g@
+vmap gx NetrwBrowseXVis
+nmap gx NetrwBrowseX
+xmap g. (visualrepeatForceBuiltInRepeat)
+xmap i\ge CamelCaseMotion_ige
+xmap i\e CamelCaseMotion_ie
+xmap i\b CamelCaseMotion_ib
+xmap i\w CamelCaseMotion_iw
+omap i\ge CamelCaseMotion_ige
+omap i\e CamelCaseMotion_ie
+omap i\b CamelCaseMotion_ib
+omap i\w CamelCaseMotion_iw
+vnoremap NetrwBrowseXVis :call netrw#BrowseXVis()
+nnoremap NetrwBrowseX :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX()))
+xnoremap 30_(CaptureVirtCol) visualrepeat#CaptureVirtCol()
+map (ctrlp)
+nnoremap (ctrlp) :CtrlPBuffile
+vnoremap CamelCaseMotion_ige :call camelcasemotion#InnerMotion('ge',v:count1)
+vnoremap CamelCaseMotion_ie :call camelcasemotion#InnerMotion('e',v:count1)
+vnoremap CamelCaseMotion_ib :call camelcasemotion#InnerMotion('b',v:count1)
+vnoremap CamelCaseMotion_iw :call camelcasemotion#InnerMotion('w',v:count1)
+onoremap CamelCaseMotion_ige :call camelcasemotion#InnerMotion('ge',v:count1)
+onoremap CamelCaseMotion_ie :call camelcasemotion#InnerMotion('e',v:count1)
+onoremap CamelCaseMotion_ib :call camelcasemotion#InnerMotion('b',v:count1)
+onoremap CamelCaseMotion_iw :call camelcasemotion#InnerMotion('w',v:count1)
+vnoremap CamelCaseMotion_ge :call camelcasemotion#Motion('ge',v:count1,'v')
+vnoremap CamelCaseMotion_e :call camelcasemotion#Motion('e',v:count1,'v')
+vnoremap