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/mouse.csn

40 lines
679 B

(
(sc-init 640 480)
(sym x r6)
(sym y r7)
(def BOXSIZE 10)
(:loop)
(sc-poll)
(sc-mouse x y
(ov? (j :next)))
(sc-mbtn r0 0 (z? (j :next)))
(sym vx r0)
(sym vy r1)
(sym endx r2)
(sym endy r3)
(add endx x BOXSIZE)
(add endy y BOXSIZE)
(sub vy y BOXSIZE)
(:nextline)
(cmp vy endy (eq? (j :endbox)))
(sub vx x BOXSIZE)
(:nextpx)
(sc-px vx vy 0xffffff)
(inc vx)
(cmp vx endx
(eq? (inc vy)(j :nextline)))
(j :nextpx)
(:endbox)
(:next)
(sleep 20000)
(j :loop)
)