prog8/examples/swirl-float.p8

27 lines
477 B
Plaintext
Raw Normal View History

2020-08-27 16:10:22 +00:00
%import c64textio
%import c64flt
2019-07-29 21:11:13 +00:00
main {
const uword width = 40
const uword height = 25
struct Ball {
float t
ubyte color
}
sub start() {
Ball ball
repeat {
ubyte xx=(sin(ball.t) * width/2.1) + width/2.0 as ubyte
ubyte yy=(cos(ball.t*1.1356) * height/2.1) + height/2.0 as ubyte
txt.setcc(xx, yy, 81, ball.color)
ball.t += 0.08
ball.color++
}
}
}