Skip to content

Commit 6d93b66

Browse files
committed
update engine
* add "autoplay" (default enabled) as url query arg, set to 0 to disable
1 parent 8a12304 commit 6d93b66

File tree

6 files changed

+78
-73
lines changed

6 files changed

+78
-73
lines changed

package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/about.html

+9-6
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ <h2><a id="settings">Game Configuration</a></h2>
138138
// global functions: window.init(), window.update(dt), window.draw()
139139
settings.loop = { init: function, update: function, draw: function}
140140

141+
// the canvas (by default a new canvas is created)
142+
settings.canvas = null
143+
141144
// make the game screen fill the entire screen
142145
settings.fullscreen = true
143146

@@ -147,9 +150,6 @@ <h2><a id="settings">Game Configuration</a></h2>
147150
// scale the canvas
148151
settings.autoscale = true
149152

150-
// the canvas wrapper
151-
settings.parent = document.body
152-
153153
// target FPS
154154
settings.fps = 60
155155

@@ -182,6 +182,7 @@ <h2><a id="drawing">Functions for Drawing</a></h2>
182182

183183
// clear the canvas
184184
// all color argument is a integer (a color from 0 to 7)
185+
// alias: cls(...)
185186
clear(color: null|number): void
186187

187188
// draw a color-filled rectangle
@@ -215,6 +216,7 @@ <h2><a id="drawing">Functions for Drawing</a></h2>
215216
*/
216217

217218
// draw a text
219+
// alias: print(...)
218220
text(x, y, text: string, color = 0, size: number|null, font = 'monospace'): void
219221

220222
// set the text alignment and baseline
@@ -365,9 +367,6 @@ <h2><a id="globals">Globals Variables</a></h2>
365367
// see: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D
366368
CANVAS.ctx
367369

368-
// the game canvas wrapper
369-
PARENT: HTMLElement
370-
371370
// the game screen width
372371
WIDTH: number
373372

@@ -397,6 +396,10 @@ <h2><a id="globals">Globals Variables</a></h2>
397396

398397
// the tap/click Y position
399398
TAPY: number
399+
400+
// The ratio of the circumference of a circle to its diameter,
401+
// approximately 3.14159
402+
PI: number
400403
</code></pre>
401404

402405
<h2><a id="advanced">Advanced Features</a></h2>

public/app.js

+57-57
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)