diff -ruN tree/index.html mod/index.html --- tree/index.html 1969-12-31 21:00:00.000000000 -0300 +++ mod/index.html 2026-11-02 20:27:23.996109424 -0300 @@ -0,0 +1,14 @@ + + + + + + +Asteroid Capitalist + + + +
+ + + diff -ruN tree/src/index.js mod/src/index.js --- tree/src/index.js 2020-08-20 10:55:20.000000000 -0300 +++ mod/src/index.js 2026-11-02 20:35:36.730707041 -0300 @@ -1,4 +1,3 @@ -import 'styles/main.scss'; import Phaser from 'phaser'; import gameConfig from 'configs/gameConfig'; import devConfig from 'configs/devConfig'; diff -ruN tree/src/scenes/UI.js mod/src/scenes/UI.js --- tree/src/scenes/UI.js 2020-08-20 10:55:20.000000000 -0300 +++ mod/src/scenes/UI.js 2026-11-02 20:27:23.995683041 -0300 @@ -1,5 +1,3 @@ -import Stats from 'stats-js'; -import * as dat from 'dat.gui'; import gameConfig from 'configs/gameConfig'; import isScene from 'components/isScene'; import createState from 'utils/createState'; @@ -12,90 +10,14 @@ const UI = function UIFunc() { const state = {}; - let gui; - let stats; - let guiController; - - function setupPerformanceStats() { - stats = new Stats(); - stats.setMode(0); - - stats.domElement.style.position = 'absolute'; - stats.domElement.style.left = '0px'; - stats.domElement.style.top = '0px'; - - document.body.appendChild(stats.domElement); - - // TODO cleanup listeners - state.getScene().events.on('preupdate', () => { - stats.begin(); - }); - state.getScene().events.on('postupdate', () => { - stats.end(); - }); - } - - function setupDatGui() { - gui = new dat.GUI(); - const folder = gui.addFolder('Dev Settings'); - - state.guiData = { - renderQTree: false, - drawColliders: false, - accelerationForceMag: 1.5, - maxSpeed: 7.5, - rateOfFire: 5, - playerAirDensity: 0.05, - }; - - guiController = folder.add(state.guiData, 'renderQTree').listen(); - - folder - .add(state.guiData, 'drawColliders') - .listen() - .onChange((v) => { - store.drawColliders = v; - }); - - folder - .add(state.guiData, 'accelerationForceMag', 0, 20) - .listen() - .onChange(v => store.player.setAccelerationForceMagnitude(v)); - - folder - .add(state.guiData, 'maxSpeed', 1, 25) - .listen() - .onChange(v => store.player.setMaxSpeed(v)); - - folder - .add(state.guiData, 'rateOfFire', 1, 100) - .listen() - .onChange(v => store.player.setRateOfFire(v)); - - folder - .add(state.guiData, 'playerAirDensity', 0.001, 0.5) - .listen() - .onChange(v => store.player.setAirDensity(v)); - - folder.close(); - } - + // Sem o painel de desenvolvimento (dat.gui) e sem o medidor de desempenho (stats-js): o build do FredyGames nao os inclui. function getGUIController() { - return guiController; + return undefined; } - function create() { - if (devConfig.DEBUG) { - setupDatGui(); - // setupPerformanceStats(); - } - } + function create() {} - function destroy() { - gui.destroy(); - stats.end(); - document.body.removeChild(stats); - } + function destroy() {} const localState = { // methods diff -ruN tree/src/utils/resizeCanvas.js mod/src/utils/resizeCanvas.js --- tree/src/utils/resizeCanvas.js 2020-08-20 10:55:20.000000000 -0300 +++ mod/src/utils/resizeCanvas.js 2026-11-02 20:36:15.510922302 -0300 @@ -1,7 +1,11 @@ import gameConfig from 'configs/gameConfig'; +import store from 'root/store'; const resizeCanvas = function resizeCanvasFunc() { const canvas = document.querySelector('#game>canvas'); + if (!canvas) { + return; + } const windowWidth = window.innerWidth; const windowHeight = window.innerHeight; const windowRatio = windowWidth / windowHeight; @@ -13,6 +17,14 @@ canvas.style.width = `${windowHeight * gameRatio}px`; canvas.style.height = `${windowHeight}px`; } + // O Phaser guarda o tamanho do canvas na tela para converter a posicao do mouse; sem isto, com a janela menor que o jogo + // (1920x1080) os cliques acertam o lugar errado (o botao Play nao responde). + // (adiado um quadro: na primeira chamada o jogo ainda nao guardou store.app) + window.requestAnimationFrame(() => { + if (store.app && store.app.scale) { + store.app.scale.refresh(); + } + }); }; export default resizeCanvas; diff -ruN tree/styles/main.css mod/styles/main.css --- tree/styles/main.css 1969-12-31 21:00:00.000000000 -0300 +++ mod/styles/main.css 2026-11-02 20:27:23.995994296 -0300 @@ -0,0 +1,50 @@ +html, body { + margin: 0; + padding: 0; + height: 100%; + overflow: hidden; + font-family: 'future', serif; + color: #757575; + letter-spacing: 0.21px; + font-weight: 700; + background-color: #242424; +} + +#game { + height: 100%; + width: 100%; +} + +#fullscreen_toggle { + position: absolute; + right: 15px; + bottom: 15px; + z-index: 1000000; + color: #aaaaaaaa; + display: inline-block; + text-decoration: inherit; + width: 1em; + margin-right: 0.2em; + text-align: center; + + /* For safety - reset parent styles, that can break glyph codes*/ + font-variant: normal; + text-transform: none; + + /* fix buttons height, for twitter bootstrap */ + line-height: 1em; + + /* You can be more comfortable with increased icons size */ + font-size: 250%; + + /* Font smoothing. That was taken from TWBS */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +@font-face { + font-family: future; + src: url('assets/fonts/kenvector_future_thin.ttf'); + font-weight:400; + font-weight:normal; + } \ No newline at end of file