Skip to content

Commit 348b170

Browse files
committed
2 parents 2688402 + b085fe9 commit 348b170

17 files changed

+208
-277
lines changed

Assets/favicon.png

-75 KB
Binary file not shown.

Assets/mainlagi.png

-27.5 KB
Binary file not shown.

Assets/menu.png

-25 KB
Binary file not shown.

Assets/mulai.png

-24.7 KB
Binary file not shown.

awal.html

-53
This file was deleted.

css/style.css

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ body {
22
margin: 0;
33
}
44

5-
#c {
5+
body, #c {
66
width: 100%;
77
height: 100%;
88
display: block;
9-
background: url(../img/bg.jpg) no-repeat center center ;
9+
/*background: url(../img/bg.jpg) no-repeat center center ;
1010
background-repeat: no-repeat;
1111
background-size: cover;
12-
background-position: center;
12+
background-position: center; */
13+
background: rgb(131,58,180);
14+
background: linear-gradient(90deg, rgba(131,58,180,1) 0%, rgba(253,29,29,1) 50%, rgba(252,176,69,1) 100%);
1315
}
1416

1517
#score {

instruksi.html

-44
This file was deleted.

js/app.js

+19-9
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ let hue = 0;
3030
let scoreValue = 0;
3131
var scoreDisplay = document.getElementById("score");
3232
var gameoverDisplay = document.getElementById("game-over");
33+
var playagainButton = document.getElementById("playagain");
3334
var isPlay=0;
3435
var myAudio = new Audio('../sound/ingame.mp3');
3536
var geoo;
@@ -106,15 +107,20 @@ function loop() {
106107
brick.move();
107108

108109
let message = {
109-
position: new Array(),
110-
scale: new Array()
111-
}
112-
110+
score: scoreValue,
111+
property: []
112+
};
113+
113114
for(let i = 0;i < bricks.size(); i++) {
114-
message.position.push(bricks.items[i].position);
115-
message.scale.push(bricks.items[i].scale);
115+
let object = {
116+
position: bricks.items[i].position,
117+
scale: bricks.items[i].scale,
118+
color: bricks.items[i].color
119+
};
120+
message.property.push(object);
116121
}
117-
// socket.emit('sync', message);
122+
123+
socket.emit('sync', message);
118124
nambahlagu();
119125
break;
120126

@@ -209,6 +215,10 @@ function loop() {
209215

210216
// Enable view gameover
211217
gameoverDisplay.style.display = "block";
218+
playagainButton.onclick = function() {
219+
command = PLAYAGAIN;
220+
}
221+
212222
break;
213223
case PLAYAGAIN:
214224
// re-inisialisasi semua block
@@ -254,7 +264,7 @@ function onKeyDown(event) {
254264
default:
255265
break;
256266
}
257-
socket.emit('keyboardEvent', event.code);
267+
// socket.emit('keyboardEvent', event.code);
258268
}
259269

260270
/**
@@ -283,7 +293,7 @@ function handleOrientation(event) {
283293
beta: Math.round(event.beta),
284294
gamma: Math.round(event.gamma)
285295
}
286-
socket.emit('deviceOrientation', orientation);
296+
// socket.emit('deviceOrientation', orientation);
287297
}
288298

289299
if(window.DeviceOrientationEvent){

js/brick.js

+11
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ class Brick {
7272
return this.physijs_box;
7373
}
7474

75+
get color() {
76+
return this.material.color.getHSL();
77+
}
78+
79+
/**
80+
* @param {THREE.Color} newColor
81+
*/
82+
set color(newColor) {
83+
this.material.color.set(newColor);
84+
}
85+
7586
get name() {
7687
// return this.mesh.name;
7788
return this.physijs_box.name;

0 commit comments

Comments
 (0)