Mini-Game: 🧟 Zombie City

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.

image

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 :floppy_disk:: {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: :house:, :house_with_garden:, :office:, :post_office:, :european_post_office:, :hospital:, :bank:, :hotel:, :love_hotel:, :convenience_store:, :school:, :department_store:, :factory:, :church:, :mosque:, :synagogue:, :stadium:, :classical_building:, :building_construction:, :houses:, :derelict_house:, :stadium:, :bank:, :convenience_store:, :hotel:, :european_post_office:, :post_office:, :office:, :house_with_garden:, :house:, :european_castle:,:japanese_castle:,:factory:,:department_store:,:school:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree::evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree::evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:}}
{space2={random-text: :house:, :house_with_garden:, :office:, :post_office:, :european_post_office:, :hospital:, :bank:, :hotel:, :love_hotel:, :convenience_store:, :school:, :department_store:, :factory:, :church:, :mosque:, :synagogue:, :stadium:, :classical_building:, :building_construction:, :houses:, :derelict_house:, :stadium:, :bank:, :convenience_store:, :hotel:, :european_post_office:, :post_office:, :office:, :house_with_garden:, :house:, :european_castle:,:japanese_castle:,:factory:,:department_store:,:school:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree::evergreen_tree:,:deciduous_tree::evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:}}
{space3={random-text: :house:, :house_with_garden:, :office:, :post_office:, :european_post_office:, :hospital:, :bank:, :hotel:, :love_hotel:, :convenience_store:, :school:, :department_store:, :factory:, :church:, :mosque:, :synagogue:, :stadium:, :classical_building:, :building_construction:, :houses:, :derelict_house:, :stadium:, :bank:, :convenience_store:, :hotel:, :european_post_office:, :post_office:, :office:, :house_with_garden:, :house:, :european_castle:,:japanese_castle:,:factory:,:department_store:,:school:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree::evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:}}
{space4={random-text: :house:, :house_with_garden:, :office:, :post_office:, :european_post_office:, :hospital:, :bank:, :hotel:, :love_hotel:, :convenience_store:, :school:, :department_store:, :factory:, :church:, :mosque:, :synagogue:, :stadium:, :classical_building:, :building_construction:, :houses:, :derelict_house:, :stadium:, :bank:, :convenience_store:, :hotel:, :european_post_office:, :post_office:, :office:, :house_with_garden:, :house:, :european_castle:,:japanese_castle:,:factory:,:department_store:,:school:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree::evergreen_tree:,:deciduous_tree::evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:}}
{space5={random-text: :house:, :house_with_garden:, :office:, :post_office:, :european_post_office:, :hospital:, :bank:, :hotel:, :love_hotel:, :convenience_store:, :school:, :department_store:, :factory:, :church:, :mosque:, :synagogue:, :stadium:, :classical_building:, :building_construction:, :houses:, :derelict_house:, :stadium:, :bank:, :convenience_store:, :hotel:, :european_post_office:, :post_office:, :office:, :house_with_garden:, :house:, :european_castle:,:japanese_castle:,:factory:,:department_store:,:school:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree::evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:}}
{space6={random-text: :house:, :house_with_garden:, :office:, :post_office:, :european_post_office:, :hospital:, :bank:, :hotel:, :love_hotel:, :convenience_store:, :school:, :department_store:, :factory:, :church:, :mosque:, :synagogue:, :stadium:, :classical_building:, :building_construction:, :houses:, :derelict_house:, :stadium:, :bank:, :convenience_store:, :hotel:, :european_post_office:, :post_office:, :office:, :house_with_garden:, :house:, :european_castle:,:japanese_castle:,:factory:,:department_store:,:school:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree::evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:,:evergreen_tree:,:deciduous_tree:}}
{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=":zombie:"}{endif}
{if: mine1=2 or mine2=2 or mine3=2 or mine4=2 or mine5=2 or mine6=2}{space2=":zombie:"}{endif}
{if: mine1=3 or mine2=3 or mine3=3 or mine4=3 or mine5=3 or mine6=3}{space3=":zombie:"}{endif}
{if: mine1=4 or mine2=4 or mine3=4 or mine4=4 or mine5=4 or mine6=4}{space4=":zombie:"}{endif}
{if: mine1=5 or mine2=5 or mine3=5 or mine4=5 or mine5=5 or mine6=5}{space5=":zombie:"}{endif}
{if: mine1=6 or mine2=6 or mine3=6 or mine4=6 or mine5=6 or mine6=6}{space6=":zombie:"}{endif}

{if: foodcan=1}{space1=":canned_food:"}{endif}
{if: foodcan=2}{space2=":canned_food:"}{endif}
{if: foodcan=3}{space3=":canned_food:"}{endif}
{if: foodcan=4}{space4=":canned_food:"}{endif}
{if: foodcan=5}{space5=":canned_food:"}{endif}
{if: foodcan=6}{space6=":canned_food:"}{endif}

