twnlua: partial impl for return propagation, input now works

This commit is contained in:
veclavtalica
2024-12-23 22:02:17 +03:00
parent e7ed72dfc0
commit e06c879869
3 changed files with 50 additions and 25 deletions

View File

@ -4,6 +4,11 @@ offset = { x = 0, y = 0 }
angle = 0
function game_tick()
input.action {
name = "press",
control = "A"
}
draw.rectangle {
rect = { x = 0, y = 0, w = 640, h = 360 },
color = { r = 127, g = 0, b = 127, a = 255 },
@ -19,11 +24,13 @@ function game_tick()
},
}
draw.text {
string = "it never happened",
position = offset,
font = "/fonts/kenney-pixel.ttf",
}
if input.action_pressed { name = "press" } then
draw.text {
string = "it never happened",
position = offset,
font = "/fonts/kenney-pixel.ttf",
}
end
offset.x = ORIGIN.x + (math.cos(angle) * RADIUS)
offset.y = ORIGIN.y + (math.sin(angle) * RADIUS)