mirror of
https://github.com/He4eT/DotDashPit.git
synced 2026-05-04 17:37:23 +00:00
game: initial layout
This commit is contained in:
parent
ea8b5daf1a
commit
270996ff41
1 changed files with 35 additions and 21 deletions
40
game.js
40
game.js
|
|
@ -1,25 +1,40 @@
|
||||||
// title: game title
|
// title: MorsePit
|
||||||
// author: game developer, email, etc.
|
// author: He4eT@oddsquat.org
|
||||||
// desc: short description
|
// desc: Defeat endless waves of enemies using Morse code.
|
||||||
// site: website link
|
// site: https://github.com/He4eT/MorsePit
|
||||||
// license: MIT License (change this to your license of choice)
|
// license: MIT License
|
||||||
// version: 0.1
|
// version: 0.1
|
||||||
// script: js
|
// script: js
|
||||||
|
|
||||||
var t=0
|
function TIC() {
|
||||||
var x=96
|
gameStages[currentStage]()
|
||||||
var y=24
|
}
|
||||||
|
|
||||||
function TIC()
|
/* Stages */
|
||||||
{
|
|
||||||
|
let currentStage = 'gameplay'
|
||||||
|
|
||||||
|
const gameStages = {
|
||||||
|
gameplay,
|
||||||
|
}
|
||||||
|
|
||||||
|
/* State */
|
||||||
|
|
||||||
|
let t = 0
|
||||||
|
let x = 96
|
||||||
|
let y = 24
|
||||||
|
|
||||||
|
/* Main Gameplay */
|
||||||
|
|
||||||
|
function gameplay() {
|
||||||
if (btn(0)) y--
|
if (btn(0)) y--
|
||||||
if (btn(1)) y++
|
if (btn(1)) y++
|
||||||
if (btn(2)) x--
|
if (btn(2)) x--
|
||||||
if (btn(3)) x++
|
if (btn(3)) x++
|
||||||
|
|
||||||
cls(13)
|
cls(13)
|
||||||
spr(1+((t%60)/30|0)*2,x,y,14,3,0,0,2,2)
|
spr(1 + (((t % 60) / 30) | 0) * 2, x, y, 14, 3, 0, 0, 2, 2)
|
||||||
print("HELLO WORLD!",84,84)
|
print('HELLO WORLD!', 84, 84)
|
||||||
t++
|
t++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -51,4 +66,3 @@ function TIC()
|
||||||
// <PALETTE>
|
// <PALETTE>
|
||||||
// 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
|
// 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
|
||||||
// </PALETTE>
|
// </PALETTE>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue