mirror of
https://github.com/irmen/prog8.git
synced 2024-11-20 03:32:05 +00:00
c38508c262
forever loop is gone (use repeat without iteration count). struct literal is now same as array literal [...] to avoid parsing ambiguity with scope blocks.
29 lines
511 B
Lua
29 lines
511 B
Lua
%import c64utils
|
|
|
|
main {
|
|
|
|
const uword width = 40
|
|
const uword height = 25
|
|
|
|
struct Ball {
|
|
uword anglex
|
|
uword angley
|
|
ubyte color
|
|
}
|
|
|
|
sub start() {
|
|
|
|
Ball ball
|
|
|
|
repeat {
|
|
ubyte x = msb(sin8u(msb(ball.anglex)) as uword * width)
|
|
ubyte y = msb(cos8u(msb(ball.angley)) as uword * height)
|
|
c64scr.setcc(x, y, 81, ball.color)
|
|
|
|
ball.anglex+=800
|
|
ball.angley+=947
|
|
ball.color++
|
|
}
|
|
}
|
|
}
|