{endnote}
{note: preview=yes; insert=no}

:zombie::radioactive: ZOMBIE CITY :radioactive::zombie:

Drop the dice, keep energy by getting food, avoid zombies.

:star:SCORE: {=loadscore} :canned_food: ENERGY {=loadfood}/9{if: loadfood < 3}:warning:{endif} :house:STREET: {=loadroom} :trophy: LEVEL: {=level}

:construction::bearded_person:
YOU ARE HERE {=space1} {=space2} {=space3} {=space4} {=space5} {=space6}

:game_die: Throw the dice with {formmenu: default=:game_die::green_circle: weak; :game_die::orange_circle: normal; :game_die::red_circle: strong; name=selection} force!

{dicerepeat=6}{if: selection=":game_die::green_circle: weak" }{dicerepeat={random-number: min=1; max=2; rounded=yes}}{elseif: selection=":game_die::orange_circle: normal"} {dicerepeat={random-number: min=3; max=4; rounded=yes}} {elseif: selection=":game_die::red_circle: strong" and dice < 5 }{dicerepeat={random-number: min=5; max=6; rounded=yes}}{endif}

{endnote}
{note: preview=no; insert=yes}
:rightwards_hand::game_die: throwing dice with {if: selection=":game_die::green_circle: weak" }weak{elseif: selection=":game_die::orange_circle: normal" }normal{else}strong{endif} force:
{repeat: dicerepeat-1}
:game_die:: {random-text: βš€, ⚁, βš‚, βšƒ, βš„, βš…} {wait: delay=+0.3s}.
{endrepeat}
:game_die::{wait: delay=+0.2s}{if: dice > 2 and selection=":game_die::green_circle: weak"} {dice={random-number: min=1; max=3; rounded=yes}} {endif}{if: dice > 4 and selection=":game_die::orange_circle: normal"} {dice={random-number: min=2; max=5; rounded=yes}} {endif}{if: dice < 5 and selection=":game_die::red_circle: 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}:bearded_person:{elseif: dice>1}:arrow_right:{endif}{=space1}]{wait: delay=+0.3s} [{if: dice=2}:bearded_person:{elseif: dice>2}:arrow_right:{endif}{=space2}]{wait: delay=+0.3s} [{if: dice=3}:bearded_person:{elseif: dice>3}:arrow_right:{endif}{=space3}]{wait: delay=+0.3s} [{if: dice=4}:bearded_person:{elseif: dice>4}:arrow_right:{endif}{=space4}]{wait: delay=+0.3s} [{if: dice=5}:bearded_person:{elseif: dice>5}:arrow_right:{endif}{=space5}]{wait: delay=+0.3s} [{if: dice=6}:bearded_person:{elseif: dice>6}:arrow_right:{endif}{=space6}]

{newfood=loadfood-1}{if: dice=1 and space1=":zombie:"}{lose=1}{endif}{if: dice=2 and space2=":zombie:"}{lose=1}{endif}{if: dice=3 and space3=":zombie:"}{lose=1}{endif}{if: dice=4 and space4=":zombie:"}{lose=1}{endif}{if: dice=5 and space5=":zombie:"}{lose=1}{endif}{if: dice=6 and space6=":zombie:"}{lose=1}{endif}.

{if: loadfood < 1}{lose=1} YOU STARVE :nauseated_face: no energy remaining.{endif}
{if: lose=1}
:meat_on_bone::zombie: GAME OVER​:meat_on_bone::zombie:
:star:Your final score: {=loadscore}
:bearded_person: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: :radioactive:, :construction:, :school_satchel:, :hiking_boot:, :city_sunset:, :cityscape:, :police_car:}
:zap:ENERGY: -1​:canned_food:.
:star:SCORE: +{=dice}{wait: delay=+0.3s}.

{if: level<newlevel}:trophy: New level unlock!: {wait: delay=+0.3s} +1​:zombie:{endif}
{if: dice=1 and space1=":canned_food:"}{loadfood=9}:canned_food:You found some food!{endif}{if: dice=2 and space2=":canned_food:"}{loadfood=9}:canned_food:You found some food!{endif}{if: dice=3 and space3=":canned_food:"}{loadfood=9}:canned_food:You found some food!{endif}{if: dice=4 and space4=":canned_food:"}{loadfood=9}:canned_food:You found some food!{endif}{if: dice=5 and space5=":canned_food:"}{loadfood=9}:canned_food:You found some food!{endif}{if: dice=6 and space6=":canned_food:"}{loadfood=9}:canned_food: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)}
:floppy_disk: Code: {cursor}{=savecode}{endif}{endnote}

2 Likes