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.

oh yeh It now is gdgdgdgddggdgdgdgdgdgdgdgdgdgdgdgddgdgdgdgdgdgdgdg

so here is the source code

;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
goon=False 
;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 0,0,0
SetFont LoadFont("arial",30)

DrawBlock lemon,0,0 

;introduction
Text 200,0,"Welcome To the lemonade game"
Text 250,50,"Made by Ashley Griffiths"
Delay 500
Cls
DrawBlock lemon,0,0
Text 10,0,"In the lemonade game you choose how to sell your lemondade game"
Delay 2000
Text 100,50,"The advantage is you don't have to spend a penny"
Delay 1500
Text 120,100,"The disadvantage is you don't earn a penny"
Delay 500 
Cls
DrawBlock lemon,0,0
		
		Text 200,0,"Would you like to go on"
		Locate 150,50
		enter$=Input("(Y)es or (N)o: ")
			If Left$(Lower$(enter),1) = "n" End	
			
Cls
DrawBlock lemon,0,0
						
 
Text 50,0,"I'm glad you have chosen to play the lemonade game"
Text 55,50,"Welcome to a brand new day of a brand new industry"

Text 250,100,"Please enter your name"
	
	Locate 0,150
	name$=Input(">")
	
Cls
DrawBlock lemon,0,0
Text 250,0,name$+ "'s lemonade stand"

Text 250,75,"Welcome " +name+ " lets start your buissness"

Cls
DrawBlock lemon,0,0
Text 200,0,"Acording to the weather pepole will pay buy more"


Repeat
		Text 275,50,"Day: " +day
		Text 275,100,"Money: " +money
		Text 275,150,"Temp: " +temp%

		Select weather% 
				Case 1 Text 275,200,"Weather: Sunny" 
				Case 2 Text 275,200,"Weather: Overcast" 
				Case 3 Text 275,200,"Weather: Wet" 
				Case 4 Text 275,200,"Weather: Hazzy" 
				Case 5 Text 275,200,"Weather: Heat wave" 
		End Select

		Delay 1500

		

;qauntities
	
	Text 0,250,"How much would you like to charge for your lemonade in penny's (p)"
	
		Locate 0,300
		price=Input(">")
	Cls
	DrawBlock lemon,0,0	
						
	Repeat 		
	Text 200,0,"How many lemons in a pitcher 0- 10"
		Locate 0,50
		lemonsper=Input(">")
	Cls
	DrawBlock lemon,0,0	
	Until lemonsper =>0 And lemonsper =<10
	
	Repeat
	Text 200,0,"How much sugar per pitcher 0-10"
		Locate 0,50
		sugarper=Input(">")
	Cls
	DrawBlock lemon,0,0
	Until sugarper =>0 And sugarper =<10
	
	Repeat
	Text 200,0,"How much ice per glass 0-10"
		Locate 0,50
		iceper=Input(">")
	Cls
	DrawBlock lemon,0,0
	Until iceper =>0 And sugarper =<10
	

Repeat

;purchasing
Text 200,0,"Now you chosse to buy you're supply's"

Cls
DrawBlock lemon,0,0


;papercups

Repeat
Text 300,50,"Paper cups cost 2p each"
	Locate 300,100
	paperno=Input("How many cups: ")
	Cls
	DrawBlock lemon,0,0
Until paperno >0
		paper=paper + paperno
		money=money-(paperno * 0.02)
			
			Text 250,0,"Number of paper cups: " +paper	
			
			Text 250,50,"Money: " +money#
			
			Cls
			DrawBlock lemon,0,0
			
			
;lemons

Repeat
Text 250,0,"Lemons cost 5p each"
	Locate 250,50
	lemonno=Input("How many lemons: ")
	Cls
	DrawBlock lemon,0,0
Until lemonno >0
		lemons=lemons + lemonno
		money=money-(lemonno * 0.05)
			
			Text 250,0,"Number of lemons: " +lemons
			
			Text 250,50,"Money: " +money
			
			Cls
			DrawBlock lemon,0,0

			
			
;sugar

Repeat
Text 250,0,"Sugar cost 7p per cup"
	Locate 250,50
	sugarno=Input("How many cups: ")
	
	Cls
	DrawBlock lemon,0,0

Until sugarno >0
		sugar=sugar + sugarno
		money=money-(sugarno * 0.07)
			
			Text 250,0,"Cups of sugar: " +sugar
			
			Text 250,0,"Money: " +money
			
			Cls
			DrawBlock lemon,0,0

;ice

Repeat
Text 250,0,"Ice costs 1 p per cup"
	Locate 250,50
	iceno=Input("How many cubes: ")
	
	Cls
	DrawBlock lemon,0,0

Until iceno >0
		ice=ice + iceno
		money=money-(iceno * 0.01)
			
			Text 250,0,"Cubes of  ice: " +ice
			
			Text 250,50,"Money: " +money
			
			Cls
			DrawBlock lemon,0,0

;go back
Text 200,0,"Would you like to make changes"
Locate 250,50
go=Input("(Y)es or (N)o ")

If Left$(Lower$(go),1)="n" goon=True : Exit 
Until goon=True

Cls
DrawBlock lemon,0,0



Repeat

		
		Text 275,0,"Day: " +day
		Text 275,30,"--------------"
				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
				
				If money#>0 quit=True : Exit
				
				Text 150,80,"Number of customers who bought lemonade: "+cust

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

		Text 250,130,"You now have £"+money
		
		Text 200,180,"All you're remaining ice has melted"
		
		ice=0
		
		Text 200,230,"You now have " +lemons+ " lemons"
		
		Text 200,280,"You now have " +sugar+ " cups"
		
		Text 200,350,"You now have " +ice+ " cubes"
		
		Text 200,400,"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