Skip to content

Commit d743fc0

Browse files
prettify
1 parent 051a4f9 commit d743fc0

File tree

12 files changed

+441
-513
lines changed

12 files changed

+441
-513
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Ignore artifacts:
2+
build
3+
coverage
4+
dist
5+
node_modules
6+
.vscode
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"trailingComma": "none",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": true,
6+
"printWidth": 120
7+
}
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
# Simple Ball Running 3D Game
2-
___
1+
# Simple Ball Running 3D Game
2+
3+
---
4+
35
### [[LIVE DEMO]: running-ball-babylonjs-by-user-of-github.netlify.app](https://running-ball-babylonjs-by-user-of-github.netlify.app/)
4-
___
5-
## Technologies:
6-
- [TypeScript](https://www.typescriptlang.org/)
6+
7+
---
8+
9+
## Technologies:
10+
11+
- [TypeScript](https://www.typescriptlang.org/)
712
- [Babylon.js](https://www.babylonjs.com/)
8-
- [Vite](https://vite.dev/)
9-
___
13+
- [Vite](https://vite.dev/)
14+
15+
---
1016

11-
![Demo](./demo/demo.jpg)
17+
![Demo](./demo/demo.jpg)
Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
<!doctype html>
22
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="preconnect" href="https://fonts.googleapis.com" />
6+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
7+
<link href="https://fonts.googleapis.com/css2?family=Black+Ops+One&display=swap" rel="stylesheet" />
8+
<link rel="stylesheet" href="/src/style.css" />
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
10+
<title>Running Ball (Babylon.js)</title>
11+
</head>
312

4-
<head>
5-
<meta charset="UTF-8" />
6-
<link rel="preconnect" href="https://fonts.googleapis.com">
7-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
8-
<link href="https://fonts.googleapis.com/css2?family=Black+Ops+One&display=swap" rel="stylesheet">
9-
<link rel="stylesheet" href="/src/style.css">
10-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
11-
<title>Running Ball (Babylon.js)</title>
12-
</head>
13-
14-
<body>
15-
<main class="app">
16-
<canvas id="game-canvas" class="game-canvas"></canvas>
17-
<div class="user-ui user-ui__top">
18-
<div class="score">
19-
<span class="game-score" id="game-score">0</span>
20-
<img src="/assets/images/coin.png" class="coin-img" />
13+
<body>
14+
<main class="app">
15+
<canvas id="game-canvas" class="game-canvas"></canvas>
16+
<div class="user-ui user-ui__top">
17+
<div class="score">
18+
<span class="game-score" id="game-score">0</span>
19+
<img src="/assets/images/coin.png" class="coin-img" />
20+
</div>
2121
</div>
22-
</div>
2322

24-
<div class="user-ui user-ui__bottom">
25-
<button id="restart-btn" class="ui-btn">
26-
<img src="/assets/images/restart.png" width="30px" />
27-
</button>
28-
</div>
23+
<div class="user-ui user-ui__bottom">
24+
<button id="restart-btn" class="ui-btn">
25+
<img src="/assets/images/restart.png" width="30px" />
26+
</button>
27+
</div>
28+
</main>
2929
<script type="module" src="/src/main.ts"></script>
30-
</body>
31-
32-
</html>
30+
</body>
31+
</html>

games/running-ball-babylonjs/package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

games/running-ball-babylonjs/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
"scripts": {
1111
"dev": "vite",
1212
"build": "tsc && vite build",
13-
"preview": "vite preview"
13+
"preview": "vite preview",
14+
"format": "npx prettier . --write"
1415
},
1516
"devDependencies": {
1617
"globals": "^16.4.0",
18+
"prettier": "3.6.2",
1719
"typescript": "~5.9.3",
1820
"vite": "^7.1.7"
1921
},
@@ -22,4 +24,4 @@
2224
"@babylonjs/loaders": "^8.33.2",
2325
"cannon": "^0.6.2"
2426
}
25-
}
27+
}

games/running-ball-babylonjs/public/assets/models/scene.gltf

Lines changed: 22 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,25 @@
44
"bufferView": 2,
55
"componentType": 5126,
66
"count": 408,
7-
"max": [
8-
9.680001258850098,
9-
9.99999713897705,
10-
1.9999998807907104
11-
],
12-
"min": [
13-
-9.680000305175781,
14-
-10.000001907348633,
15-
-2.0000033378601074
16-
],
7+
"max": [9.680001258850098, 9.99999713897705, 1.9999998807907104],
8+
"min": [-9.680000305175781, -10.000001907348633, -2.0000033378601074],
179
"type": "VEC3"
1810
},
1911
{
2012
"bufferView": 2,
2113
"byteOffset": 4896,
2214
"componentType": 5126,
2315
"count": 408,
24-
"max": [
25-
1.0,
26-
1.0,
27-
1.0
28-
],
29-
"min": [
30-
-1.0,
31-
-1.0,
32-
-1.0
33-
],
16+
"max": [1.0, 1.0, 1.0],
17+
"min": [-1.0, -1.0, -1.0],
3418
"type": "VEC3"
3519
},
3620
{
3721
"bufferView": 1,
3822
"componentType": 5126,
3923
"count": 408,
40-
"max": [
41-
0.875,
42-
1.0
43-
],
44-
"min": [
45-
0.0,
46-
0.0
47-
],
24+
"max": [0.875, 1.0],
25+
"min": [0.0, 0.0],
4826
"type": "VEC2"
4927
},
5028
{
@@ -57,30 +35,16 @@
5735
"bufferView": 3,
5836
"componentType": 5126,
5937
"count": 41,
60-
"max": [
61-
0.8333333134651184
62-
],
63-
"min": [
64-
0.0
65-
],
38+
"max": [0.8333333134651184],
39+
"min": [0.0],
6640
"type": "SCALAR"
6741
},
6842
{
6943
"bufferView": 4,
7044
"componentType": 5126,
7145
"count": 41,
72-
"max": [
73-
8.315721475122962e-17,
74-
1.0,
75-
8.315721475122962e-17,
76-
1.0
77-
],
78-
"min": [
79-
-8.65528771925435e-17,
80-
-0.8526402115821838,
81-
-8.65528771925435e-17,
82-
-0.4817536771297455
83-
],
46+
"max": [8.315721475122962e-17, 1.0, 8.315721475122962e-17, 1.0],
47+
"min": [-8.65528771925435e-17, -0.8526402115821838, -8.65528771925435e-17, -0.4817536771297455],
8448
"type": "VEC4"
8549
}
8650
],
@@ -163,12 +127,7 @@
163127
"doubleSided": true,
164128
"name": "Coin",
165129
"pbrMetallicRoughness": {
166-
"baseColorFactor": [
167-
0.8,
168-
0.387049,
169-
0.0,
170-
1.0
171-
],
130+
"baseColorFactor": [0.8, 0.387049, 0.0, 1.0],
172131
"metallicFactor": 0.5,
173132
"roughnessFactor": 0.1629192073170732
174133
}
@@ -193,87 +152,35 @@
193152
],
194153
"nodes": [
195154
{
196-
"children": [
197-
1
198-
],
155+
"children": [1],
199156
"matrix": [
200-
1.0,
201-
0.0,
202-
0.0,
203-
0.0,
204-
0.0,
205-
2.220446049250313e-16,
206-
-1.0,
207-
0.0,
208-
0.0,
209-
1.0,
210-
2.220446049250313e-16,
211-
0.0,
212-
0.0,
213-
0.0,
214-
0.0,
157+
1.0, 0.0, 0.0, 0.0, 0.0, 2.220446049250313e-16, -1.0, 0.0, 0.0, 1.0, 2.220446049250313e-16, 0.0, 0.0, 0.0, 0.0,
215158
1.0
216159
],
217160
"name": "Sketchfab_model"
218161
},
219162
{
220-
"children": [
221-
2
222-
],
223-
"matrix": [
224-
1.0,
225-
0.0,
226-
0.0,
227-
0.0,
228-
0.0,
229-
0.0,
230-
1.0,
231-
0.0,
232-
0.0,
233-
-1.0,
234-
0.0,
235-
0.0,
236-
0.0,
237-
0.0,
238-
0.0,
239-
1.0
240-
],
163+
"children": [2],
164+
"matrix": [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
241165
"name": "dac838890acf4045a602c11254a10146.fbx"
242166
},
243167
{
244-
"children": [
245-
3
246-
],
168+
"children": [3],
247169
"name": "Object_2"
248170
},
249171
{
250-
"children": [
251-
4
252-
],
172+
"children": [4],
253173
"name": "RootNode"
254174
},
255175
{
256-
"children": [
257-
5
258-
],
176+
"children": [5],
259177
"name": "Coin"
260178
},
261179
{
262-
"children": [
263-
6
264-
],
180+
"children": [6],
265181
"name": "CoinObj",
266-
"rotation": [
267-
0.0,
268-
-0.5877851843833923,
269-
0.0,
270-
0.8090170621871948
271-
],
272-
"scale": [
273-
0.9999999403953552,
274-
1.0,
275-
0.9999999403953552
276-
]
182+
"rotation": [0.0, -0.5877851843833923, 0.0, 0.8090170621871948],
183+
"scale": [0.9999999403953552, 1.0, 0.9999999403953552]
277184
},
278185
{
279186
"mesh": 0,
@@ -284,9 +191,7 @@
284191
"scenes": [
285192
{
286193
"name": "Sketchfab_Scene",
287-
"nodes": [
288-
0
289-
]
194+
"nodes": [0]
290195
}
291196
]
292197
}

0 commit comments

Comments
 (0)