2024-10-07 12:23:04 +00:00
|
|
|
ORIGIN = { x = 320, y = 180 }
|
|
|
|
RADIUS = 48
|
|
|
|
offset = { x = 0, y = 0 }
|
|
|
|
angle = 0
|
|
|
|
|
|
|
|
function game_tick()
|
2024-10-29 09:25:24 +00:00
|
|
|
draw.rectangle {
|
2024-10-07 12:23:04 +00:00
|
|
|
rect = { x = 0, y = 0, w = 640, h = 360 },
|
|
|
|
color = { r = 127, g = 0, b = 127, a = 255 },
|
|
|
|
}
|
|
|
|
|
2024-10-29 09:25:24 +00:00
|
|
|
input.action {
|
|
|
|
name = "move_up",
|
|
|
|
control = input.CONTROL_L,
|
|
|
|
}
|
|
|
|
|
|
|
|
if input.action_pressed "move_up" then
|
|
|
|
draw.text { string = "BOO!" }
|
|
|
|
end
|
|
|
|
|
|
|
|
draw.sprite {
|
|
|
|
texture = "/assets/title.png",
|
2024-10-07 12:23:04 +00:00
|
|
|
rect = {
|
|
|
|
x = 320 - (320 / 2),
|
|
|
|
y = 180 - (128 / 2),
|
|
|
|
w = 320,
|
|
|
|
h = 128,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2024-10-29 09:25:24 +00:00
|
|
|
draw.text {
|
2024-10-07 12:23:04 +00:00
|
|
|
string = "IT KEEPS HAPPENING",
|
|
|
|
position = offset,
|
|
|
|
font = "/fonts/kenney-pixel.ttf",
|
|
|
|
}
|
|
|
|
|
|
|
|
offset.x = ORIGIN.x + (math.cos(angle) * RADIUS)
|
|
|
|
offset.y = ORIGIN.y + (math.sin(angle) * RADIUS)
|
|
|
|
angle = angle + 0.1
|
|
|
|
end
|