Hey there blazers!
Today I want to share another experiment. is a dice survival game in which you have to avoid zombies and pick food to survive.
how to play?
- Select how strong you are going to throw the dice
- insert the snippet, and see if you survive, or die
- copy the inserted code to continue playing
- use the snippet again and paste the code on the top left corner.
{note: preview=yes; insert=no}{lose=0}{level=1}{loadfood=9}{loadscore=0}{loadroom=1}Load code here : {formtext: name=loadcode; default=no save}{endnote}
{note: preview=no; insert=no}
{if: loadcode = "no save"} {else}
{codeLoaded=base64decode(loadcode)}
{scorecode=codeLoaded}{levelcode=codeLoaded}{roomcode=codeLoaded}{foodcode=codeLoaded}
{splitcodeIniA=search(scorecode,"Γ±A")}{preloadscore=substring(scorecode, splitcodeIniA+2, 3)}
{splitcodeIniB=search(levelcode,"Γ±B")}{level=substring(levelcode, splitcodeIniB+2, 1)}
{splitcodeIniC=search(roomcode,"Γ±C")}{loadroom=substring(roomcode, splitcodeIniC+2, 1)}
{splitcodeIniD=search(roomcode,"Γ±D")}{loadfood=substring(roomcode, splitcodeIniD+2, 1)}
{loadscore=preloadscore+ 0}
{endif}
--Escenario
{space1={random-text: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,}}
{space2={random-text: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,}}
{space3={random-text: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,}}
{space4={random-text: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,}}
{space5={random-text: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,}}
{space6={random-text: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,}}
{dice={random-number: min=1; max=6; rounded=yes}}
--Mines
{mine1=0}{mine2=0}{mine3=0}{mine4=0}{mine5=0}{mine6=0}
{mine1={random-number: min=1; max=6; rounded=yes}}{if: level>1} {mine2={random-number: min=1; max=6; rounded=yes}} {endif}{if: level>2} {mine3={random-number: min=1; max=6; rounded=yes}}{endif} {if: level>3} {mine4={random-number: min=1; max=6; rounded=yes}}{endif} {if: level>4} {mine5={random-number: min=1; max=6; rounded=yes}}{endif} {if: level>5} {mine6={random-number: min=1; max=6; rounded=yes}}{endif}
{foodcan=0}{foodcan={random-number: min=1; max=6; rounded=yes}}
{if: mine1=1 or mine2=1 or mine3=1 or mine4=1 or mine5=1 or mine6=1}{space1=""}{endif}
{if: mine1=2 or mine2=2 or mine3=2 or mine4=2 or mine5=2 or mine6=2}{space2=""}{endif}
{if: mine1=3 or mine2=3 or mine3=3 or mine4=3 or mine5=3 or mine6=3}{space3=""}{endif}
{if: mine1=4 or mine2=4 or mine3=4 or mine4=4 or mine5=4 or mine6=4}{space4=""}{endif}
{if: mine1=5 or mine2=5 or mine3=5 or mine4=5 or mine5=5 or mine6=5}{space5=""}{endif}
{if: mine1=6 or mine2=6 or mine3=6 or mine4=6 or mine5=6 or mine6=6}{space6=""}{endif}
{if: foodcan=1}{space1=""}{endif}
{if: foodcan=2}{space2=""}{endif}
{if: foodcan=3}{space3=""}{endif}
{if: foodcan=4}{space4=""}{endif}
{if: foodcan=5}{space5=""}{endif}
{if: foodcan=6}{space6=""}{endif}
{endnote}
{note: preview=yes; insert=no}
ZOMBIE CITY
Drop the dice, keep energy by getting food, avoid zombies.
SCORE: {=loadscore} ENERGY {=loadfood}/9{if: loadfood < 3}{endif} STREET: {=loadroom} LEVEL: {=level}
YOU ARE HERE {=space1} {=space2} {=space3} {=space4} {=space5} {=space6}
Throw the dice with {formmenu: default=:game_die: weak; normal; strong; name=selection} force!
{dicerepeat=6}{if: selection=" weak" }{dicerepeat={random-number: min=1; max=2; rounded=yes}}{elseif: selection=" normal"} {dicerepeat={random-number: min=3; max=4; rounded=yes}} {elseif: selection=" strong" and dice < 5 }{dicerepeat={random-number: min=5; max=6; rounded=yes}}{endif}
{endnote}
{note: preview=no; insert=yes}
throwing dice with {if: selection=" weak" }weak{elseif: selection=" normal" }normal{else}strong{endif} force:
{repeat: dicerepeat-1}
: {random-text: β, β, β, β, β, β
} {wait: delay=+0.3s}.
{endrepeat}
:{wait: delay=+0.2s}{if: dice > 2 and selection=" weak"} {dice={random-number: min=1; max=3; rounded=yes}} {endif}{if: dice > 4 and selection=" normal"} {dice={random-number: min=2; max=5; rounded=yes}} {endif}{if: dice < 5 and selection=" strong"} {dice={random-number: min=4; max=6; rounded=yes}} {endif}{if: dice = 1}β{endif}{if: dice = 2}β{endif}{if: dice = 3}β{endif}{if: dice = 4}β{endif}{if: dice = 5}β{endif}{if: dice = 6}β
{endif}
[{if: dice=1}{elseif: dice>1}{endif}{=space1}]{wait: delay=+0.3s} [{if: dice=2}{elseif: dice>2}{endif}{=space2}]{wait: delay=+0.3s} [{if: dice=3}{elseif: dice>3}{endif}{=space3}]{wait: delay=+0.3s} [{if: dice=4}{elseif: dice>4}{endif}{=space4}]{wait: delay=+0.3s} [{if: dice=5}{elseif: dice>5}{endif}{=space5}]{wait: delay=+0.3s} [{if: dice=6}{elseif: dice>6}{endif}{=space6}]
{newfood=loadfood-1}{if: dice=1 and space1=""}{lose=1}{endif}{if: dice=2 and space2=""}{lose=1}{endif}{if: dice=3 and space3=""}{lose=1}{endif}{if: dice=4 and space4=""}{lose=1}{endif}{if: dice=5 and space5=""}{lose=1}{endif}{if: dice=6 and space6=""}{lose=1}{endif}.
{if: loadfood < 1}{lose=1} YOU STARVE no energy remaining.{endif}
{if: lose=1}
GAME OVERβ:meat_on_bone:
Your final score: {=loadscore}
You traveled: {=loadroom*level} streets{else}
{newscore=loadscore+dice}
{if: loadroom+1>9}{newroom=1}{newlevel=level+1}{else}{newroom=loadroom+1}{newlevel=level}{endif}
{random-text: WELLDONE!, NICE!, GOOD JOB!, SURVIVED!, DONE!, SAVED GAME!, AMAZING!, LEVEL CLEARED, SURVIVED NIGHT, SAFE HOUSE, ALL CLEAR} {random-text: , , , , , , }
ENERGY: -1β:canned_food:.
SCORE: +{=dice}{wait: delay=+0.3s}.
{if: level<newlevel} New level unlock!: {wait: delay=+0.3s} +1β:zombie:{endif}
{if: dice=1 and space1=""}{loadfood=9}You found some food!{endif}{if: dice=2 and space2=""}{loadfood=9}You found some food!{endif}{if: dice=3 and space3=""}{loadfood=9}You found some food!{endif}{if: dice=4 and space4=""}{loadfood=9}You found some food!{endif}{if: dice=5 and space5=""}{loadfood=9}You found some food!{endif}{if: dice=6 and space6=""}{loadfood=9}You found some food!{endif}
{fixedscore=substring(concat("000", newscore), -3, 3)}{savehash=concat("Γ±A", fixedscore, "Γ±B", newlevel, "Γ±C", newroom,"Γ±D", newfood)}{savecode=base64encode(savehash)}
Code: {cursor}{=savecode}{endif}{endnote}