0,]']±>Sï}WÿÍu§ðp8·d%qy)6o;]ÉA¦ösï÷ôôô”°ÂVl†3Sï}WÿÍu§ðp8·d%qy)6o;]ÉA¦ösï÷ôôô”°ÂVl†3Sï}WÿÍu§ðp8·d%qy)6o;]ÉA¦ösï÷ôôô”°ÂVl†3 Implement Audio. -- -> VFX System for Combat -- -> Learn: A training mode /w RPS icons -- -> Stats after a match -- -> Tournament mode(?) -- Audio -- -> Hit -- -> Block -- -> Not Rdy POW -- -> POW Super effect -- -> BGM #1 -- -> BGM #2 -- More Characters (Coming Soon) -- -> Sans from Undertale -- -> Somebody of Vampire Survivors -- -> The Prisoner from Dead Cells -- -> Peppino Spaghetti from Pizza Tower -- -> Meat Boy from Super Meat Boy -- -> Duck from Duck Game -- -> Ink from Ink -- -> Braid from Braid -- -> Klaus from La Cosa Entertaiment -- -> 1Bitman from 1Bitman and 99 lost games -- -> Cat from Fluff eaters Fiery Squirrel -- Game Menu functions function CONTROLS() cls() --prev_scn=scn sync(1,0,false) scn="learn" print("Controls",0,0,12) end function CREDITS() cls() sync(1,0,false) scn="logo" end GameMenu={CONTROLS,CREDITS} -- Game Scale SCALE=2 -- Scale Wrappers function drw_spr(id, x, y, colorkey, scale, flip, rotate) spr(id, x*SCALE, y*SCALE, colorkey, (scale or 1)*SCALE, flip, rotate) end function drw_map(celx, cely, w, h, sx, sy, colorkey, scale) map(celx, cely, w, h, sx*SCALE, sy*SCALE, colorkey, (scale or 1)*SCALE) end function drw_text(txt, x, y, col, fixed, scale, smallcaps) print(txt, x*SCALE, y*SCALE, col, fixed, (scale or 1)*SCALE, smallcaps) end -- Disclaimer function drw_disclaimer() cls() spr(148,78,31) spr(151,150,31) print("Disclaimer",92,32,ts) print("SIF is a non-commercial, fan-made project",8,52,13) print("created for educational & entertainment",8,62,13) print("purposes.",8,72,13) print("All characters, names, and refs",64,72,12) print("belong to their respective owners.",8,82,12) if btnp(0) or btnp(1) or btnp(2) or btnp(3) or btnp(4) or btnp(5) or btnp(6) or btnp(7) or btnp(8) then scn="logo" end mt=mt+0.4 if mt>180 then scn="logo" end end -- DATA function data_characters() --Data Table of Characters in-game characters={ { name="The Drifter", idle1=256, idle2=257, idle3=272, idle4=273, atk1=258, atk2=259, atk3=274, atk4=275, blk1=260, blk2=261, blk3=276, blk4=277, hrt1=262, hrt2=263, hrt3=278, hrt4=279, vic1=268, vic2=269, vic3=284, vic4=285, def1=270, def2=271, def3=286, def4=287, pow1f1=264, pow2f1=265, pow3f1=280, pow4f1=281, pow1f2=266, pow2f2=267, pow3f2=282, pow4f2=283, }, { name="The Impostor", idle1=288, idle2=289, idle3=304, idle4=305, atk1=290, atk2=291, atk3=306, atk4=307, blk1=292, blk2=293, blk3=308, blk4=309, hrt1=294, hrt2=295, hrt3=310, hrt4=311, vic1=300, vic2=301, vic3=316, vic4=317, def1=302, def2=303, def3=318, def4=319, pow1f1=296, pow2f1=297, pow3f1=312, pow4f1=313, pow1f2=298, pow2f2=299, pow3f2=314, pow4f2=315, }, { name="Green Knight", idle1=320, idle2=321, idle3=336, idle4=337, atk1=322, atk2=323, atk3=338, atk4=339, blk1=324, blk2=325, blk3=340, blk4=341, hrt1=326, hrt2=327, hrt3=342, hrt4=343, vic1=332, vic2=333, vic3=348, vic4=349, def1=334, def2=335, def3=350, def4=351, pow1f1=328, pow2f1=329, pow3f1=344, pow4f1=345, pow1f2=330, pow2f2=331, pow3f2=346, pow4f2=347, }, { name="Gomez", idle1=352, idle2=353, idle3=368, idle4=369, atk1=354, atk2=355, atk3=370, atk4=371, blk1=356, blk2=357, blk3=372, blk4=373, hrt1=358, hrt2=359, hrt3=374, hrt4=375, vic1=364, vic2=365, vic3=380, vic4=381, def1=366, def2=367, def3=382, def4=383, pow1f1=360, pow2f1=361, pow3f1=376, pow4f1=377, pow1f2=362, pow2f2=363, pow3f2=378, pow4f2=379, }, { name="Dwight", idle1=384, idle2=385, idle3=400, idle4=401, atk1=386, atk2=387, atk3=402, atk4=403, blk1=388, blk2=389, blk3=404, blk4=405, hrt1=390, hrt2=391, hrt3=406, hrt4=407, vic1=396, vic2=397, vic3=412, vic4=413, def1=398, def2=399, def3=414, def4=415, pow1f1=392, pow2f1=393, pow3f1=408, pow4f1=409, pow1f2=394, pow2f2=395, pow3f2=410, pow4f2=411, }, { name="Pops", idle1=416, idle2=417, idle3=432, idle4=433, atk1=418, atk2=419, atk3=434, atk4=435, blk1=420, blk2=421, blk3=436, blk4=437, hrt1=422, hrt2=423, hrt3=438, hrt4=439, vic1=428, vic2=429, vic3=444, vic4=445, def1=430, def2=431, def3=446, def4=447, pow1f1=424, pow2f1=425, pow3f1=440, pow4f1=441, pow1f2=426, pow2f2=427, pow3f2=442, pow4f2=443, }, { name="Mugman", idle1=448, idle2=449, idle3=464, idle4=465, atk1=450, atk2=451, atk3=466, atk4=467, blk1=452, blk2=453, blk3=468, blk4=469, hrt1=454, hrt2=455, hrt3=470, hrt4=471, vic1=460, vic2=461, vic3=476, vic4=477, def1=462, def2=463, def3=478, def4=479, pow1f1=456, pow2f1=457, pow3f1=472, pow4f1=473, pow1f2=458, pow2f2=459, pow3f2=474, pow4f2=475, }, { name="Madeline", idle1=480, idle2=481, idle3=496, idle4=497, atk1=482, atk2=483, atk3=498, atk4=499, blk1=484, blk2=485, blk3=500, blk4=501, hrt1=486, hrt2=487, hrt3=502, hrt4=503, vic1=492, vic2=493, vic3=508, vic4=509, def1=494, def2=495, def3=510, def4=511, pow1f1=488, pow2f1=489, pow3f1=504, pow4f1=505, pow1f2=490, pow2f2=491, pow3f2=506, pow4f2=507, }, --{ name="Meat Boy", --idle1=256, idle2=257, idle3=272, idle4=273, --atk1=258, atk2=259, atk3=274, atk4=275, --blk1=260, blk2=261, blk3=276, blk4=277, --hrt1=262, hrt2=263, hrt3=278, hrt4=279, --vic1=268, vic2=269, vic3=284, vic4=285, --def1=270, def2=271, def3=286, def4=287, --pow1f1=264, pow2f1=265, pow3f1=280, pow4f1=281, --pow1f2=266, pow2f2=267, pow3f2=282, pow4f2=283, --}, --{ name="The Prisioner", --idle1=288, idle2=289, idle3=304, idle4=305, --atk1=290, atk2=291, atk3=306, atk4=307, --blk1=292, blk2=293, blk3=308, blk4=309, --hrt1=294, hrt2=295, hrt3=310, hrt4=311, --vic1=300, vic2=301, vic3=316, vic4=317, --def1=302, def2=303, def3=318, def4=319, --pow1f1=296, pow2f1=297, pow3f1=312, pow4f1=313, --pow1f2=298, pow2f2=299, pow3f2=314, pow4f2=315, --}, --{ name="TBD1", --idle1=320, idle2=321, idle3=336, idle4=337, --atk1=322, atk2=323, atk3=338, atk4=339, --blk1=324, blk2=325, blk3=340, blk4=341, --hrt1=326, hrt2=327, hrt3=342, hrt4=343, --vic1=332, vic2=333, vic3=348, vic4=349, --def1=334, def2=335, def3=350, def4=351, --pow1f1=328, pow2f1=329, pow3f1=344, pow4f1=345, --pow1f2=330, pow2f2=331, pow3f2=346, pow4f2=347, --}, --{ name="TBD2", --idle1=352, idle2=353, idle3=368, idle4=369, --atk1=354, atk2=355, atk3=370, atk4=371, --blk1=356, blk2=357, blk3=372, blk4=373, --hrt1=358, hrt2=359, hrt3=374, hrt4=375, --vic1=364, vic2=365, vic3=380, vic4=381, --def1=366, def2=367, def3=382, def4=383, --pow1f1=360, pow2f1=361, pow3f1=376, pow4f1=377, --pow1f2=362, pow2f2=363, pow3f2=378, pow4f2=379, --}, --{ name="TBD3", --idle1=384, idle2=385, idle3=400, idle4=401, --atk1=386, atk2=387, atk3=402, atk4=403, --blk1=388, blk2=389, blk3=404, blk4=405, --hrt1=390, hrt2=391, hrt3=406, hrt4=407, --vic1=396, vic2=397, vic3=412, vic4=413, --def1=398, def2=399, def3=414, def4=415, --pow1f1=392, pow2f1=393, pow3f1=408, pow4f1=409, --pow1f2=394, pow2f2=395, pow3f2=410, pow4f2=411, --}, --{ name="TBD4", --idle1=416, idle2=417, idle3=432, idle4=433, --atk1=418, atk2=419, atk3=434, atk4=435, --blk1=420, blk2=421, blk3=436, blk4=437, --hrt1=422, hrt2=423, hrt3=438, hrt4=439, --vic1=428, vic2=429, vic3=444, vic4=445, --def1=430, def2=431, def3=446, def4=447, --pow1f1=424, pow2f1=425, pow3f1=440, pow4f1=441, --pow1f2=426, pow2f2=427, pow3f2=442, pow4f2=443, --}, --{ name="TBD5", --idle1=448, idle2=449, idle3=464, idle4=465, --atk1=450, atk2=451, atk3=466, atk4=467, --blk1=452, blk2=453, blk3=468, blk4=469, --hrt1=454, hrt2=455, hrt3=470, hrt4=471, --vic1=460, vic2=461, vic3=476, vic4=477, --def1=462, def2=463, def3=478, def4=479, --pow1f1=456, pow2f1=457, pow3f1=472, pow4f1=473, --pow1f2=458, pow2f2=459, pow3f2=474, pow4f2=475, --}, --{ name="TBD6", --idle1=480, idle2=481, idle3=496, idle4=497, --atk1=482, atk2=483, atk3=498, atk4=499, --blk1=484, blk2=485, blk3=500, blk4=501, --hrt1=486, hrt2=487, hrt3=502, hrt4=503, --vic1=492, vic2=493, vic3=508, vic4=509, --def1=494, def2=495, def3=510, def4=511, --pow1f1=488, pow2f1=489, pow3f1=504, pow4f1=505, --pow1f2=490, pow2f2=491, pow3f2=506, pow4f2=507, --}, } end function data_stages() stages={ { name="Time Chamber", desc="Place to prac", loc=0, sp1=224, sp2=225, sp3=227 }, { name="Wolf Bridge", desc="London Street", loc=30, sp1=212, sp2=213, sp3=214 }, { name="Midnight Beach", desc="Twilli beach", loc=60, sp1=232, sp2=233, sp3=234 }, { name="Beautyville", desc="A tiny town", loc=90, sp1=221, sp2=222, sp3=223 }, } end function data_music() -- Music data end function play_music() -- Play the music end function mode_pick() -- Choosing a Game mode if mode=="arcade" then if btnp(1) then mode="versus" end --if btnp(0) then mode="learn" end elseif mode=="versus" then --if btnp(1) then mode="learn" end if btnp(0) then mode="arcade" end elseif mode=="learn" then if btnp(1) then mode="arcade" end if btnp(0) then mode="versus" end end if btnp(4) then if mode=="arcade" then random_ai_pick() scn="character_select" elseif mode=="versus" then scn="character_select" elseif mode=="learn" then --scn="learn" end end end --function set_bank(bank) --if bank ~= current_bank then --current_bank=bank --sync(2, current_bank, false) --end --end function update_character_select() -- P1 Navigation if mode=="arcade" or mode=="versus" then if p1_confirm==false then if btnp(2) then -- Left p1_select=(p1_select-2) % #characters+1 end if btnp(3) then -- Right p1_select=p1_select % #characters+1 end if btnp(4) then p1_confirm=true end end if p1_confirm==false and p2_confirm==false then if btnp(5) or btnp(13) then scn="menu" end end end -- P2 Navigation if mode=="versus" then if p2_confirm==false then if btnp(10) then p2_select=(p2_select-2) % #characters+1 end -- Left if btnp(11) then p2_select=p2_select % #characters+1 end -- Right if btnp(12) then p2_confirm=true end end end -- Game Transition to Combat if p1_confirm and p2_confirm then p1_character = characters[p1_select] p2_character = characters[p2_select] if not ready then ready=true elseif btnp(4) or btnp(12) then scn="stage_select" end end --Regret Char selection if p1_confirm then if btnp(5) then p1_confirm=false end end if p2_confirm then if btnp(13) then p2_confirm=false end end --Debug section --print("Character Select Here",88,32,12) --print(p1_select,16,16,5) --print(p2_select,16,24,9) end function random_ai_pick() -- The AI Pick a Random Character to -- play in Arcade Mode. ai_set={ move={ "atk", "blk", "grb", "pow" } } random=math.random p2_select=random(1,#characters) if mode=="arcade" then p2_confirm=true end end function update_stage_select() -- Both Navigation -- Left if btnp(2) then stage_select=(stage_select-2)% #stages+1 end if btnp(10) then stage_select=(stage_select-2)% #stages+1 end --Here for the player left. -- Right if btnp(3) then stage_select=stage_select % #stages+1 end if btnp(11) then stage_select=stage_select % #stages+1 end -- here for the player left. -- Confirm if btnp(4) then stage_confirm=true end if btnp(12) then stage_confirm=true end -- here for the player left. -- Stage Selected! if stage_confirm then scn="quick" end --Debug Section --print(stage_select,8,16,12) end function update_pre_round() pre_round_timer=pre_round_timer-1 if pre_round_timer<=0 then state="round" current_time=ROUND_TIME elseif pre_round_timer<=LETS_RUMBLE_TIME then pre_round_msg="rumble" end end function update_round() current_time=current_time-1 if p1_life<=0 or p2_life<=0 then state="round_over" end if current_time<=0 then state="round_over" end end function update_post_round() post_round_timer=post_round_timer-1 if post_round_timer<=0 then if not match_winner then reset_round() end end end function check_action(p1_action, p2_action) if p1_action=="atk" and p2_action=="grb" or p1_action=="grb" and p2_action=="blk" or p1_action=="blk" and p2_action=="atk" or p1_action=="atk" and p2_action==nil or p1_action=="grb" and p2_action==nil then p2_life=p2_life-1 p2_pow=p2_pow+1 p2_hit=0 p1_hit=p1_hit+1 elseif p2_action=="atk" and p1_action=="grb" or p2_action=="grb" and p1_action=="blk" or p2_action=="blk" and p1_action=="atk" or p2_action=="atk" and p1_action==nil or p2_action=="grb" and p1_action==nil then p1_life=p1_life-1 p1_pow=p1_pow+1 p1_hit=0 p2_hit=p2_hit+1 elseif p1_action=="pow" and p1_pow>=5 and p2_action=="atk" or p1_action=="pow" and p1_pow>=5 and p2_action=="grb" or p1_action=="pow" and p1_pow>=5 and p2_action==nil then p2_life=p2_life-3 p2_pow=p2_pow+1 p2_hit=0 p1_pow=0 p1_hit=p1_hit+3 elseif p2_action=="pow" and p2_pow>=5 and p1_action=="atk" or p2_action=="pow" and p2_pow>=5 and p1_action=="grb" or p2_action=="pow" and p2_pow>=5 and p1_action==nil then p1_life=p1_life-3 p1_pow=p1_pow+1 p1_hit=0 p2_pow=0 p2_hit=p2_hit+3 elseif p1_action=="atk" and p2_action=="atk" or p1_action=="grb" and p2_action=="grb" or p1_action=="blk" and p2_action=="blk" or p1_action=="pow" and p2_action=="pow" then p1_hit=0 p2_hit=0 elseif p1_action=="pow" and p1_pow>=5 and p2_action=="blk" then p1_pow=0 p1_hit=0 elseif p2_action=="pow" and p2_pow>=5 and p1_action=="blk" then p2_pow=0 p2_hit=0 end end function check_pow() --Debug Text --print(p1_pow,96,104,10) --print(p2_pow,136,104,12) if p1_pow>=5 then drw_spr(74,88/SCALE-17,88/SCALE+14,0) drw_spr(75,96/SCALE-13,88/SCALE+14,0) drw_spr(76,104/SCALE-9,88/SCALE+14,0) end if p2_pow>=5 then drw_spr(74,128/SCALE+3,88/SCALE+14,0) drw_spr(75,136/SCALE+7,88/SCALE+14,0) drw_spr(76,144/SCALE+11,88/SCALE+14,0) end end function check_winner() if p1_win>=3 then match_winner="Player 1" elseif p2_win>=3 then match_winner="Player 2" end end function check_anim() if p1_action=="atk" then char_anim("p1","atk") elseif p1_action=="blk" then char_anim("p1","blk") elseif p1_action=="grb" then char_anim("p1","grb") elseif p1_action=="pow" then if p1_pow>=5 and p1_pow<7 then char_anim("p1","pow1") elseif p1_pow>=7 then char_anim("p1","pow2") elseif p1_pow<5 then char_anim("p1","idle") end else char_anim("p1","idle") end if p2_action=="atk" then char_anim("p2","atk") elseif p2_action=="blk" then char_anim("p2","blk") elseif p2_action=="grb" then char_anim("p2","grb") elseif p2_action=="pow" then if p2_pow>=5 and p2_pow<7 then char_anim("p2","pow1") elseif p2_pow>=7 then char_anim("p2","pow2") elseif p2_pow<5 then char_anim("p2","idle") end else char_anim("p2","idle") end end function get_action(p) if mode=="arcade" then ai_timer= ai_timer+1 if ai_timer>=120 then random_action=math.random(1,4) p2_action=ai_set.move[random_action] ai_timer=0 end end if mode=="arcade" or mode=="versus" then if p=="p1" then if btnp(4) then --print("p1 ATK!",96,96,12) p1_action="atk" return "atk" elseif btnp(5) then --print("p1 BLK!",96,96,12) p1_action="blk" return "blk" elseif btnp(6) then --print("p1 GRB!",96,96,12) p1_action="grb" return "grb" elseif btnp(7) then --print("p1 POW!",96,96,12) p1_action="pow" return "pow" end end end if mode=="versus" then if p=="p2" then if btnp(12) then --print("p2 ATK!",96,104,12) p2_action="atk" return "atk" elseif btnp(13) then --print("p2 BLK!",96,104,12) p2_action="blk" return "blk" elseif btnp(14) then --print("p2 GRB!",96,104,12) p2_action="grb" return "grb" elseif btnp(15) then --print("p2 POW!",96,104,12) p2_action="pow" return "pow" end end end return nil end function char_anim(p,sp) if p=="p1" then if sp=="atk" then drw_spr(characters[p1_select].atk1,96/SCALE-10,64/SCALE,0) drw_spr(characters[p1_select].atk2,104/SCALE-6,64/SCALE,0) drw_spr(characters[p1_select].atk3,96/SCALE-10,72/SCALE+4,0) drw_spr(characters[p1_select].atk4,104/SCALE-6,72/SCALE+4,0) elseif sp=="blk" then drw_spr(characters[p1_select].blk1,96/SCALE-10,64/SCALE,0) drw_spr(characters[p1_select].blk2,104/SCALE-6,64/SCALE,0) drw_spr(characters[p1_select].blk3,96/SCALE-10,72/SCALE+4,0) drw_spr(characters[p1_select].blk4,104/SCALE-6,72/SCALE+4,0) elseif sp=="grb" then drw_spr(characters[p1_select].hrt1,96/SCALE-10,64/SCALE,0) drw_spr(characters[p1_select].hrt2,104/SCALE-6,64/SCALE,0) drw_spr(characters[p1_select].hrt3,96/SCALE-10,72/SCALE+4,0) drw_spr(characters[p1_select].hrt4,104/SCALE-6,72/SCALE+4,0) elseif sp=="pow1" then drw_spr(characters[p1_select].pow1f1,96/SCALE-10,64/SCALE,0) drw_spr(characters[p1_select].pow2f1,104/SCALE-6,64/SCALE,0) drw_spr(characters[p1_select].pow3f1,96/SCALE-10,72/SCALE+4,0) drw_spr(characters[p1_select].pow4f1,104/SCALE-6,72/SCALE+4,0) elseif sp=="pow2" then drw_spr(characters[p1_select].pow1f2,96/SCALE-10,64/SCALE,0) drw_spr(characters[p1_select].pow2f2,104/SCALE-6,64/SCALE,0) drw_spr(characters[p1_select].pow3f2,96/SCALE-10,72/SCALE+4,0) drw_spr(characters[p1_select].pow4f2,104/SCALE-6,72/SCALE+4,0) elseif sp=="idle" then drw_spr(characters[p1_select].idle1,96/SCALE-10,64/SCALE,0) drw_spr(characters[p1_select].idle2,104/SCALE-6,64/SCALE,0) drw_spr(characters[p1_select].idle3,96/SCALE-10,72/SCALE+4,0) drw_spr(characters[p1_select].idle4,104/SCALE-6,72/SCALE+4,0) end elseif p=="p2" then if sp=="atk" then drw_spr(characters[p2_select].atk1,136/SCALE+4,64/SCALE,0,1,1) drw_spr(characters[p2_select].atk2,128/SCALE,64/SCALE,0,1,1) drw_spr(characters[p2_select].atk3,136/SCALE+4,72/SCALE+4,0,1,1) drw_spr(characters[p2_select].atk4,128/SCALE,72/SCALE+4,0,1,1) elseif sp=="blk" then drw_spr(characters[p2_select].blk1,136/SCALE+4,64/SCALE,0,1,1) drw_spr(characters[p2_select].blk2,128/SCALE,64/SCALE,0,1,1) drw_spr(characters[p2_select].blk3,136/SCALE+4,72/SCALE+4,0,1,1) drw_spr(characters[p2_select].blk4,128/SCALE,72/SCALE+4,0,1,1) elseif sp=="grb" then drw_spr(characters[p2_select].hrt1,136/SCALE+4,64/SCALE,0,1,1) drw_spr(characters[p2_select].hrt2,128/SCALE,64/SCALE,0,1,1) drw_spr(characters[p2_select].hrt3,136/SCALE+4,72/SCALE+4,0,1,1) drw_spr(characters[p2_select].hrt4,128/SCALE,72/SCALE+4,0,1,1) elseif sp=="pow1" then drw_spr(characters[p2_select].pow1f1,136/SCALE+4,64/SCALE,0,1,1) drw_spr(characters[p2_select].pow2f1,128/SCALE,64/SCALE,0,1,1) drw_spr(characters[p2_select].pow3f1,136/SCALE+4,72/SCALE+4,0,1,1) drw_spr(characters[p2_select].pow4f1,128/SCALE,72/SCALE+4,0,1,1) elseif sp=="pow2" then drw_spr(characters[p2_select].pow1f2,136/SCALE+4,64/SCALE,0,1,1) drw_spr(characters[p2_select].pow2f2,128/SCALE,64/SCALE,0,1,1) drw_spr(characters[p2_select].pow3f2,136/SCALE+4,72/SCALE+4,0,1,1) drw_spr(characters[p2_select].pow4f2,128/SCALE,72/SCALE+4,0,1,1) elseif sp=="idle" then drw_spr(characters[p2_select].idle1,136/SCALE+4,64/SCALE,0,1,1) drw_spr(characters[p2_select].idle2,128/SCALE,64/SCALE,0,1,1) drw_spr(characters[p2_select].idle3,136/SCALE+4,72/SCALE+4,0,1,1) drw_spr(characters[p2_select].idle4,128/SCALE,72/SCALE+4,0,1,1) end end end function reset_round() current_time=ROUND_TIME pre_round_timer=PRE_ROUND_TIME pre_round_msg="ready" post_round_timer=POST_ROUND_TIME ai_timer=0 p1_life=8 p1_hit=0 p2_life=8 p2_hit=0 p1_action=nil p2_action=nil state="pre_round" end function drw_menu() cls() drw_map(180,0,30,17,-61,-30) drw_text("Game Mode",94/SCALE-13,40/SCALE-8,0) drw_text("Game Mode",94/SCALE-13,39/SCALE-8,4) drw_text("Arcade",108/SCALE-10,56/SCALE,1) drw_text("Versus",108/SCALE-10,68/SCALE+4,1) --drw_text("Learn",108/SCALE-10,80/SCALE+8,1) print("v0.16",108/SCALE+4,124,12) if mode=="arcade" then drw_text("Arcade",108/SCALE-10,56/SCALE,0) drw_text("Arcade",108/SCALE-10,55/SCALE,12) drw_spr(150,96/SCALE-15,54/SCALE,0) elseif mode=="versus" then drw_text("Versus",108/SCALE-10,68/SCALE+4,0) drw_text("Versus",108/SCALE-10,67/SCALE+4,12) drw_spr(148,96/SCALE-15,66/SCALE+4,0) elseif mode=="learn" then drw_text("Learn",108/SCALE-10,80/SCALE+8,0) drw_text("Learn",108/SCALE-10,79/SCALE+8,12) drw_spr(196,96/SCALE-15,78/SCALE+8,0) end end function drw_learn() --cls(1) drw_map(150,0,30,17,-61,-30) drw_text("Ya-Ken-Po",96/SCALE,37/SCALE,0) drw_text("Ya-Ken-Po",96/SCALE,36/SCALE,5) -- Draw the sprite icons -- Grab drw_text("grb",131/SCALE,72/SCALE,10) -- Block drw_text("blk",111/SCALE,88/SCALE,10) -- Attack drw_text("atk",93/SCALE,72/SCALE,10) -- POW drw_text("pow",111/SCALE,56/SCALE,10) if btnp(4) or btnp(5) then scn="menu" end end function drw_credits() -- Credits Screen here drw_map(210,17,30,17,-61,-30) drw_text("Credits",100/SCALE,36/SCALE,0,0) -- Go Back to Menu if btnp(4) or btnp(5) then scn="menu" end end function drw_character_select() cls() -- Draw the Background drw_map(30,17,30,17,-61,-30) -- Show P1 Selection drw_text(characters[p1_select].name,90/SCALE-15,33/SCALE-13,12,false,1,true) drw_spr(characters[p1_select].idle1,96/SCALE-13,40/SCALE-10,0) drw_spr(characters[p1_select].idle2,104/SCALE-9,40/SCALE-10,0) drw_spr(characters[p1_select].idle3,96/SCALE-13,48/SCALE-6,0) drw_spr(characters[p1_select].idle4,104/SCALE-9,48/SCALE-6,0) -- Show P2 Selection drw_text(characters[p2_select].name,104/SCALE-9,89/SCALE+15,12,true,1,true) drw_spr(characters[p2_select].idle1,136/SCALE+7,72/SCALE+6,0,1,1) drw_spr(characters[p2_select].idle2,128/SCALE+3,72/SCALE+6,0,1,1) drw_spr(characters[p2_select].idle3,136/SCALE+7,80/SCALE+10,0,1,1) drw_spr(characters[p2_select].idle4,128/SCALE+3,80/SCALE+10,0,1,1) -- Change to Confirmed for both Players! if p1_confirm then --print("P1 Confirmed",10,100,11) drw_spr(64,34,9,0) drw_spr(65,44,9,0) drw_spr(80,34,19,0) drw_spr(81,44,19,0) end if p2_confirm then --print("P2 Confirmed",10,110,11) drw_spr(64,66,41,0) drw_spr(65,76,41,0) drw_spr(80,66,51,0) drw_spr(81,76,51,0) end -- Are you ready? if p1_confirm and p2_confirm then for i=0, 135, 2 do for o=0, 239, 2 do pix(o,i,0) end end -- Brand rect(54,50,128,38,0) rect(54,52,128,34,12) rect(54,54,128,30,1) -- Letters drw_spr(1,30,30,0) drw_spr(2,41,30,0) drw_spr(3,52,30,0) drw_spr(4,63,30,0) drw_spr(5,74,30,0) drw_spr(21,82,30,0) end end function drw_stage_select() cls() -- Draw the Background drw_map(60,17,30,17,-61,-30) -- Draw the Stage drw_spr(stages[stage_select].sp1,96/SCALE-9,48/SCALE-6,0,SCALE) drw_spr(stages[stage_select].sp2,112/SCALE-1,48/SCALE-6,0,SCALE) drw_spr(stages[stage_select].sp3,128/SCALE-1,48/SCALE-6,0,SCALE) drw_text(stages[stage_select].name,90/SCALE-10,76/SCALE+6,4,false,1,true) drw_text(stages[stage_select].desc,90/SCALE-10,84/SCALE+10,12,false,1,true) end function drw_combo(p,hit) --print(p1_hit,8,8,12) --print(p2_hit,8,16,3) if p=="p1" then if hit==1 then rect(54,45,36,10,9) drw_text("Hit!",92/SCALE-16,54/SCALE-5,0,false,1,true) drw_text("Hit!",92/SCALE-16,53/SCALE-5,12,false,1,true) elseif hit==2 then rect(54,45,36,10,9) drw_text("2 Hit",92/SCALE-17,54/SCALE-5,0,false,1,true) drw_text("2 Hit",92/SCALE-17,53/SCALE-5,12,false,1,true) elseif hit==3 then rect(54,45,36,10,9) drw_text("3 Hit",92/SCALE-17,54/SCALE-5,0,false,1,true) drw_text("3 Hit",92/SCALE-17,53/SCALE-5,12,false,1,true) elseif hit==4 then rect(54,45,36,10,9) drw_text("4 Hit",92/SCALE-17,54/SCALE-5,0,false,1,true) drw_text("4 Hit",92/SCALE-17,53/SCALE-5,12,false,1,true) elseif hit>=5 then rect(54,45,36,10,9) drw_text("MAX",92/SCALE-16,54/SCALE-5,0,false,1,true) drw_text("MAX",92/SCALE-16,53/SCALE-5,12,false,1,true) end elseif p=="p2" then if hit==1 then rect(146,45,36,10,9) drw_text("Hit!",134/SCALE+10,54/SCALE-5,0,false,1,true) drw_text("Hit!",134/SCALE+10,53/SCALE-5,12,false,1,true) elseif hit==2 then rect(146,45,36,10,9) drw_text("2 Hit",134/SCALE+7,54/SCALE-5,0,false,1,true) drw_text("2 Hit",134/SCALE+7,53/SCALE-5,12,false,1,true) elseif hit==3 then rect(146,45,36,10,9) drw_text("3 Hit",134/SCALE+7,54/SCALE-5,0,false,1,true) drw_text("3 Hit",134/SCALE+7,53/SCALE-5,12,false,1,true) elseif hit==4 then rect(146,45,36,10,9) drw_text("4 Hit",134/SCALE+7,54/SCALE-5,0,false,1,true) drw_text("4 Hit",134/SCALE+7,53/SCALE-5,12,false,1,true) elseif hit>=5 then rect(146,45,36,10,9) drw_text("MAX",134/SCALE+10,54/SCALE-5,0,false,1,true) drw_text("MAX",134/SCALE+10,53/SCALE-5,12,false,1,true) end end end function drw_lifebar(p, p_life) if p=="p1" then --print(p1_life,32,32,12) if p_life<=0 then drw_spr(42,88/SCALE-17,32/SCALE-14,0)--Empty Bar drw_spr(43,96/SCALE-13,32/SCALE-14,0) drw_spr(43,104/SCALE-9,32/SCALE-14,0) drw_spr(44,112/SCALE-5,32/SCALE-14,0) elseif p_life==1 then drw_spr(26,88/SCALE-17,32/SCALE-14,0)--1HP drw_spr(43,96/SCALE-13,32/SCALE-14,0) drw_spr(43,104/SCALE-9,32/SCALE-14,0) drw_spr(44,112/SCALE-5,32/SCALE-14,0) elseif p_life==2 then drw_spr(10,88/SCALE-17,32/SCALE-14,0)--2HP drw_spr(43,96/SCALE-13,32/SCALE-14,0) drw_spr(43,104/SCALE-9,32/SCALE-14,0) drw_spr(44,112/SCALE-5,32/SCALE-14,0) elseif p_life==3 then drw_spr(10,88/SCALE-17,32/SCALE-14,0)--3HP drw_spr(27,96/SCALE-13,32/SCALE-14,0) drw_spr(43,104/SCALE-9,32/SCALE-14,0) drw_spr(44,112/SCALE-5,32/SCALE-14,0) elseif p_life==4 then drw_spr(10,88/SCALE-17,32/SCALE-14,0)--4HP drw_spr(11,96/SCALE-13,32/SCALE-14,0) drw_spr(43,104/SCALE-9,32/SCALE-14,0) drw_spr(44,112/SCALE-5,32/SCALE-14,0) elseif p_life==5 then drw_spr(10,88/SCALE-17,32/SCALE-14,0)--5HP drw_spr(11,96/SCALE-13,32/SCALE-14,0) drw_spr(27,104/SCALE-9,32/SCALE-14,0) drw_spr(44,112/SCALE-5,32/SCALE-14,0) elseif p_life==6 then drw_spr(10,88/SCALE-17,32/SCALE-14,0)--6HP drw_spr(11,96/SCALE-13,32/SCALE-14,0) drw_spr(11,104/SCALE-9,32/SCALE-14,0) drw_spr(44,112/SCALE-5,32/SCALE-14,0) elseif p_life==7 then drw_spr(10,88/SCALE-17,32/SCALE-14,0)--7HP drw_spr(11,96/SCALE-13,32/SCALE-14,0) drw_spr(11,104/SCALE-9,32/SCALE-14,0) drw_spr(28,112/SCALE-5,32/SCALE-14,0) elseif p_life==8 then drw_spr(10,88/SCALE-17,32/SCALE-14,0)--8HP drw_spr(11,96/SCALE-13,32/SCALE-14,0) drw_spr(11,104/SCALE-9,32/SCALE-14,0) drw_spr(12,112/SCALE-5,32/SCALE-14,0) end elseif p=="p2" then if p_life<=0 then drw_spr(45,120/SCALE-1,32/SCALE-14,0)--Empty Bar drw_spr(46,128/SCALE+3,32/SCALE-14,0) drw_spr(46,136/SCALE+7,32/SCALE-14,0) drw_spr(47,144/SCALE+11,32/SCALE-14,0) elseif p_life==1 then drw_spr(45,120/SCALE-1,32/SCALE-14,0)--1HP drw_spr(46,128/SCALE+3,32/SCALE-14,0) drw_spr(46,136/SCALE+7,32/SCALE-14,0) drw_spr(31,144/SCALE+11,32/SCALE-14,0) elseif p_life==2 then drw_spr(45,120/SCALE-1,32/SCALE-14,0)--2HP drw_spr(46,128/SCALE+3,32/SCALE-14,0) drw_spr(46,136/SCALE+7,32/SCALE-14,0) drw_spr(15,144/SCALE+11,32/SCALE-14,0) elseif p_life==3 then drw_spr(45,120/SCALE-1,32/SCALE-14,0)--3HP drw_spr(46,128/SCALE+3,32/SCALE-14,0) drw_spr(30,136/SCALE+7,32/SCALE-14,0) drw_spr(15,144/SCALE+11,32/SCALE-14,0) elseif p_life==4 then drw_spr(45,120/SCALE-1,32/SCALE-14,0)--4HP drw_spr(46,128/SCALE+3,32/SCALE-14,0) drw_spr(14,136/SCALE+7,32/SCALE-14,0) drw_spr(15,144/SCALE+11,32/SCALE-14,0) elseif p_life==5 then drw_spr(45,120/SCALE-1,32/SCALE-14,0)--5HP drw_spr(30,128/SCALE+3,32/SCALE-14,0) drw_spr(14,136/SCALE+7,32/SCALE-14,0) drw_spr(15,144/SCALE+11,32/SCALE-14,0) elseif p_life==6 then drw_spr(45,120/SCALE-1,32/SCALE-14,0)--6HP drw_spr(14,128/SCALE+3,32/SCALE-14,0) drw_spr(14,136/SCALE+7,32/SCALE-14,0) drw_spr(15,144/SCALE+11,32/SCALE-14,0) elseif p_life==7 then drw_spr(29,120/SCALE-1,32/SCALE-14,0)--7HP drw_spr(14,128/SCALE+3,32/SCALE-14,0) drw_spr(14,136/SCALE+7,32/SCALE-14,0) drw_spr(15,144/SCALE+11,32/SCALE-14,0) elseif p_life==8 then drw_spr(13,120/SCALE-1,32/SCALE-14,0)--8HP drw_spr(14,128/SCALE+3,32/SCALE-14,0) drw_spr(14,136/SCALE+7,32/SCALE-14,0) drw_spr(15,144/SCALE+11,32/SCALE-14,0) end end end function drw_round() --P1 - Draw Round Win Count if p1_win==0 then drw_spr(62,88/SCALE-16,40/SCALE-10,0) drw_spr(62,96/SCALE-12,40/SCALE-10,0) drw_spr(62,104/SCALE-8,40/SCALE-10,0) elseif p1_win==1 then drw_spr(63,88/SCALE-16,40/SCALE-10,0) drw_spr(62,96/SCALE-12,40/SCALE-10,0) drw_spr(62,104/SCALE-8,40/SCALE-10,0) elseif p1_win==2 then drw_spr(63,88/SCALE-16,40/SCALE-10,0) drw_spr(63,96/SCALE-12,40/SCALE-10,0) drw_spr(62,104/SCALE-8,40/SCALE-10,0) elseif p1_win==3 then drw_spr(63,88/SCALE-16,40/SCALE-10,0) drw_spr(63,96/SCALE-12,40/SCALE-10,0) drw_spr(63,104/SCALE-8,40/SCALE-10,0) end --P2 - Draw Round Win Count if p2_win==0 then drw_spr(62,144/SCALE+10,40/SCALE-10,0) drw_spr(62,136/SCALE+6,40/SCALE-10,0) drw_spr(62,128/SCALE+2,40/SCALE-10,0) elseif p2_win==1 then drw_spr(63,144/SCALE+10,40/SCALE-10,0) drw_spr(62,136/SCALE+6,40/SCALE-10,0) drw_spr(62,128/SCALE+2,40/SCALE-10,0) elseif p2_win==2 then drw_spr(63,144/SCALE+10,40/SCALE-10,0) drw_spr(63,136/SCALE+6,40/SCALE-10,0) drw_spr(62,128/SCALE+2,40/SCALE-10,0) elseif p2_win==3 then drw_spr(63,144/SCALE+10,40/SCALE-10,0) drw_spr(63,136/SCALE+6,40/SCALE-10,0) drw_spr(63,128/SCALE+2,40/SCALE-10,0) end end function drw_combat() drw_map(stages[stage_select].loc,0,24,17,-61,-30)-- Draw the Scene... each 30cells(x) drw_text(math.floor(current_time/60),115/SCALE-4,42/SCALE-9,0)--Shadow Round Timer drw_text(math.floor(current_time/60),115/SCALE-4,41/SCALE-9,4)--Round Timer round() --Combat System --print(p1_action,32,8,12) --print(p2_action,32,16,12) local p1_action = get_action("p1") local p2_action = get_action("p2") -- Draw the States drw_lifebar("p1",p1_life) drw_lifebar("p2",p2_life) drw_combo("p1",p1_hit) drw_combo("p2",p2_hit) if combat_active then if combat_timer<=0 then combat_active=false end local bar_width=36 local bar_height=6 local bar_x=64 local bar_y=104 local progress=(CONFIRM_TIME - action_timer) / CONFIRM_TIME if progress>1 then progress=1 end rect(bar_x,bar_y,bar_width,bar_height,12) rect(bar_x+72,bar_y,bar_width,bar_height,12) -- rect(bar_x+1,bar_y+1,(bar_width-2)*progress,bar_height-2,3) rect(bar_x+74+(bar_width-2)*(1-progress),bar_y+1,(bar_width-2)*progress,bar_height-2,10) --rect(bar_x+40,bar_y+1,(bar_width-2)/progress,bar_height-2,6) -- circ(104,107,7,0) circ(132,107,7,0) GO_TIME=GO_TIME-1 if GO_TIME<=0 then GO_STATE= not GO_STATE GO_TIME=60 end --if GO_STATE then -- GO Time On! --drw_spr(150,112/SCALE-7,80/SCALE+10,0) --drw_spr(151,120/SCALE+1,80/SCALE+10,0) --else -- GO Time Off! --drw_spr(148,112/SCALE-7,80/SCALE+10,0) --drw_spr(149,120/SCALE+1,80/SCALE+10,0) --end end end function drw_rps() if state=="round" then -- Draw RPS Icons based on Players actions -- Player 1 Actions if p1_action=="atk" then drw_spr(34,111/SCALE-7,80/SCALE+10,0) elseif p1_action=="blk" then drw_spr(35,110/SCALE-7,80/SCALE+10,0) elseif p1_action=="grb" then drw_spr(36,110/SCALE-7,80/SCALE+10,0) elseif p1_action=="pow" then drw_spr(37,111/SCALE-7,80/SCALE+10,0) end -- Player 2 Actions if p2_action=="atk" then drw_spr(34,120/SCALE+3,80/SCALE+10,0,1,1) elseif p2_action=="blk" then drw_spr(35,120/SCALE+2,80/SCALE+10,0,1,1) elseif p2_action=="grb" then drw_spr(36,120/SCALE+2,80/SCALE+10,0,1,1) elseif p2_action=="pow" then drw_spr(37,120/SCALE+3,80/SCALE+10,0) end end end function round() drw_round() if match_winner then if match_winner=="Player 1" then p1_hit=0 p2_hit=0 drw_map(8,17,4,4,42,8) -- Win/Defeat Sprites drw_spr(characters[p1_select].vic1,96/SCALE-8,64/SCALE,0) drw_spr(characters[p1_select].vic2,104/SCALE-4,64/SCALE,0) drw_spr(characters[p1_select].vic3,96/SCALE-8,72/SCALE+4,0) drw_spr(characters[p1_select].vic4,104/SCALE-4,72/SCALE+4,0) drw_spr(characters[p2_select].def1,136/SCALE+4,64/SCALE,0,1,1) drw_spr(characters[p2_select].def2,128/SCALE,64/SCALE,0,1,1) drw_spr(characters[p2_select].def3,136/SCALE+4,72/SCALE+4,0,1,1) drw_spr(characters[p2_select].def4,128/SCALE,72/SCALE+4,0,1,1) post_round_timer=post_round_timer-0.3 if post_round_timer<=0 then BOOT() end --if btnp(4) or btnp(12) then BOOT() end elseif match_winner=="Player 2" then p1_hit=0 p2_hit=0 drw_map(12,17,4,4,42,8) -- Win/Defeat Sprites drw_spr(characters[p2_select].vic1,136/SCALE+4,64/SCALE,0,1,1) drw_spr(characters[p2_select].vic2,128/SCALE,64/SCALE,0,1,1) drw_spr(characters[p2_select].vic3,136/SCALE+4,72/SCALE+4,0,1,1) drw_spr(characters[p2_select].vic4,128/SCALE,72/SCALE+4,0,1,1) drw_spr(characters[p1_select].def1,96/SCALE-8,64/SCALE,0) drw_spr(characters[p1_select].def2,104/SCALE-4,64/SCALE,0) drw_spr(characters[p1_select].def3,96/SCALE-8,72/SCALE+4,0) drw_spr(characters[p1_select].def4,104/SCALE-4,72/SCALE+4,0) --if btnp(4) or btnp(12) then BOOT() end post_round_timer=post_round_timer-0.3 if post_round_timer<=0 then BOOT()end end return end if state=="pre_round" then update_pre_round() -- Display Fight Message on screen if pre_round_msg=="ready" then drw_map(0,17,4,4,43,20,0)-- Ready or Not Msg elseif pre_round_msg=="rumble" then drw_map(4,17,4,4,43,20,0)-- Let's Rumble Msg end --Debug Prints --print(pre_round_msg,10,70,12) --print(match_winner .. " wins the match!",10,60,12) --print(state,8,24,12) elseif state=="round" then combat_active=true update_round() --print(action_timer,114,16,5) action_timer=action_timer-1 combat_timer=combat_timer-1 if action_timer<=0 then --print("(...CHECKING...)",8,116,12) check_action(p1_action, p2_action) p1_action=nil p2_action=nil action_timer=60 end check_pow() check_anim() --Debug Prints --print("Time: " .. math.floor(current_time/60),10,70,12) elseif state=="round_over" then if p1_life>p2_life then p1_win=p1_win+1 --round_winner="p1" elseif p2_life>p1_life then p2_win=p2_win+1 --round_winner="p2" end check_winner() round_number=round_number+1 state="post_round" elseif state=="post_round" then update_post_round() p1_hit=0 p2_hit=0 drw_text("ROUND "..round_number,100/SCALE-11,64/SCALE,0) drw_text("ROUND "..round_number,100/SCALE-11,63/SCALE,12) end --Debug Prints -- Draw Info of the Round and Match --print("Round: " .. round_number,10,80,12) --print("P1 Wins: " .. p1_win,10,90,12) --print("P2 Wins: " .. p2_win,10,100,12) end function BOOT() -- Call just once. cls() scn="disclaimer" -- Load Game Data data_characters() data_stages() data_music() -- Set Game Mode mode="arcade" -- Timers t=0 ts=0 mt=0 ai_timer=0 -- Logo Vars logo_frames={0,4,8,12,64,68,72,76} tpf=6 -- Set Character Select vars p1_bank=0 p2_bank=0 p1_select=1 p2_select=1 p1_confirm=false p2_confirm=false stage_select=1 stage_confirm=false -- Round Parameters -- Configuration ROUND_TIME = 30*60 -- 30 seconds in frames PRE_ROUND_TIME = 3*60 -- 3 seconds in frames PRE_ROUND_MSG_TIME = 1.75*60 -- 2 seconds in frames LETS_RUMBLE_TIME = 0.85*60 -- 1 seconds in frames POST_ROUND_TIME=3*60 post_round_timer=POST_ROUND_TIME CONFIRM_TIME=60 confirm_timer=0 combat_timer=0 combat_active=false GO_TIME=60 GO_STATE=false -- State Variables current_bank=0 current_time=ROUND_TIME pre_round_timer=PRE_ROUND_TIME round_number=1 action_timer=60 --Interval time to do an action. p1_life=8 p1_pow=0 p1_win=0 p1_hit=0 p2_life=8 p2_pow=0 p2_win=0 p2_hit=0 match_winner=nil state="pre_round" pre_round_msg="ready" end function MENU(i) -- Menu function to call other func. GameMenu[i+1]() end function TIC() -- Call 60 times per second. cls() if scn=="disclaimer" then ts=ts+1/4 drw_disclaimer() elseif scn=="logo" then -- dallo logo showcase sync(1,1,false) local idx=math.floor(t/tpf)%(#logo_frames)+1 local spr_id=logo_frames[idx] if t<90 then spr(spr_id,86,32,0,2,0,0,4,4) else spr(0,86,32,0,2,0,0,4,4) end if t>220 then scn="title" t=0 end t=t+1 elseif scn=="title" then sync(1,0,false) -- Title/Splash Screen drw_map(210,0,30,17,-61,-30) if btnp(1) or btnp(4) then scn="menu" end elseif scn=="menu" then -- Select Game Mode drw_menu() mode_pick() elseif scn=="character_select" then -- Select a Character update_character_select() drw_character_select() elseif scn=="stage_select" then -- Select a Stage level update_stage_select() drw_stage_select() elseif scn=="quick" then -- Combat drw_combat() -- RPS Icons drw_rps() elseif scn=="learn" then -- Tutorial / Controls drw_learn() elseif scn=="credits" then -- Credits Screen drw_credits() end end