mouse and key input, handle close btn, mouse demo

This commit is contained in:
2020-10-05 23:37:39 +02:00
parent 6eef2b7ae3
commit 583ac7bcbf
7 changed files with 341 additions and 11 deletions
+40
View File
@@ -0,0 +1,40 @@
(
(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)
)