game - covid simulator

Discussions related to graphics (2D and 3D), animation and games programming
ron77
Posts: 6
Joined: Sun 11 Jul 2021, 09:58

game - covid simulator

Post by ron77 »

hello... i've coded a small text game simulator this is just a first prototype version. you play a health minister of a small country that needs to fight the covid pandemic - the game has two possible endings 1. you fail and the whole population is infected or you succeed to reduce the infected cases to zero...

i hope in these times of uncertainty this little game will give someone hope :|

Code: Select all

   10 mode 12
   20 dim public$(5), rules$(5), vaccine$(5), dates$(12)
   30 pop%% = 7800000 infected = 1 hardcase%% = 0 death%% = 0 status$ ="we are in a covid pandemic" policy$ = "" months% = 1 status2$ ="" v$ = "no vaccine in sight!"
   40 r$ = "?" pandemic% = 0 gameover% = 0
   50 proc_init
   60
   70 print "COVID SIMULATOR - GAME"
   80 print
   90 print "BY RON77"
  100 wait 500
  110 cls
  120 repeat
  130   cls
  140   if gameover% = -2 then proc_goodend : end
  150   if gameover% = -1 then proc_badend : end
  160   if int(infected) = 0 then gameover% = -2
  170   if pandemic% = -2 then
  180     infected *= 0.7
  190     hardcase%% = int(infected * 0.25)
  200     death%% = (hardcase%% / 100) * 67
  210   endif
  220   vaccination% = months% mod 14
  230   if vaccination% = 0 then
  240     pandemic% = -2
  250     v$ = vaccine$(3)
  260   endif
  270   vac% = months% mod 6
  280   if vac% = 0 then
  290     v$ = vaccine$(1)
  300     vac% = 6
  310   endif
  320   if int(infected) > 1000 then
  330     hardcase%% = int(infected / 1000) * 34
  340     death%% = (hardcase%% / 100) * 67
  350     pop%% -= death%%
  360   endif
  370
  380   if int(infected) >= pop%% then
  390     infected = pop%%
  400     pandemic% = -1
  410     gameover% = -1
  420   endif
  430   if int(infected) > 20000 then
  440     status2$ = rules$(2)
  450   endif
  460
  470   if hardcase%% > 20000 then
  480     status2$ = rules$(3)
  490   endif
  500
  510   print fn_dates(months%)
  520   print
  530   colour 1
  540   print status$ + " population: " + str$(pop%%) + " cases reported: "  + str$(int(infected)) + " hard cases reported: " + str$(hardcase%%) + " death cases: " + str$(death%%)
  550   print
  560   colour 3
  570   print status2$  + " " + v$ + " the rules to the public are: " + r$
  580   colour 7
  590   print
  600   print "you are the health minister and the covid pandemic has arraived to your contry"
  610   print
  620   print "select what action should be taken:"
  630   print
  640   print "prees key 1 for slight limitations on the public"
  650   print
  660   print "press key 2 for moderate limitation on the public"
  670   print
  680   print "press key 3 for extrime lockdowns and curfews"
  690   print
  700   k$ = get$
  710   if val(k$) < 1 or val(k$) > 3 then print "invalid input!"
  720   if k$ = "1" then proc_calculate_sl
  730   if k$ = "2" then proc_calculate_me
  740   if k$ = "3" then proc_calculate_ex
  750
  760
  770
  780   wait 500
  790   months% += 1
  800 until false
  810 end
  820
  830
  840
  850
  860
  870 data "january", "february", "merch", "april", "may", "june", "july", "august", "september", "october", "november", "december"
  880
  890 data "pyzer estimates vaccine for covid by december"
  900 data "pyzer succeeded in making a vaccine efficiency is 94%"
  910 data "general vaccination of the public is at full speed!"
  920 data "we are close to population immunity! yey!"
  930 data "new covid varient found that vaccine is helpless against infections and deaths are rising!!"
  940
  950 data "number of new cases are rising doctors recommend limitations on the public"
  960 data "mass cases of infections! we need lockdowns and curfews!"
  970 data "our critical health system is about to collaps!"
  980 data "number of infections are dropping fast. the public demands limitations be removed"
  990 data "limitations removed - back to normal days???"
 1000
 1010 data "the public doesn't care about this new virus - business as usual!"
 1020 data "there is a growing panic in the public about this covid thing!"
 1030 data "the public is angry about the ecomonic situation caused by the limitations"
 1040 data "mass demonstrations on the streets - the mob demands policy changes!"
 1050 data "the public thinks this pandemic is over - party time!"
 1060
 1070
 1080
 1090 def proc_calculate_ex
 1100 if pandemic% = 0 then
 1110   for i% = 1 to 15
 1120     infected *= 1.011
 1130   next
 1140 endif
 1150 rem if pandemic% = -2 then
 1160 rem for i% = 1 to 20
 1170 rem infected *= 0.1
 1180 rem next
 1190 rem endif
 1200 endproc
 1210
 1220
 1230 def proc_calculate_me
 1240 if pandemic% = 0 then
 1250   for i% = 1 to 15
 1260     infected *= 1.08
 1270   next
 1280 endif
 1290 rem if pandemic% = -2 then
 1300 rem for i% = 1 to 20
 1310 rem infected *= 0.45
 1320 rem next
 1330 rem endif
 1340 endproc
 1350
 1360 def proc_calculate_sl
 1370 if pandemic% = 0 then
 1380   for i% = 1 to 15
 1390     infected *= 1.19 : rem work on equetions with itay
 1400   next
 1410 endif
 1420 rem if pandemic% = -2 then
 1430 rem for i% = 1 to 20
 1440 rem infected *= 0.7
 1450 rem next
 1460 rem endif
 1470 endproc
 1480
 1490 def proc_init
 1500 for i% = 1 to 12
 1510   read dates$(i%)
 1520 next
 1530 for i% = 1 to 5
 1540   read vaccine$(i%)
 1550 next
 1560 for i% = 1 to 5
 1570   read rules$(i%)
 1580 next
 1590 for i% = 1 to 5
 1600   read public$(i%)
 1610 next
 1620 endproc
 1630
 1640 def fn_dates(n%)
 1650 m% = n% mod 12
 1660 if m% = 0 then
 1670   v$ = vaccine$(2)
 1680   m% = 12
 1690 endif
 1700 = dates$(m%) + ", " + str$(int((n% - 1) / 12) + 2020)
 1710
 1720 def proc_badend
 1730 cls
 1740 print
 1750 print
 1760 print "all contry population has been infected! you failed as health minister!"
 1770 print "GAME OVER!!!"
 1780 endproc
 1790
 1800 def proc_goodend
 1810 cls
 1820 print
 1830 print
 1840 print "you succeeded in protecting the public from the pandemic!"
 1850 print "number of infected cases has droped down to ZERO!"
 1860 print "congradulation! you won over the pandemic! game over!"
 1870 endproc
User avatar
hellomike
Posts: 192
Joined: Sat 09 Jun 2018, 09:47
Location: Amsterdam

Re: game - covid simulator

Post by hellomike »

Nice attempt. I however don't get feedback of what input I choose......
I tried keep pressing '3' and was successful. Everyone was healthy but of course completely unemployed and poor after >year curfew.... :lol:
johnno56
Posts: 15
Joined: Tue 13 Jul 2021, 20:15

Re: game - covid simulator

Post by johnno56 »

Oh no! Spoiler alert! Pressing "3" for each input wins? My gaming life is coming to an end. My keyboard will be SO disappointed. My mouse is applying for social security... Ron77. Is there anything you can do to stem the tide of this catastrophe? Oh great! Now my web-cam has gone on strike...