mirror of
https://github.com/irmen/prog8.git
synced 2024-08-22 03:29:07 +00:00
some programs are now 100% source compatible between C64 and Cx16 targets! import libraries have been rena;med
27 lines
613 B
Lua
27 lines
613 B
Lua
%import textio
|
|
%zeropage basicsafe
|
|
|
|
; Note: this program is compatible with C64 and CX16.
|
|
|
|
main {
|
|
const uword screenwidth = txt.DEFAULT_WIDTH
|
|
const uword screenheight = txt.DEFAULT_HEIGHT
|
|
struct Ball {
|
|
uword anglex
|
|
uword angley
|
|
ubyte color
|
|
}
|
|
|
|
sub start() {
|
|
Ball ball
|
|
repeat {
|
|
ubyte x = msb(sin8u(msb(ball.anglex)) * screenwidth)
|
|
ubyte y = msb(cos8u(msb(ball.angley)) * screenheight)
|
|
txt.setcc(x, y, 81, ball.color)
|
|
ball.anglex+=366
|
|
ball.angley+=291
|
|
ball.color++
|
|
}
|
|
}
|
|
}
|