here is a code of a sketch of a game originally written by me in qb (qb64)...
the game is text only no graphics the player is homeless and must find a way to survive and find a home and a job or he/she dies on the street...
i apologizes on my bad english in the game...
Code: Select all
'$lang:"qb"
'_TITLE "HOMLESSNESS - A MIND SIMULATION V2.0"
SCREEN 0
DIM SHARED senario(1 TO 3) AS STRING, name$, status(1 TO 3) AS STRING, action(1 TO 5) AS STRING, ac$, d AS INTEGER, health AS INTEGER, dollars AS INTEGER
DIM SHARED home(1 TO 6) AS STRING, shelter(1 TO 6) AS STRING, money(1 TO 5) AS STRING, job(1 TO 3) AS STRING, result AS STRING, over AS INTEGER, drug(1 TO 4) AS STRING
RANDOMIZE TIMER
FOR i = 1 TO 3
READ r$
senario(i) = r$
NEXT i
FOR i = 1 TO 3
READ status(i)
NEXT i
FOR i = 1 TO 5
READ action(i)
NEXT i
FOR i = 1 TO 6
READ home(i)
NEXT i
FOR i = 1 TO 6
READ shelter(i)
NEXT i
FOR i = 1 TO 5
READ money(i)
NEXT i
FOR i = 1 TO 3
READ job(i)
NEXT i
FOR i = 1 TO 4
READ drug(i)
NEXT i
Sub cp (row, s$)
LOCATE row, (80 - LEN(s$)) / 2: PRINT s$
END SUB
FUNCTION GetKey$ (keysToCatch$)
DIM k$
DO
k$ = INKEY$
WHILE LEN(k$) = 0
k$ = INKEY$
'_LIMIT 60
WEND
LOOP UNTIL INSTR(keysToCatch$, k$)
GetKey$ = k$
END FUNCTION
SUB opening
CLS
cp 4, "HOMELESSNESS - SURVIVING THE STREETS"
cp 6, "A MIND SIMULATION GAME"
cp 8, "by ronblue77 (ron77)"
cp 10, "IMPORTENT NOTE:"
cp 11, "THIS GAME COMES TO BRING TO AWARENESS THE PROBLEM OF HOMLESSNESS"
cp 12, "I DO NOT MEAN TO MOCK OR INSULT ANYONE! PLEASE HELP PUT AN END TO HOMELESSNESS"
cp 16, "press ESC to quit or ENTER key to play"
k$ = GetKey$(CHR$(27) + CHR$(13))
IF k$ = CHR$(27) THEN
cp 19, "GOODBYE!": END
CLS
END IF
CLS
LOCATE 6, 14: INPUT "enter name: ", name$
'inputc 6, "enter name: "
PRINT name$ + senario(INT(RND * UBOUND(senario) + 1)): PRINT
PRINT "GOOD LUCK!"
SLEEP
END Sub
SUB main
CLS
cp 1, "press ESC to quit"
cp 2, "day: " + STR$(d) + " health (0-100%): " + STR$(health) + " money: " + STR$(dollars) + "$"
LOCATE 4, 10: PRINT status(INT(RND * UBOUND(status) + 1))
PRINT
FOR i = 1 TO 5
PRINT action(i): PRINT
NEXT i
second_choice:
ac$ = GetKey$("12345" + CHR$(27))
IF ac$ = CHR$(27) THEN over = -1: EXIT SUB
IF ac$ = "1" THEN
result = money(INT(RND * UBOUND(money) + 1))
PRINT result
IF result = money(4) THEN over = -1
IF result = money(1) OR result = money(2) OR result = money(3) THEN dollars = dollars + 20: health = health + 25
ELSEIF ac$ = "2" THEN
result = shelter(INT(RND * UBOUND(shelter) + 1))
PRINT result
IF result = shelter(4) THEN over = -1
ELSEIF ac$ = "3" THEN
result = home(INT(RND * UBOUND(home) + 1))
PRINT result
IF result = home(5) THEN over = -1
ELSEIF ac$ = "4" THEN
'result = job(INT(RND * UBOUND(job) + 1))
IF health > 20 THEN
result = job(INT(RND * UBOUND(job) + 1))
PRINT result
IF result = job(2) THEN over = -1
ELSE
PRINT "NOBODY WILL HIYER YOU UNTIL YOUR HEALTH GETS BETTER CHOOSE OTHE OPTION": ac$ = "": GOTO second_choice
END IF
ELSEIF ac$ = "5" THEN
IF dollars >= 20 THEN
health = health - 20
result = drug(INT(RND * UBOUND(drug) + 1))
PRINT result
IF result = drug(4) THEN over = -1
ELSE
PRINT "YOU DON'T HAVE ENOUGH MONEY CHOOSE OTHER OPTION": ac$ = "": GOTO second_choice
END IF
END IF
PRINT "press any key..."
SLEEP
PRINT
finish:
IF over = -1 THEN
IF health <= 0 OR result = drug(4) OR result = shelter(4) OR result = money(4) THEN
PRINT "YOU DIED ON THE STREETS - GAME OVER"
ELSE
PRINT "YOU SURVIVED THE STREETS - GAME OVER": PRINT
END IF
PRINT "YOU SURVIVED ON THE STREETS FOR: " + STR$(d) + " DAYS"
SLEEP (3)
EXIT SUB
ELSE
d = d + 1
dollars = dollars - 10
health = health - 10
IF health > 100 THEN health = 100
IF dollars < 0 THEN dollars = 0
IF health <= 0 THEN over = -1: GOTO finish
CLS
PRINT "press any key to continue to the nexy day"
SLEEP
CLS
END IF
END Sub
DO
d = 1
over = 0
health = 50
dollars = 20
opening
DO
main
LOOP UNTIL over = -1
PRINT "play again? y/n?:"
k2$ = GetKey$("yn")
IF LCASE$(k2$) = "n" THEN END
Loop
'senarios:
DATA " you are runaway teenager that run from home... you need to survive on the streets till you can find a home."
DATA " you are a middle age person who's wife filed for divorce and throwed you from your house... you live in your old car till you get a new place to live."
DATA " you are brock with no job and no family... you have been kick out of your home now you have to find a solution to your problem."
'status
DATA "it's morning rise and shine... you almost don't have any money and you are hungry"
DATA "it's noon you have been sitting and begging for change from passing people some have given you some money"
DATA "it's night you are tired and need to find a safe place to sleep"
'actions
DATA "press 1 to: go beg or look for food or money"
DATA "press 2 to: find help and/or shelter"
DATA "press 3 to: call from a street phone to a family member or a friend to ask for help"
DATA "press 4 to: try to find a job or work"
DATA "press 5 to: do drugs or drink alcohol to forget the pain suffering and loneliness"
'call home
DATA "you call your grandma and you both cry... she promises to try to get you some help... she sends you her love... you promise to keep in touch with her"
DATA "you call a friend and she gives you some money and lets you stay at her place for the night... you get to have a good shower some clean cloths and eat a good meal and your back on the streets again"
DATA "you call a number of a hot-line for aid to homeless persons... the come and pick you up give some food and shelter for the night you talk to a social worker and he gives you his number just in case you need it"
DATA "you call a relative but no one answers... you are left alone on the streets"
DATA "you call your family and they pick you up and let you stay for as long as you need... you are off the streets"
DATA "you call but there is no answer"
'help or shelter
DATA "you go to a shelter for homeless people... you are robed from you money by violent addicts... you succeed to run away from there and spend the rest of the night at a park crying"
DATA "you try to sleep at the park but you get arrested by a policeman... you spend few hours in jail where you are beaten by inmates... by morning you are on the street again"
DATA "you have enough money to rent a motel room for the night... you shower and wash you cloths and sleep in a warm bed and dream you have a home"
DATA "you sleep at the park on a bench where you freeze to death cause of the cold weather... you are now in heaven RIP"
DATA "you sleep on the street on a corner when you wake up you find a 20 dollar bill and a note that says 'may god help you this is the little i can do'"
DATA "you are arrested by the police and now instead surviving on the street you have to survive being in jail"
'beg for money
DATA "you sit for hours and people pass you by as if you are invisible then some kind lady comes and invite you to eat at a dinner on her expense... you talk with her for two hours and tell her your story... then she says 'bye'"
DATA "you sit at a corner and people give you coins and dollars you get enough money to go by for a few days"
DATA "you sit and some men offers you work for some money and a meal you accept... you go to his house and help him paint his house then he gives you 10 dollars and a home cocked meal"
DATA "no one gives you nothing! your hungry and you have no choice but to look for food in the garbage... you get sick... very sick and you die on the streets from food poison... RIP"
DATA "you sit all day for nothing nobody gives you anything"
'job
DATA "you try to find work but nobody is interested"
DATA "you find work as a dishwasher at a dinner after a week you can afford a place to call home. you are off the street!"
DATA "you find work but you are fired really quick"
'drugs and alcohol
DATA "you get drunk and stone from cheep alcohol and for a few hours you forget about all your problems"
DATA "you do cheep street drugs and you get sick and collapse on the street... you wake up at the hospital and when you are better you are out on the street again"
DATA "you get stones and passed out when you wake in the morning everything you had is gone - you gut mugged"
DATA "you do drugs and over dose and die on the streets RIP"