diff --git a/proj-web/README.md b/proj-web/README.md
index 7969215..d3706c8 100644
--- a/proj-web/README.md
+++ b/proj-web/README.md
@@ -1,9 +1,14 @@
# how to build
+If emsdk is not installed, you need to clone it from here: https://github.com/emscripten-core/emsdk
-Activate the environment:
+and install:
```
C:\Work\Projects\emsdk\emsdk.bat install latest
+```
+
+Then activate the environment:
+```
C:\Work\Projects\emsdk\emsdk.bat activate latest
C:\Work\Projects\emsdk\emsdk_env.bat
```
diff --git a/proj-web/space-game001plain.html b/proj-web/space-game001plain.html
index 72892cd..d3c1953 100644
--- a/proj-web/space-game001plain.html
+++ b/proj-web/space-game001plain.html
@@ -17,23 +17,10 @@
width: 100vw; height: 100vh;
border: none;
}
- /* Кнопка Fullscreen */
- #fs-button {
- position: absolute;
- top: 10px; right: 10px;
- padding: 10px;
- z-index: 10;
- background: rgba(255,255,255,0.3);
- color: white; border: 1px solid white;
- cursor: pointer;
- font-family: sans-serif;
- border-radius: 5px;
- }
#status { color: white; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
-
Downloading...
@@ -49,17 +36,6 @@
}
};
- // Кнопка Fullscreen
- document.getElementById('fs-button').addEventListener('click', function() {
- if (!document.fullscreenElement) {
- document.documentElement.requestFullscreen().catch(e => {
- console.error(`Error attempting to enable full-screen mode: ${e.message}`);
- });
- } else {
- document.exitFullscreen();
- }
- });
-
// Обработка ориентации
window.addEventListener("orientationchange", function() {
// Chrome на Android обновляет innerWidth/Height не мгновенно.
diff --git a/resources/button_minus.png b/resources/button_minus.png
new file mode 100644
index 0000000..8fd6fec
--- /dev/null
+++ b/resources/button_minus.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8425f4b75b63b138810c92449c93baffd39acef9f5c9ead69687c3e8b0c577c6
+size 14922
diff --git a/resources/button_minus_pressed.png b/resources/button_minus_pressed.png
new file mode 100644
index 0000000..7cd9a42
--- /dev/null
+++ b/resources/button_minus_pressed.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:729fc37ad29bd53b13232a0242b89142cbf29c08bfbce8834a403b265ff5a700
+size 28545
diff --git a/resources/button_plus.png b/resources/button_plus.png
new file mode 100644
index 0000000..4d48ebc
--- /dev/null
+++ b/resources/button_plus.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5551fbec116add9541e797b53928e36c8fe8835ad2e2e118241b4148a2ccb4c1
+size 15058
diff --git a/resources/button_plus_pressed.png b/resources/button_plus_pressed.png
new file mode 100644
index 0000000..b5e51ce
--- /dev/null
+++ b/resources/button_plus_pressed.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ad20d915c39c968d29d94a3e30099e40ea5a7da8f82d4775a0976fdfacadf93e
+size 27821
diff --git a/resources/config/game_over.json b/resources/config/game_over.json
index 6248579..9d43223 100644
--- a/resources/config/game_over.json
+++ b/resources/config/game_over.json
@@ -65,8 +65,8 @@
"height": 56,
"textures": {
"normal": "resources/game_over/Filledbuttons.png",
- "hover": "resources/game_over/Filledbuttons.png",
- "pressed": "resources/game_over/Filledbuttons.png"
+ "hover": "resources/game_over/Variant5.png",
+ "pressed": "resources/game_over/Variant6.png"
}
},
{
diff --git a/resources/config/main_menu.json b/resources/config/main_menu.json
index 55bbb1f..3d1c80b 100644
--- a/resources/config/main_menu.json
+++ b/resources/config/main_menu.json
@@ -50,8 +50,8 @@
"height": 56,
"textures": {
"normal": "resources/main_menu/single.png",
- "hover": "resources/main_menu/single.png",
- "pressed": "resources/main_menu/single.png"
+ "hover": "resources/main_menu/Variant5.png",
+ "pressed": "resources/main_menu/Variant6.png"
}
},
{
@@ -61,8 +61,8 @@
"height": 56,
"textures": {
"normal": "resources/main_menu/multi.png",
- "hover": "resources/main_menu/multi.png",
- "pressed": "resources/main_menu/multi.png"
+ "hover": "resources/main_menu/Variant7.png",
+ "pressed": "resources/main_menu/Variant8.png"
}
},
{
diff --git a/resources/config/spark_config.json b/resources/config/spark_config.json
index cbe6c47..d7ec09e 100644
--- a/resources/config/spark_config.json
+++ b/resources/config/spark_config.json
@@ -1,14 +1,14 @@
{
- "emissionRate": 100.0,
+ "emissionRate": 10.0,
"maxParticles": 200,
"particleSize": 0.3,
"biasX": 0.3,
"emissionPoints": [
{
- "position": [-1.3, 0, 0.0]
+ "position": [-1.0, 1.4, -3.5]
},
{
- "position": [1.3, 0.0, 0.0]
+ "position": [1.0, 1.4, -3.5]
}
],
"speedRange": [0.5, 2.0],
diff --git a/resources/config/spark_config_cargo.json b/resources/config/spark_config_cargo.json
new file mode 100644
index 0000000..1fbe1a0
--- /dev/null
+++ b/resources/config/spark_config_cargo.json
@@ -0,0 +1,20 @@
+{
+ "emissionRate": 10.0,
+ "maxParticles": 200,
+ "particleSize": 0.3,
+ "biasX": 0.3,
+ "emissionPoints": [
+ {
+ "position": [0.0, 2.8, -3.5]
+ },
+ {
+ "position": [0.0, 1.5, -3.5]
+ }
+ ],
+ "speedRange": [0.5, 2.0],
+ "zSpeedRange": [1.0, 3.0],
+ "scaleRange": [0.8, 1.2],
+ "lifeTimeRange": [600.0, 1400.0],
+ "texture": "resources/spark.png",
+ "shaderProgramName": "spark"
+}
\ No newline at end of file
diff --git a/resources/config/spark_projectile_config.json b/resources/config/spark_projectile_config.json
index 7fbe467..9e303e9 100644
--- a/resources/config/spark_projectile_config.json
+++ b/resources/config/spark_projectile_config.json
@@ -2,14 +2,14 @@
"emissionPoints": [
{ "position": [0.0, 0.0, 0.0] }
],
- "texture": "resources/spark_white.png",
- "speedRange": [10.0, 30.0],
+ "texture": "resources/spark2.png",
+ "speedRange": [5.0, 10.0],
"zSpeedRange": [-1.0, 1.0],
- "scaleRange": [0.5, 1.0],
+ "scaleRange": [0.5, 2.0],
"lifeTimeRange": [200.0, 800.0],
- "emissionRate": 50.0,
- "maxParticles": 10,
- "particleSize": 0.5,
+ "emissionRate": 30.0,
+ "maxParticles": 150,
+ "particleSize": 1.0,
"biasX": 0.1,
"shaderProgramName": "default"
}
\ No newline at end of file
diff --git a/resources/config/ui.json b/resources/config/ui.json
index fa27292..06e895a 100644
--- a/resources/config/ui.json
+++ b/resources/config/ui.json
@@ -6,6 +6,20 @@
"width": "match_parent",
"height": "match_parent",
"children": [
+ {
+ "type": "TextView",
+ "name": "velocityText",
+ "x": 10,
+ "y": 10,
+ "width": 200,
+ "height": 40,
+ "horizontal_gravity": "left",
+ "vertical_gravity": "top",
+ "text": "Velocity: 0",
+ "fontSize": 24,
+ "color": [1.0, 1.0, 1.0, 1.0],
+ "centered": false
+ },
{
"type": "Button",
"name": "shootButton",
@@ -16,9 +30,10 @@
"horizontal_gravity": "right",
"vertical_gravity": "bottom",
"textures": {
- "normal": "resources/shoot_normal.png",
- "hover": "resources/shoot_hover.png",
- "pressed": "resources/shoot_pressed.png"
+ "normal": "resources/fire.png",
+ "hover": "resources/fire2.png",
+ "pressed": "resources/fire2.png",
+ "disabled": "resources/fire_disabled.png"
}
},
{
@@ -31,25 +46,42 @@
"horizontal_gravity": "left",
"vertical_gravity": "bottom",
"textures": {
- "normal": "resources/shoot_normal.png",
- "hover": "resources/shoot_hover.png",
- "pressed": "resources/shoot_pressed.png"
+ "normal": "resources/fire.png",
+ "hover": "resources/fire2.png",
+ "pressed": "resources/fire2.png",
+ "disabled": "resources/fire_disabled.png"
}
},
{
- "type": "Slider",
- "name": "velocitySlider",
- "x": 10,
- "y": 200,
- "width": 80,
- "height": 300,
- "value": 0.0,
- "orientation": "vertical",
+ "type": "Button",
+ "name": "minusButton",
+ "x": -20,
+ "y": 110,
+ "width": 150,
+ "height": 150,
+ "border" : 20,
"horizontal_gravity": "right",
"vertical_gravity": "bottom",
"textures": {
- "track": "resources/velocitySliderTexture.png",
- "knob": "resources/velocitySliderButton.png"
+ "normal": "resources/button_minus.png",
+ "hover": "resources/button_minus_pressed.png",
+ "pressed": "resources/button_minus_pressed.png"
+ }
+ },
+ {
+ "type": "Button",
+ "name": "plusButton",
+ "x": -20,
+ "y": 220,
+ "width": 150,
+ "height": 150,
+ "border" : 20,
+ "horizontal_gravity": "right",
+ "vertical_gravity": "bottom",
+ "textures": {
+ "normal": "resources/button_plus.png",
+ "hover": "resources/button_plus_pressed.png",
+ "pressed": "resources/button_plus_pressed.png"
}
}
]
diff --git a/resources/fire.png b/resources/fire.png
new file mode 100644
index 0000000..07e9346
--- /dev/null
+++ b/resources/fire.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5efff9f73d98fa230bfa247b3302c530275aba103638d5a220aa09f94bc629df
+size 100748
diff --git a/resources/fire2.png b/resources/fire2.png
new file mode 100644
index 0000000..cc9b372
--- /dev/null
+++ b/resources/fire2.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1a329b0c8847a33061e769891cb04d82544d573fcd836514eb98021340e975a1
+size 116746
diff --git a/resources/fire_disabled.png b/resources/fire_disabled.png
new file mode 100644
index 0000000..008d469
--- /dev/null
+++ b/resources/fire_disabled.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b78ea265d945ccdea12a319ee288f9e99cc472c745300ee1a5f3393726082710
+size 111366
diff --git a/resources/game_over/Variant5.png b/resources/game_over/Variant5.png
new file mode 100644
index 0000000..08c15b5
--- /dev/null
+++ b/resources/game_over/Variant5.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:44b90a4684f39ad8498194a8e130a02a4b5bb241364c8db05a069a05349eb547
+size 10072
diff --git a/resources/game_over/Variant6.png b/resources/game_over/Variant6.png
new file mode 100644
index 0000000..58beb4f
--- /dev/null
+++ b/resources/game_over/Variant6.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c2d3e1fb2e45fe0a5641784a65606114a8a0343a3e45a11141f331a38e1bdd88
+size 9597
diff --git a/resources/main_menu/Variant5.png b/resources/main_menu/Variant5.png
new file mode 100644
index 0000000..54c357d
--- /dev/null
+++ b/resources/main_menu/Variant5.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a2ef90493bbdbaf7779bb091d49c90613e79c25c4d3b553927d69312b944e0cc
+size 8311
diff --git a/resources/main_menu/Variant6.png b/resources/main_menu/Variant6.png
new file mode 100644
index 0000000..8978164
--- /dev/null
+++ b/resources/main_menu/Variant6.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:69b42cd78a376d55a0f17dfa83906cd09c264d04832e8f1991f773bb7756b22f
+size 7445
diff --git a/resources/main_menu/Variant7.png b/resources/main_menu/Variant7.png
new file mode 100644
index 0000000..2bc3793
--- /dev/null
+++ b/resources/main_menu/Variant7.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:780846ab6b6487b01054e6a624352fe7fbe1db67c0dfd4c29994ffc45b978239
+size 6593
diff --git a/resources/main_menu/Variant8.png b/resources/main_menu/Variant8.png
new file mode 100644
index 0000000..17e4e40
--- /dev/null
+++ b/resources/main_menu/Variant8.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:636a46a4b822d4aad03481c58929bca46c8513ad1e502a48446fd682888699b5
+size 6266
diff --git a/resources/spark.png b/resources/spark.png
index 4ed63fd..9f78b0d 100644
--- a/resources/spark.png
+++ b/resources/spark.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:8885a2b593c5dc0e8ac5cf5204bf3d82eb45ad6dae9b56e2bc88a41e61144c89
-size 2222
+oid sha256:fe73ae8d4ac8d878a65a3d84b16075582223bb028d1a431b5c6af257811850c4
+size 2742
diff --git a/resources/spark2.png b/resources/spark2.png
index b0e806f..dcc9896 100644
--- a/resources/spark2.png
+++ b/resources/spark2.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:11cde0c85c95f91eb9ace65cead22a37ba80d215897f32a2d6be1410210c1acf
-size 2656
+oid sha256:7a22261dfa7a9f14f79bcac6af502c7092bdebc1d30f3cbd2df4c8e3ba4ac99e
+size 2700
diff --git a/resources/spark3.png b/resources/spark3.png
new file mode 100644
index 0000000..32049bc
--- /dev/null
+++ b/resources/spark3.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2017634739f985c00a681d1623c7fe37dbeaa52dbc4665b5593e59a9d7e2e753
+size 2656
diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt
index 389c70e..f82bd10 100644
--- a/server/CMakeLists.txt
+++ b/server/CMakeLists.txt
@@ -26,6 +26,7 @@ add_subdirectory("${BOOST_SRC_DIR}/libs/predef" boost-predef-build EXCLUDE_FROM_
# Исполняемый файл сервера
add_executable(Server
+server.h
server.cpp
../src/network/ClientState.h
../src/network/ClientState.cpp
diff --git a/server/server.cpp b/server/server.cpp
index d6284a0..ae89599 100644
--- a/server/server.cpp
+++ b/server/server.cpp
@@ -1,44 +1,11 @@
-#include
+#include "server.h"
#include
#include
#include
-#include
-#include
-#include
-#include
-#include