Croissant Runtime
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
crsn/examples/screen_bounce.csn

30 lines
608 B

; Set log level to "info" or above for the best results!
(
(main
(sc-init 800 600)
(sc-opt 1 0) ; auto blit
(sc-opt 2 60) ; frame rate
(ld r0 5) ; x
(ld r1 0) ; y
(ld r2 1) ; dx
(ld r3 1) ; dy
(ld r5 0x3300ff)
(:loop)
(add r5 0x000001)
(and r5 0xffffff)
(sc-px r0 r1 r5)
(add r0 r2)
(add r1 r3)
(cmp r0 799 (eq? (ld r2 -1)))
(cmp r0 0 (eq? (ld r2 1)))
(cmp r1 599 (eq? (ld r3 -1)))
(cmp r1 0 (eq? (ld r3 1)))
(sc-blit 0)
(j :loop)
)
)