prog8/examples/swirl.p8

25 lines
552 B
Plaintext
Raw Normal View History

%import math
%import textio
2020-09-19 22:17:33 +00:00
%zeropage basicsafe
2018-09-30 23:01:39 +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 {
const uword screenwidth = txt.DEFAULT_WIDTH
const uword screenheight = txt.DEFAULT_HEIGHT
uword anglex
uword angley
ubyte color
2019-07-12 17:01:36 +00:00
sub start() {
repeat {
ubyte x = msb(math.sin8u(msb(anglex)) * screenwidth)
ubyte y = msb(math.cos8u(msb(angley)) * screenheight)
txt.setcc(x, y, 81, color)
anglex+=366
angley+=291
color++
2018-09-30 23:01:39 +00:00
}
}
}