Ok i did C++ over 10 years ago but i just started getting into this, i'm trying to write a cafe type game, nothing spectacular but it will help me learn as i go along.
cls //Clearing The Screen
load bitmap "steel.bmp" //Loading Background
name$ = ""
INPUT "What is your name? ", name$
print "Hello " + name$
Print "Press Any Key To Continue "
wait key
cls //Clearing The Screen
load bitmap "steel.bmp" //Loading Background
Level#=1 //Players Starting Level set to 1
Exp#=0 //Players Starting Experience
NextExp#=500 //Players Next Level Experience
level$ = "Current Level " //Text String for current Status
Status$= "Press Key To Cook Pizza" //Text String
SET TEXT TO BOLD
CENTER TEXT 320, 0, " " + name$ + "'s Cafe"
SET TEXT TO NORMAL
print level$, Level# //Screen output Current Level
print Exp#; "/"; NextExp# //Screen output Experience
print Status$ //Screen output Current Status
DO
if Exp# > NextExp#
Exp# = NextExp#
NextExp# = NextExp# * 2
Level# = Level# + 1
endif
Status$ = "Press Key To Cook Pizza" //Text String for current Status
cls //Clearing The Screen
load bitmap "steel.bmp" //Loading Background
SET TEXT TO BOLD
CENTER TEXT 320, 0, " " + name$ + "'s Cafe"
SET TEXT TO NORMAL
print level$, Level# //Screen output Current Level
print Exp#; "/"; NextExp# //Screen output Experience
print Status$ //Screen output Current Status
wait key //Wait for the user to press a key
Status$ = "Please Wait Cooking Pizza..." //Text String for current Status
cls //Clearing The Screen
load bitmap "steel.bmp" //Loading Background
SET TEXT TO BOLD
CENTER TEXT 320, 0, " " + name$ + "'s Cafe"
SET TEXT TO NORMAL
print level$, Level# //Screen output Current Level
print Exp#; "/"; NextExp# //Screen output Experience
print Status$ //Screen output Current Status
sleep 3000 //Timer
Exp# = Exp# + 120 //Add 120 Experience
print "You gained 120 Exp!" //Gain 120 Experience
sleep 1000
LOOP
As you can see from my code i'm doing alot of clearing the screen and reloading the bmp so that i can update, it works fine but i know i am doing it wrong,
anyway i think i should be using functions, i'll post what i think i should be doing then if anyone can point me in the right direction i would be very greatful, BTW i ain't got buttons or graphics yet it's all text just while i learn the code.
Should i have Functions for each item in my cafe, Pizza Function and Chips function Tea function ETC. As each item has a cooking time and money value as well as EXP value, Then can i call the EXP function or update the EXP function when needed, are these called Global functions...?
Thanks for any help
FPS Creator Updated 116,Vista 32Bit UpTo Date, nVidea 8500 1Gig Graphics Card, 4 Gig DDR2 Ram, Intel Duel Core 3GHZ CPU