Add Maths Attacks, early implentation (only detects holding right key)
This commit is contained in:
44
maths-attacks.p8
Normal file
44
maths-attacks.p8
Normal file
@ -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
|
Reference in New Issue
Block a user