game.nv
· 643 B · Text
Неформатований
Playground
| 'DOCUMENTATION' | ~~
this game library lets you create a canvas that you can
update every frame . you can start a game like so :
// '' start a 400 by 600 game
and you can create a game loop that updates like this :
/ '' game loop
/ '' do something
'' do something else
'' next frame
| '' start a $x by $y game
| '@graphics' . canvas init canvas . set resolution $x $y
'DOM' ( <query canvas <style display = block margin = [1rem auto] > > )
'' game loop
| '' next frame
| '' @gas is now 50000
'@js' window.requestAnimationFrame(nextFrame);
|| '@js' const nextFrame = () => { f("", "game", "loop"); me.run(); }
1 | | 'DOCUMENTATION' | ~~ |
2 | this game library lets you create a canvas that you can |
3 | update every frame . you can start a game like so : |
4 | |
5 | // '' start a 400 by 600 game |
6 | |
7 | and you can create a game loop that updates like this : |
8 | |
9 | / '' game loop |
10 | / '' do something |
11 | '' do something else |
12 | '' next frame |
13 | |
14 | |
15 | | '' start a $x by $y game |
16 | | '@graphics' . canvas init canvas . set resolution $x $y |
17 | 'DOM' ( <query canvas <style display = block margin = [1rem auto] > > ) |
18 | '' game loop |
19 | |
20 | | '' next frame |
21 | | '' @gas is now 50000 |
22 | '@js' window.requestAnimationFrame(nextFrame); |
23 | |
24 | || '@js' const nextFrame = () => { f("", "game", "loop"); me.run(); } |