2020-09-20 21:49:36 +00:00
|
|
|
%import textio
|
2020-09-19 22:17:33 +00:00
|
|
|
%zeropage basicsafe
|
2018-09-30 23:01:39 +00:00
|
|
|
|
2020-09-20 21:49:36 +00:00
|
|
|
; Note: this program is compatible with C64 and CX16.
|
2018-09-30 23:01:39 +00:00
|
|
|
|
2020-09-19 22:17:33 +00:00
|
|
|
main {
|
2020-09-19 23:14:53 +00:00
|
|
|
const uword screenwidth = txt.DEFAULT_WIDTH
|
|
|
|
const uword screenheight = txt.DEFAULT_HEIGHT
|
2019-07-12 17:01:36 +00:00
|
|
|
struct Ball {
|
2019-01-08 00:27:25 +00:00
|
|
|
uword anglex
|
|
|
|
uword angley
|
2018-10-10 07:21:20 +00:00
|
|
|
ubyte color
|
2019-07-12 17:01:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sub start() {
|
|
|
|
Ball ball
|
2020-07-25 14:25:02 +00:00
|
|
|
repeat {
|
2020-09-19 23:14:53 +00:00
|
|
|
ubyte x = msb(sin8u(msb(ball.anglex)) * screenwidth)
|
|
|
|
ubyte y = msb(cos8u(msb(ball.angley)) * screenheight)
|
2020-08-27 16:10:22 +00:00
|
|
|
txt.setcc(x, y, 81, ball.color)
|
2020-09-19 22:17:33 +00:00
|
|
|
ball.anglex+=366
|
|
|
|
ball.angley+=291
|
2019-07-12 17:01:36 +00:00
|
|
|
ball.color++
|
2018-09-30 23:01:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|