From 4a303fab90bb9d14eb2a5f3e4483015172527f4c Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 15 Jan 2024 08:45:41 -0800 Subject: [PATCH] (bunnymark) Added controller input --- projects/examples/demos/bunnymark.tal | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/examples/demos/bunnymark.tal b/projects/examples/demos/bunnymark.tal index 637eb02..579d305 100644 --- a/projects/examples/demos/bunnymark.tal +++ b/projects/examples/demos/bunnymark.tal @@ -4,6 +4,7 @@ |00 @System &vector $2 &pad $6 &r $2 &g $2 &b $2 &debug $1 &halt $1 |20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 +|80 @Controller &vector $2 &button $1 &key $1 |90 @Mouse &vector $2 &x $2 &y $2 &state $1 &wheel $1 |c0 @DateTime &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1 @@ -45,6 +46,10 @@ .Mouse/state DEI ( ) DUP #01 NEQ ?{ add-bunny } ( ) #02 LTH ?{ remove-bunny } + ( | controller handling ) + .Controller/button DEI + ( ) DUP #01 NEQ ?{ add-bunny } + ( ) #02 LTH ?{ remove-bunny } ( | clear ) #0000 DUP2 .Screen/x DEO2 .Screen/y DEO2