twnlua: partial impl for return propagation, input now works
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user