Skip to content

Commit c2be7f6

Browse files
refactor
1 parent 7f9f6da commit c2be7f6

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

games/running-ball-babylonjs/.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"tabWidth": 2,
44
"semi": true,
55
"singleQuote": true,
6-
"printWidth": 120
6+
"printWidth": 127
77
}

games/running-ball-babylonjs/src/game/index.ts renamed to games/running-ball-babylonjs/src/game/Game.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Vector3, type BoundingBox } from '@babylonjs/core';
2-
import '@babylonjs/loaders/glTF';
32

43
import { GameStatus, type GameHTMLElementsRefs } from './types';
54
import { GameStorageService, StoredDataType } from './game-services/storage.service';

games/running-ball-babylonjs/src/game/game-services/scene.service.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ import {
1818
Color3,
1919
SceneLoader
2020
} from '@babylonjs/core';
21-
import { GameConstants } from '../constants';
21+
import '@babylonjs/loaders/glTF';
2222
//@ts-ignore
2323
import * as CANNON from 'cannon';
2424
import { WaterMaterial } from '@babylonjs/materials';
25+
import { GameConstants } from '../constants';
2526
import { notRepeatedRandomFreeSpacePositionGenerator } from '../utils';
2627

2728
export class GameSceneService {
@@ -135,15 +136,13 @@ export class GameSceneService {
135136
private configureCamera(): Camera {
136137
const camera = new FreeCamera('camera', new Vector3(-2, 5, -10), this.scene);
137138
camera.setTarget(GameConstants.ZeroVector);
138-
///camera.attachControl(this.canvas)
139139

140140
return camera;
141141
}
142142

143143
private updateCameraAndLight(): void {
144144
this.camera.position.z = this._ball.getAbsolutePosition().z - 12;
145145
this.camera.position.y = this._ball.getAbsolutePosition().y + 6;
146-
//this.camera.setTarget(this.ball.getAbsolutePosition());
147146

148147
this.light.position.z = this._ball.getAbsolutePosition().z + 10;
149148
this.light.position.y = this._ball.getAbsolutePosition().y + 10;
@@ -153,10 +152,7 @@ export class GameSceneService {
153152
private configureSky() {
154153
const skyBox = MeshBuilder.CreateBox('skyBox', { size: 1000 }, this.scene);
155154
const skyBoxMaterial = new StandardMaterial('skyBox', this.scene);
156-
skyBoxMaterial.reflectionTexture = new CubeTexture(
157-
'/assets/environments/TropicalSunnyDay/TropicalSunnyDay',
158-
this.scene
159-
);
155+
skyBoxMaterial.reflectionTexture = new CubeTexture('/assets/environments/TropicalSunnyDay/TropicalSunnyDay', this.scene);
160156
skyBoxMaterial.reflectionTexture.coordinatesMode = Texture.SKYBOX_MODE;
161157
skyBoxMaterial.backFaceCulling = false;
162158
skyBox.material = skyBoxMaterial;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Game } from './game/index';
1+
import { Game } from './game/Game';
22
import type { GameHTMLElementsRefs } from './game/types';
33

44
const main = () => {

0 commit comments

Comments
 (0)