From f40981f9f2eeaf8941e6a0cc561054a044ed2667 Mon Sep 17 00:00:00 2001 From: djib Date: Sat, 10 Sep 2022 13:11:41 +0200 Subject: [PATCH] Add Maths Attacks, early implentation (only detects holding right key) --- maths-attacks.p8 | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 maths-attacks.p8 diff --git a/maths-attacks.p8 b/maths-attacks.p8 new file mode 100644 index 0000000..058912e --- /dev/null +++ b/maths-attacks.p8 @@ -0,0 +1,44 @@ +pico-8 cartridge // http://www.pico-8.com +version 37 +__lua__ +-- maths attacks -- +-- by djib -- +btn_stat = false +btnp_stat = false +held_stat = false +switch = false + +function _init() +end + +function _update() + btn_stat = false + if btn(➡️) then + btn_stat = true + end + btnp_stat = false + if btnp(➡️) then + btnp_stat = true + end + if btnp(➡️) and btn(➡️) then + if switch then + held_stat = true + else + switch=true + end + else + held_stat = false + end + +end + +function _draw() + print(tostr(btn_stat) .. "-" .. tostr(btnp_stat) .. "-" tostr(held_stat)) +end +__gfx__ +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000