2020-09-20 21:49:36 +00:00
|
|
|
%import textio
|
|
|
|
%import floats
|
|
|
|
%zeropage floatsafe
|
2019-01-05 01:42:58 +00:00
|
|
|
|
2020-09-20 21:49:36 +00:00
|
|
|
; Note: this program is compatible with C64 and CX16.
|
2019-01-05 01:42:58 +00:00
|
|
|
|
2020-09-20 21:49:36 +00:00
|
|
|
main {
|
2019-01-05 01:42:58 +00:00
|
|
|
|
2020-08-31 19:01:18 +00:00
|
|
|
struct Ball {
|
2019-01-05 01:42:58 +00:00
|
|
|
float t
|
|
|
|
ubyte color
|
2020-08-31 19:01:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sub start() {
|
|
|
|
|
|
|
|
Ball ball
|
2019-01-05 01:42:58 +00:00
|
|
|
|
2020-07-25 14:25:02 +00:00
|
|
|
repeat {
|
2020-09-20 21:49:36 +00:00
|
|
|
ubyte xx=(sin(ball.t) * txt.DEFAULT_WIDTH/2.1) + txt.DEFAULT_WIDTH/2.0 as ubyte
|
|
|
|
ubyte yy=(cos(ball.t*1.1356) * txt.DEFAULT_HEIGHT/2.1) + txt.DEFAULT_HEIGHT/2.0 as ubyte
|
2020-08-31 19:01:18 +00:00
|
|
|
txt.setcc(xx, yy, 81, ball.color)
|
|
|
|
ball.t += 0.08
|
|
|
|
ball.color++
|
2019-01-05 01:42:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|