Skip to content

Commit

Permalink
remove dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
shanimal08 committed Feb 7, 2025
1 parent 8ecf319 commit b5ee093
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/scripts/core/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const MAX_PIXEL_COUNT = 2560 * 1440;
const FREE_BLOCKS_COUNT = 12;
const AUTO_RESTART = true;
const AUTO_START = false;
const SHOW_BLOCK = true;
const SHOW_BLOCK = false;
const DEFAULT_POSITION = [-20, 18, 20];
const DEFAULT_LOOKAT_POSITION = [0, 0, 0];
export const WEBGL_OPTS = { antialias: true, alpha: false, powerPreference: 'low-power' as WebGLPowerPreference };
Expand Down
9 changes: 5 additions & 4 deletions lib/scripts/tower.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import game from './logic/systemManager.ts';
import { Background, bgContainer } from './visuals/bg/bg.ts';
import loader from './core/loader.ts';
import { OrthographicCamera } from 'three';
import { canvasSignal, gameEndedSignal } from './logic/signals.ts';
import { canvasSignal } from './logic/signals.ts';

THREE.ColorManagement.enabled = false;

Expand All @@ -34,7 +34,7 @@ const TariTower = () => {
if (_canvasId && renderer) {
renderer.domElement.id = _canvasId;
canvas = renderer.domElement;
document.body.appendChild(renderer.domElement);
document.body.appendChild(canvas);

renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFShadowMap;
Expand Down Expand Up @@ -90,6 +90,7 @@ const TariTower = () => {
});
_canvasId = canvasId;
await _handleRenderer();

await heroBlocks.preload();
await blueNoise.preInit();
await coins.preload();
Expand Down Expand Up @@ -159,13 +160,13 @@ const TariTower = () => {
heroBlocks.update(dt);
coins.update(dt);
background.update(dt);

renderer.render(properties.scene, camera);
}
function destroy() {
canvas.remove();
renderer.dispose();
game.resetPostDestroy();

renderer.state.reset();
}
return {
preload,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tari-project/tari-tower",
"version": "0.0.13",
"version": "0.0.14",
"private": false,
"description": "the tower animation used in Tari Universe",
"homepage": "https://github.com/tari-project/tari-tower#readme",
Expand Down

0 comments on commit b5ee093

Please sign in to comment.