Skip to content

Commit a8e0303

Browse files
committed
betterInitLoading
1 parent 9792ebe commit a8e0303

File tree

13 files changed

+22
-32
lines changed

13 files changed

+22
-32
lines changed

build/coffee/bundle.coffee

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ class TerrainWorker
4949
}
5050

5151
init = ()->
52-
if getNick() is "" or getNick() is "?"
53-
document.location.href="?"+prompt("Enter your nick:")
5452
#Terrain worker
5553
worker=new TerrainWorker
5654

@@ -104,6 +102,7 @@ init = ()->
104102

105103
socket.on "connect",()->
106104
console.log "Połączono z serverem!"
105+
$('.loadingText').text "Wczytywanie terenu..."
107106
socket.emit "initClient", {
108107
nick:getNick()
109108
}

build/coffee/module/AssetLoader.coffee

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ class AssetLoader
1515
Object.keys(assets).forEach (p)->
1616
type=assets[p].type
1717
path=assets[p].path
18-
dynamic=assets[p].dynamic;
19-
if dynamic
20-
path+="?"+THREE.MathUtils.generateUUID()
2118
if type is "texture"
2219
textureLoader.load path,(texture)->
2320
_this.assets[p]=texture

build/coffee/module/FirstPersonControls.coffee

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ class FirstPersonControls
4141
@camera.position.y += @micromove
4242
if @keys[@kc["shift"]]
4343
@camera.position.y -= @micromove
44-
lockPointer: ->
45-
@canvas.requestPointerLock()
46-
return
4744
updatePosition: (e)->
4845
if @gameState is "game"
4946
@camera.rotation.x -= THREE.MathUtils.degToRad e.movementY / 10
@@ -72,7 +69,8 @@ class FirstPersonControls
7269
delete _this.keys[z.keyCode]
7370
return
7471
$(".gameOn").click ->
75-
_this.lockPointer()
72+
console.log "clicked!"
73+
_this.canvas.requestPointerLock()
7674
return
7775
document.addEventListener 'pointerlockchange', ()->
7876
_this.lockChangeAlert()

client/assets/assetLoader.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
},
1818
"blocks":{
1919
"path":"assets/blocks/blocks.json",
20-
"type":"text",
21-
"dynamic":true
20+
"type":"text"
2221
},
2322
"blocksAtlasFull":{
2423
"path":"assets/blocks/blocksAtlas-full.png",

client/assets/images/back.png

361 KB
Loading
75.9 KB
Loading

client/assets/images/logo.png

35.9 KB
Loading

client/bundle.js

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/cdn/css/main.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,25 @@ canvas {
3939
left:0px;
4040
width:100%;
4141
height:100%;
42-
background:green;
42+
background-image: url("../../assets/images/back.png");
43+
background-position: center; /* Center the image */
44+
background-repeat: no-repeat; /* Do not repeat the image */
45+
background-size: cover; /* Resize the background image to cover the entire container */
4346
}
4447

4548
.loadingBar{
4649
margin: 0;
4750
position: absolute;
48-
top: 50%;
51+
top: 30%;
4952
left: 50%;
5053
-ms-transform: translate(-50%, -50%);
5154
transform: translate(-50%, -50%);
5255
}
5356

57+
.loadingText{
58+
margin-top:200px;
59+
}
60+
5461
.inv_box{
5562
border:1px solid black;
5663
width:60px;

client/index.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
<!-- LOADING SCREEN -->
3434
<div class="initLoading">
3535
<div class="loadingBar text-center">
36-
<h1>Web-minecraft</h1>
36+
<img src="assets/images/logo.png">
37+
<h1 class="loadingText">Ładowanie zasobów...</h1>
3738
<div class="status"></div>
3839
<img src="assets/images/loadingx.gif">
3940
</div>
@@ -51,16 +52,14 @@ <h1>Web-minecraft</h1>
5152
<div class="gameMenu">
5253
<div class="row">
5354
<div class="col-4 pl-5 pt-4">
54-
Web-minecraft v.1.0
55+
Web-minecraft v.1.0<br>
56+
Wykonanie: <a href="https://github.com/michaljaz/">michaljaz</a>
5557
</div>
5658
<div class="col-4 text-center p-3">
5759
<h3>Gra zatrzymana</h3>
5860
<button class="gameOn btn btn-dark w-100">
5961
Graj
6062
</button>
61-
<button class="btn btn-dark w-100" onclick="document.location.reload()">
62-
Restart
63-
</button>
6463
</div>
6564
<div class="col-4 p-3">
6665
Kontrolki

0 commit comments

Comments
 (0)