mirror of
https://github.com/csd4ni3l/loginween.git
synced 2026-01-01 12:33:49 +01:00
Move static resources into their own directories
This commit is contained in:
39
static/js/pumpkin_roll.js
Normal file
39
static/js/pumpkin_roll.js
Normal file
@@ -0,0 +1,39 @@
|
||||
function setup_game() {
|
||||
loadSprite("pumpkin", "/static/graphics/pumpkin.png");
|
||||
loadSprite("gravestone", "/static/gravestone.png")
|
||||
const SETTINGS = {
|
||||
"Graphics": {
|
||||
"Anti-Aliasing": {"type": "bool", "default": true},
|
||||
"Texture Filtering": {"type": "option", "options": ["Nearest", "Linear"], "default": "Linear"},
|
||||
"FPS Limit": {"type": "slider", "min": 0, "max": 480, "default": 60},
|
||||
},
|
||||
"Sound": {
|
||||
"Music": {"type": "bool", "default": true},
|
||||
"SFX": {"type": "bool", "default": true},
|
||||
"Music Volume": {"type": "slider", "min": 0, "max": 100, "default": 50},
|
||||
"SFX Volume": {"type": "slider", "min": 0, "max": 100, "default": 50},
|
||||
},
|
||||
"Input": {
|
||||
"Controller Enabled": {"type": "bool", "default": true}
|
||||
}
|
||||
};
|
||||
|
||||
scene("play", () => {
|
||||
let pumpkin_sprite = add([
|
||||
sprite("pumpkin"),
|
||||
pos(50, 670),
|
||||
anchor("center"),
|
||||
rotate(0)
|
||||
])
|
||||
|
||||
setInterval(() => {
|
||||
pumpkin_sprite.angle = (pumpkin_sprite.angle + dt() * 720) % 360;
|
||||
}, 100)
|
||||
|
||||
onKeyPress("jump", () => {
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
return ["Pumpkin Roll", SETTINGS];
|
||||
}
|
||||
Reference in New Issue
Block a user