Skip to content

Commit 68b41d7

Browse files
feat: save; try CI
1 parent dfb3239 commit 68b41d7

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.github/workflows/game-ball-babylonjs-deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy to Netlify
1+
name: Deploy Ball-Game to Netlify
22

33
on:
44
push:

games/running-ball-babylonjs/src/Game.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
type BoundingBox,
1919
SceneLoader
2020
} from '@babylonjs/core';
21+
import '@babylonjs/loaders/glTF'
2122
//@ts-ignore
2223
import * as CANNON from 'cannon';
2324
import type { Size3D } from './types';
@@ -46,6 +47,7 @@ export class Game {
4647
private readonly platforms: Mesh[];
4748
private readonly walls: Mesh[];
4849
private readonly ball: Mesh;
50+
private coinModel: Mesh;
4951
private readonly shadowGenerator: ShadowGenerator;
5052

5153

@@ -73,14 +75,14 @@ export class Game {
7375
//this.ball.showBoundingBox = true;
7476
//this.walls.forEach(w => w.showBoundingBox = true);
7577

78+
this.loadCoinModel();
79+
7680
this.scene.registerBeforeRender(this.checkSphereBoxCollision.bind(this));
7781

7882
this.engine.runRenderLoop(() => {
7983
this.updateCameraAndLight();
8084
this.scene.render();
8185
});
82-
83-
this.loadCoinModel();
8486
}
8587

8688
private loadCoinModel() {
@@ -97,6 +99,11 @@ export class Game {
9799
const coin = meshArray[0];
98100
coin.scaling = new Vector3(0.07, 0.07, 0.07);
99101
coin.position = new Vector3(2, 1, 0);
102+
103+
this.coinModel = coin;
104+
105+
this.shadowGenerator.addShadowCaster(coin);
106+
coin.receiveShadows = true;
100107
}
101108
);
102109
}

0 commit comments

Comments
 (0)