lemonade game

Blitz3D Forums/Blitz3D Beginners Area/lemonade game

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

hey hey i did some changes and it is much better check it out

;lemonade game
;made by Ashley griffiths

AppTitle"lemonade game"

Graphics 800,600,16

SeedRnd(MilliSecs())

;load some images
lemon=LoadImage("back.bmp")

;some variables
day = 1
money# = 20.00
price# = 0.00
;temp random
temp%= Rand(1,10)
;Weather random
Weather%= Rand(1,5)
;amounts
paper=0 : lemons=0 : sugar=0 : ice=0

;draw background

;setfont
Color 225,0,0
SetFont LoadFont("arial",30)

;introduction
Print"welcome to the lemonade game"
Print
Print"made by Ashley"
Print
Delay 500
Print"In the lemonade game you choose how to sell your lemondade game"
Print
Delay 5000
Print"the advantage is you don't have to spend a penny"
Print
Delay 1500
Print"the disadvantage is you don't earn a penny"
Print
Delay 500 
	Print"would you like to go on"
		enter$=Input("(Y)es or (N)o: ")
			If Left$(Lower$(enter),1) = "n" End	
						
Print 
Print"I'm glad you have chosen to play the lemondade game"
Print
Print"welcome to a brand new day of a brand new industry"
Print
Print"please enter your name"
	name$=Input(">")
Print name$+ "'s lemonade stand"
Print
Print"welcome " +name+ " lets start your buissness"
Print
Print"Acording to the weather pepole will pay buy more"


Repeat
		Print "Day " +day
		Print "Money " +money
		Print "Temp " +temp%

		Select weather% 
				Case 1 Print "Weather: Sunny" 
				Case 2 Print "Weather: Overcast" 
				Case 3 Print "Weather: Wet" 
				Case 4 Print "Weather: Hazzy" 
				Case 5 Print "Weather: Heat wave" 
		End Select

		Delay 1500

		Print

.loop

;qauntities
	
	Print"How much would you like to charge for your lemonade"
	
		price=Input(">")	
						
	Print	
			
	Print"how many lemons in a pitcher"
		lemonsper=Input(">")
		Print
	Print"how much sugar per pitcher"
		sugarper=Input(">")
		Print
	Print"How much ice per glass"
		iceper=Input(">")
	Print

.purchasing

;purchasing
Print"Now you chosse to buy you're supply's"

;papercups

Print"paper cups cost 2p each"
	paperno=Input("how many cups: ")
		paper=paper + paperno
		money=money-(paperno * 0.02)
			Print
			Print"number of paper cups: " +paper	
			Print
			Print"money: " +money
			Print
			
;lemons

Print"lemons cost 5p each"
	lemonno=Input("how many lemons: ")
		lemons=lemons + lemonno
		money=money-(lemonno * 0.05)
			Print
			Print"number of lemons: " +lemons
			Print
			Print"money: " +money
			Print
;sugar

Print"sugar cost 7p per cup"
	sugarno=Input("how many cups: ")
		sugar=sugar + sugarno
		money=money-(sugarno * 0.07)
			Print
			Print"Cups of sugar: " +sugar
			Print
			Print"money: " +money
			Print
;ice

Print"ice costs 1 p per cup"
	iceno=Input("how many cubes: ")
		ice=ice + iceno
		money=money-(iceno * 0.01)
			Print
			Print"Cubes of  ice: " +ice
			Print
			Print"money: " +money
			Print
;go back

Print"would you like to make changes"
	choice$=Input("yes or no ")
		If Lower$(choice) = "yes" Then
			Goto loop
		End If


;loop2

.loop2

Repeat

		Print
		Print"Day: " +day
		Print"--------------"
				Select weather% 
						Case 1 cust%= Rand(60,(100/price))
						Case 2 cust%= Rand(40,(60/price))
						Case 3 cust%= Rand(20,(50/price))
						Case 4 cust%= Rand(50,(70/price))
						Case 5 cust%= Rand(100,(200/price)) 
				End Select
				
				If ice=>0 Then cust%=0
				
				If paper=>0 Then cust%=0
				
				If lemon=>0 Then cust%=0
				
				If sugar=>0 Then cust%=0
				
				Print "Number of customers who bought lemonade: "+cust

		money=money+(cust%*price)
		
		lemons=lemons-(lemonsper*(cust%/4))
		
		sugar=sugar-(sugarper*cust%)
		
		ice=ice-(iceper*cust%)

		Print "You now have £"+money
		
		Print "All you're remaining ice has melted"
		
		ice=0
		
		Print "you now have " +lemons+ " lemons"
		
		Print "you now have " +sugar+ " cups"
		
		Print "you now have " +ice+ " cubes"
		
		If lemons=< 0 Goto purchasing
		
		If sugar=< 0 Goto purchasing
		
		If ice=< 0 Goto purchasing

		Print"Would you like to make changes?"

		choice$=Input$("(Y)es / (N)o  / (Q)uit game   > ")

		If Left$(Lower$(choice),1)="y" Print "" : Exit

		If Left$(Lower$(choice),1)="q" quit=True : Exit

		day=day+1 : If day=30 quit=True : Exit

	Forever

	

Until quit=True


FreeFont("arial") 
FreeImage("lemon")

End