lemonade game
Blitz3D Forums/Blitz3D Beginners Area/lemonade game
| ||
I was making this game and it was working and i did it from complete scratch yehhhhh and i got to this and it dosn't work please help;lemonade game ;made by Ashley griffiths AppTitle"lemonade game" Graphics 800,600 SeedRnd(MilliSecs()) ;some constants day = 1 money = 20.00 ;temp random temp%= Rand(1,10) ;Weather random Weather%= Rand(1,5) ;amounts paper=0 lemons=0 sugar=0 ice=0 ;introduction Print"welcome to the lemonade game" Print Delay 500 Print"In the lemonade game you choose how to sell your lemondade game" Print Delay 500 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("yes or no: ") If Lower$(enter) = no Then End Else EndIf Print Print"I'm glad you have chosen to play the lemondade game" Print Print"welcome to a brand new day of a brandnew industrie" Print Print"please enter your name" name$=Input() Print name$+ " lemonade stand" Print Print"welcome lets start your buissness" Print Print"Acording to the weather pepole will pay more and buy more" 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 Repeat ;qauntitys Print"How much would you like to charge for your lemonade" price=Input() Print"how many lemons in a pitcher" lemons=Input() Print"how much sugar per pitcher" sugar=Input() Print"How much ice per glass" ice=Input() Print ;purchasing Print"Now you chosse to buy you're supply's" ;papercups Print"paper cups cost 2p each" paperno=Input("how many cups: ") paper + paperno money - paperno * 0.02 Print"number of paper cups: " +paper Print"money: " +money ;lemons Print"lemons cost 5p each" lemonno=Input("how many lemons: ") lemons + lemonno money - lemonno * 0.05 Print"number of lemons: " +lemons Print"money: " +money ;sugar Print"sugar cost 7p per cup" sugarno=Input("how many cups: ") sugar + sugarno money - sugarno * 0.07 Print"Cups of sugar: " +sugar Print"money: " +money ;ice Print"ice costs 1 p per cup" iceno=Input("how many cubes: ") ice + iceno money - iceno * 0.01 Print"Cubes of ice: " +ice Print"money: " +money ;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 .loop2 cust%=Rand(0,100) cust% * price = money Print"you know have " +money day + 1 Until day=30 |
| ||
when using variables you can't write cust*price=money you must start with the variable your changing money=cust*price same with money-iceno*0.01 if you want to change the value of a variable it must start with the variable you want to change followed by an = sign money=money-iceno*0.01 hope that helps another thing, please have a way to exit your game or change the graphics command to Graphics 800,600,16,2 this will enable windowed mode. Looks good apart from that :D |
| ||
If Lower$(choice) = yes ThenAlso, enclose the yes in double quotes: If Lower$(choice) = "yes" Then |
| ||
I changed the errors and made some changes and made it better but you seem to always get a minus number profit don't know why so if you charged 100 fir your lemonade and 100 came it would be a minus number;lemonade game ;made by Ashley griffiths AppTitle"lemonade game" Graphics 800,600,16 SeedRnd(MilliSecs()) ;some constants day = 1 money = 20.00 ;temp random temp%= Rand(1,10) ;Weather random Weather%= Rand(1,5) ;amounts paper=0 lemons=0 sugar=0 ice=0 ;introduction Print"welcome to the lemonade game" Print Delay 500 Print"In the lemonade game you choose how to sell your lemondade game" Print Delay 500 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("yes or no: ") If Lower$(enter) = "no" Then End Else EndIf 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 industrie" Print Print"please enter your name" name$=Input() Print name$+ " lemonade stand" Print Print"welcome lets start your buissness" Print Print"Acording to the weather pepole will pay more and 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 ;qauntitys Print"How much would you like to charge for your lemonade" price=Input() Print"how many lemons in a pitcher" lemons=Input() Print"how much sugar per pitcher" sugar=Input() Print"How much ice per glass" ice=Input() Print ;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"number of paper cups: " +paper Print"money: " +money ;lemons Print"lemons cost 5p each" lemonno=Input("how many lemons: ") lemons=lemons + lemonno money=money- lemonno * 0.05 Print"number of lemons: " +lemons Print"money: " +money ;sugar Print"sugar cost 7p per cup" sugarno=Input("how many cups: ") sugar=sugar + sugarno money=money-sugarno * 0.07 Print"Cups of sugar: " +sugar Print"money: " +money ;ice Print"ice costs 1 p per cup" iceno=Input("how many cubes: ") ice=ice + iceno money=money-iceno * 0.01 Print"Cubes of ice: " +ice Print"money: " +money ;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 .loop2 Select weather% Case 1 cust%= Rand(60,100) Case 2 cust%= Rand(40,60) Case 3 cust%= Rand(20,50) Case 4 cust%= Rand(50,70) Case 5 cust%= Rand(100,200) End Select money=money + (cust% * price) Print"you know have " +money day=day + 1 Until day=30 |
| ||
Ashley .. try this:; Lemonade game ; Made by Ashley griffiths AppTitle"Lemonade Game" ;; Graphics 800,600,16 SeedRnd(MilliSecs()) ;some variables day = 1 money# = 20.00 price#=0 temp%= Rand(1,10) ; temp random weather%= Rand(1,5) ; Weather random paper=0 : lemons=0 : sugar=0 : ice=0 quit=False ;introduction Print "Welcome to the lemonade game."+Chr$(10) Delay 500 Print "In the lemonade game you choose how to sell your lemondade." Delay 5000 Print "The advantage is you don't have to spend a penny." Delay 1500 Print "The disadvantage is you don't earn a penny." Delay 500 Print "Would you like to go on?"+Chr$(10) 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 lemonade game." Print "Welcome to a brand new day of a brand new industry."+Chr$(10) Print "please enter your name:" name$=Input$(">") Print "" Print name$+ " lemonade stand."+Chr$(10) Print "Welcome. Lets start your business." Print "According to the weather people will pay more and buy more." Repeat Print "" 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 ;quantities price=Input$("How much would you like to charge for your lemonade? > ") lemons=Input$("How many lemons in a pitcher? > ") sugar=Input$("How much sugar per pitcher? > ") ice=Input$("How much ice per glass? > ") Print "" ;purchasing Print "Now you choose to buy you're supply's" ;papercups paperno=Input$("Paper cups cost 2p each. How many cups? > ") paper=paper+paperno money=money-(Float(paperno)*0.02) Print "number of paper cups: " +paper Print "money: " +money ;lemons lemonno=Input$("Lemons cost 5p each. How many lemons? > ") lemons=lemons+lemonno money=money-(Float(lemonno)*0.05) Print "number of lemons: " +lemons Print "money: " +money ;sugar sugarno=Input$("Sugar costs 7p per cup. How many cups? > ") sugar=sugar+sugarno money=money-(Float(sugarno)*0.07) Print "Cups of sugar: " +sugar Print "money: " +money ;ice iceno=Input$("Ice costs 1 p per cup. How many cubes? > ") ice=ice+iceno money=money-(Float(iceno)*0.01) Print "Cubes of ice: "+ice Print "money: " +money Repeat Print " " Print "Day "+day Print "-----------" Select weather% Case 1 : cust%= Rand(60,100) Case 2 : cust%= Rand(40,60) Case 3 : cust%= Rand(20,50) Case 4 : cust%= Rand(50,70) Case 5 : cust%= Rand(100,200) End Select Print "Number of customers who bought lemonade: "+cust money=money+(cust%*price) Print "You now have "+money+Chr$(10) 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 End |
| ||
Ok here it is my code i have done some stuff aswell;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 DrawBlock lemon,0,0 ;it's a lemon ;setfont Color 0,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" lemons=Input(">") Print Print"how much sugar per pitcher" sugar=Input(">") Print Print"How much ice per glass" ice=Input(">") Print ;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) Case 2 cust%= Rand(40,60) Case 3 cust%= Rand(20,50) Case 4 cust%= Rand(50,70) Case 5 cust%= Rand(100,200) End Select Print "Number of customers who bought lemonade: "+cust money=money+(cust%*price) Print "You now have "+money+Chr$(10) 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 End It has a background of a lemon but when the text gets down far enoughth it kind of move the lemon up Is there any way of having a picture stuck on background so it dosen't move up please help it looks a bit odd at the moment |
| ||
what you have to do is keep drawing your background before you draw any text or, what i would do is use the text command instead of the print command |
| ||
Okay another way is it possible to cls and then reset the text to the top like it starts |
| ||
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 |
| ||
The Print command alutomatically does a carrage return and line feed at the end of the item being printed, meaning that it drops to then next lower line. So Print statements progress to the next lower line automatically. Write commands do not do the carrage return line feed, but they do progress across the screen, and when the end is reached, will drop to a lower line. Text commands require an x,y coordinate position before the text to be placed on the screen, which is rather like using a locate x,y command followed by a Write command. What I have noted, is that under some conditions, Print and Write statements seem to cause the screen to scroll, even when you are not near the bottom of the screen. It might be somehow related to the fact that some information appears in the final line of the screen, tricking the process into believing that a scroll is due. This does not appear to be a problem with using the Text command. Hope that helps. |
| ||
hey hey I did some more updates but i has got a problem;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 225,0,0 SetFont LoadFont("arial",30) ;introduction Print"Welcome To the lemonade game" Print Print"Made by Ashley Griffiths" Print Delay 500 Print"In the lemonade game you choose how to sell your lemondade game" Print Delay 2000 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 lemonade game" Print Print"Welcome to a brand new day of a brand new industry" Print Print"Please enter your name" name$=Input(">") Print 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 ;qauntities Print"How much would you like to charge for your lemonade in penny's (p)" price=Input(">") Print Repeat Print"How many lemons in a pitcher 0- 10" lemonsper=Input(">") Print Until lemonsper =>0 And lemonsper =<10 Repeat Print"How much sugar per pitcher 0-10" sugarper=Input(">") Print Until sugarper =>0 And sugarper =<10 Repeat Print"How much ice per glass 0-10" iceper=Input(">") Print Until iceper =>0 And sugarper =<10 Repeat ;purchasing Print"Now you chosse to buy you're supply's" ;papercups Repeat Print"Paper cups cost 2p each" paperno=Input("How many cups: ") Print Until paperno >0 paper=paper + paperno money=money-(paperno * 0.02) Print Print"Number of paper cups: " +paper Print Print"Money: " +money# Print ;lemons Repeat Print"Lemons cost 5p each" lemonno=Input("How many lemons: ") Print Until lemonno >0 lemons=lemons + lemonno money=money-(lemonno * 0.05) Print Print"Number of lemons: " +lemons Print Print"Money: " +money Print ;sugar Repeat Print"Sugar cost 7p per cup" sugarno=Input("How many cups: ") Print Until sugarno >0 sugar=sugar + sugarno money=money-(sugarno * 0.07) Print Print"Cups of sugar: " +sugar Print Print"Money: " +money Print ;ice Repeat Print"Ice costs 1 p per cup" iceno=Input("How many cubes: ") Print Until iceno >0 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" go=Input("(Y)es or (N)o ") Print If Left$(Lower$(go),1)="n" goon=True : Exit Until goon=True 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 If money#>0 quit=True : Exit 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" 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 you see it can't get past this part here ;go back Print"Would you like to make changes" go=Input("(Y)es or (N)o ") Print If Left$(Lower$(go),1)="n" goon=True : Exit Until goon=True so that's were i think priblem in the code is |
| ||
OK i have started convering it to text instead of print ;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" Print Print Print 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" Print Print Print Print Print 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 Print ;qauntities Print"How much would you like to charge for your lemonade in penny's (p)" price=Input(">") Print Repeat Print"How many lemons in a pitcher 0- 10" lemonsper=Input(">") Print Until lemonsper =>0 And lemonsper =<10 Repeat Print"How much sugar per pitcher 0-10" sugarper=Input(">") Print Until sugarper =>0 And sugarper =<10 Repeat Print"How much ice per glass 0-10" iceper=Input(">") Print Until iceper =>0 And sugarper =<10 Repeat ;purchasing Print"Now you chosse to buy you're supply's" ;papercups Repeat Print"Paper cups cost 2p each" paperno=Input("How many cups: ") Print Until paperno >0 paper=paper + paperno money=money-(paperno * 0.02) Print Print"Number of paper cups: " +paper Print Print"Money: " +money# Print ;lemons Repeat Print"Lemons cost 5p each" lemonno=Input("How many lemons: ") Print Until lemonno >0 lemons=lemons + lemonno money=money-(lemonno * 0.05) Print Print"Number of lemons: " +lemons Print Print"Money: " +money Print ;sugar Repeat Print"Sugar cost 7p per cup" sugarno=Input("How many cups: ") Print Until sugarno >0 sugar=sugar + sugarno money=money-(sugarno * 0.07) Print Print"Cups of sugar: " +sugar Print Print"Money: " +money Print ;ice Repeat Print"Ice costs 1 p per cup" iceno=Input("How many cubes: ") Print Until iceno >0 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" go=Input("(Y)es or (N)o ") Print If Left$(Lower$(go),1)="n" goon=True : Exit Until goon=True 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 If money#>0 quit=True : Exit 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" 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 but how can i change were the inputs are like how the text does name$=Input(">") |
| ||
That's trickier. You will have to manually output the input. What I mean is to not use the INPUT command and to use WAITKEY command (I hope that's the right command, I can't check, I'm at work) to get keypresses from the user and then TEXT that keypress to the screen so the user can see it. You will have to use a variable to keep track of where to TEXT the next keypress each time and increment that variable each keypress. You will also have to check for the enter key and backspace key (and maybe even the arrow keys if you want to give the user that much flexibility). Of course, you will have to decrement the variable if the user presses the backspace key. |
| ||
Ok i tried that but it gives you a code putput how can i get it to give me it in normal letter's ecause at the moent it code |
| ||
ok how would i do it on this wayText 200,0,"Would you like to go on" enter$=Input("(Y)es or (N)o: ") If Left$(Lower$(enter),1) = "n" End |
| ||
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 |
| ||
Hi Folks, Do you know I think this is probably the most intelligent way I've seen in recent eons of someone learning to program. No fancy graphics, effects or sounds, just basic coding and structure and asking questions. Good on you, Agamer. Later, Jes |
| ||
Thanks and I was doing some testing and noticed some error's hear is the revised version it will soon be availble to download on my website |
| ||
OK here iis some more code the latest telll me what you think. But it has a problem I have put in an animated back ground picture. here's the code ;lemonade game ;made by Ashley griffiths AppTitle"lemonade game" Graphics 800,600,16 SeedRnd(MilliSecs()) ;load some images lemon=LoadImage("back.bmp") move=LoadAnimImage("back.gif",800,600,0,80) ;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 ;end of introduction 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 Repeat ;I think it has a problem here DrawBlock move,0,0 Delay 6120 Cls DrawBlock lemon,0,0 Text 275,0,"Day: " +day Text 275,30,"--------------" Select weather% Case 1 cust%= Rand(60,(100/(price+iceper))*((lemonsper+sugarper/2))) Case 2 cust%= Rand(40,(60/(price+iceper))*((lemonsper+sugarper/2))) Case 3 cust%= Rand(20,(50/(price+iceper))*((lemonsper+sugarper/2))) Case 4 cust%= Rand(50,(70/(price+iceper))*((lemonsper+sugarper/2))) Case 5 cust%= Rand(100,(200/(price+iceper))*((lemonsper+sugarper/2))) 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?" Locate 200,450 choice$=Input$("(Y)es / (N)o / (Q)uit game > ") Cls DrawBlock lemon,0,0 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 If day=30 Then Text 200,0,"You made through your 30 days ending with £" +money EndIf If Left$(Lower$(choice),1)="q" Then Text 200,0,"You just gave up come why not start again" Else Text 200,0,"You have run out of money! Oh well try again" EndIf Delay 5000 FreeImage("lemon") End |
| ||
as far as i know, you can't use animated gifs in BB - or you can load them but they will just display the first frame or something. You will need to do the animation yourself ! |
| ||
what as an avi |
| ||
ok i changed to an avi but it still dise not work maybe you can assist so here's the code;lemonade game ;made by Ashley griffiths AppTitle"lemonade game" Graphics 800,600,16 SeedRnd(MilliSecs()) ;load some images lemon=LoadImage("back.bmp") move=LoadAnimImage("move.avi",800,600,0,80) scroll=LoadImage("scrolling Text.jpg") ;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 ;setfont Color 0,0,0 SetFont LoadFont("arial",30) ;introduction DrawBlock lemon,0,0 l#=600 SetBuffer BackBuffer() Repeat Cls DrawBlock scroll,0,l# l#=l#-0.5 Flip Until l#=-1000 SetBuffer FrontBuffer() ;end of introduction Text 200,0,"Welcome" Delay 1000 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 Repeat DrawBlock move,0,0 Delay 6120 Cls DrawBlock lemon,0,80 Text 275,0,"Day: " +day Text 275,30,"--------------" Select weather% Case 1 cust%= Rand(60,(100/(price+iceper))*((lemonsper+sugarper/2))) Case 2 cust%= Rand(40,(60/(price+iceper))*((lemonsper+sugarper/2))) Case 3 cust%= Rand(20,(50/(price+iceper))*((lemonsper+sugarper/2))) Case 4 cust%= Rand(50,(70/(price+iceper))*((lemonsper+sugarper/2))) Case 5 cust%= Rand(100,(200/(price+iceper))*((lemonsper+sugarper/2))) 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?" Locate 200,450 choice$=Input$("(Y)es / (N)o / (Q)uit game > ") Cls DrawBlock lemon,0,0 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 If day=30 Then Text 200,0,"You made through your 30 days ending with £" +money EndIf If Left$(Lower$(choice),1)="q" Then Text 200,0,"You just gave up come why not start again" Else Text 200,0,"You have run out of money! Oh well try again" EndIf Delay 5000 FreeImage("lemon") End |
| ||
ooops, it appears i was not entirely correct about animated gifs.... have a look in the documentation for the "openmovie" and "drawmovie" commands for info on these formats. |
| ||
ok i finaly got that draw comand to work and hear it is i put it in and when you get to that point of the code it closes maybe you know why and why do i need a timer;lemonade game ;made by Ashley griffiths AppTitle"lemonade game" Graphics 800,600,16 SeedRnd(MilliSecs()) ;load some images lemon=LoadImage("back.bmp") move=OpenMovie("back.gif") scroll=LoadImage("scrolling Text.jpg") mytimer=CreateTimer(180) ;some variables day = 1 money# = 20.00 price# = 0.00 goon=False l#=600 pop#=0 popadd#=0 ;temp random temp%= Rand(1,10) ;Weather random Weather%= Rand(1,5) ;amounts paper=0 : lemons=0 : sugar=0 : ice=0 ;setfont Color 0,0,0 SetFont LoadFont("arial",30) ;introduction SetBuffer BackBuffer() Repeat Cls DrawBlock scroll,0,l# l#=l#-1 Flip Until l#=-1000 SetBuffer FrontBuffer() ;end of introduction Text 200,0,"Welcome" Delay 1000 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% Text 275,250,"Popularity " +pop+ "%" 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,300,"How much would you like to charge for your lemonade in penny's (p)" Locate 0,350 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 Repeat DrawMovie move WaitTimer mytimer Select weather% Case 1 popadd=4 Case 2 popadd=2 Case 3 popadd=1 Case 4 popadd=3 Case 5 popadd=5 End Select pop=pop+popadd Cls DrawBlock lemon,0,0 Text 275,0," Day: " +day Text 275,30,"--------------" Select weather% Case 1 cust%= Rand(60,(100/(price+iceper))*(((lemonsper+sugarper)/2)+(pop/5))) Case 2 cust%= Rand(40,(60/(price+iceper))*(((lemonsper+sugarper)/2)+(pop/5))) Case 3 cust%= Rand(20,(50/(price+iceper))*(((lemonsper+sugarper)/2)+(pop/5))) Case 4 cust%= Rand(50,(70/(price+iceper))*(((lemonsper+sugarper)/2)+(pop/5))) Case 5 cust%= Rand(100,(200/(price+iceper))*(((lemonsper+sugarper)/2)+(pop/5))) 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?" Locate 200,450 choice$=Input$("(Y)es / (N)o / (Q)uit game > ") Cls DrawBlock lemon,0,0 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 Cls If day=30 Then Text 200,0,"You made through your 30 days ending with £" +money ElseIf Left$(Lower$(choice),1)="q" Then Text 200,0,"You just gave up come why not start again" Else Text 200,0,"You have run out of money! Oh well try again" EndIf Delay 5000 FreeImage("lemon") End |
| ||
You're making great progress Agamer. I noticed that the syntax for the command FreeImage is not correct. It should be ---> FreeImage lemon -------------------- By the way, do you have a link to the media files you are using? -------------------- Keep at this. This is a great way to learn. There is so much more that can be done with this game. . |
| ||
no i'm afraid i can't not post a link to the files |
| ||
but it must be easy to do it without i can e-mail you the files |
| ||
You can email me at blitzer @ stewartsoftware . ca =============================== I can make a little web page on my site for this too. |
| ||
what you mean for this too i'm getting my own site soon but it is having some problems so thankyou but no thankyou my site should be up soon (hope hope) i shall e-mail the files soon |
| ||
Thanks. Waiting for the email. |
| ||
SOZ I HAVE BEEN HAVING SOME PROBS WITH MY E-MAIL CLIENT SHOLD SEND THEM TODAY OR TOMMOROW ahh hit the cap lock |
| ||
No Problemo. |
| ||
and then internet connection cut out and know I am at someone elses comp on holidays so can t get yuo the files but should about this week |
| ||
I can make a little web page on my site for this too. please post a link cos now I am hell curious :) I think this may be better syntax for your font handling: MyFont = LoadFont("Arial",24,False) ;assign a handle to the font SetFont MyFont ;tell program to use this font next ;use the font FreeFont MyFont ;free the font from memory |
| ||
I did post a link but it was a free host provider and something went wrong in my coding so i am completely redesigning the site and hopefully purchasing some space |
| ||
Still interested. Let us know when you have the site up. (if your in Canada or U.S., check out www.clickhost.net) |
| ||
I opligise for the very long wait but if you are still intersated i have the brand new website ready and it is on there but it still has the problem i talked about the link is http://allash.greatnow.com/index.html thanks for any future help and maybe i casn fix this bad boy soon i'm thinking of doing some upgraades but i stiilll need to sort this |
| ||
PLEase i beg does any onw know how to fizx irt i know it ttook a while to post but i need a help i can see no logical esplanation |
| ||
Agamer, i get a file not found error. And there is about 7 pop up windows that appear, a wee bit anoying. No matter, i've been meaning to get of of 'em pop up stoppers anyway. :D |
| ||
yeah me too there's a 404 error that file is not attached that link, check your link and post back. |
| ||
I'm still interested. I cannot get the file either. Is the file uploaded in the right directory, and does it have the correct file name? |
| ||
ahhhh i spent ages building that website does it work on any of the other diwnloads like seffel |
| ||
NOPE Same thing on seffel |
| ||
owwwww why why does it not work i will have a look into it soon ahhh why can my site never be problame free |
| ||
heres a solution take brick apply brick to computer relax otherwise, look forward to hours of frustration, it comes with the territory :) |
| ||
ok were did i put that brick ummmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm oh here in my pile of bricks to frow at stnuff when it dosen't work |
| ||
Still can't download. Have you discovered what's wrong yet? |
| ||
no i am busy i am working on the site but have got pepole looking over my shoulder [edit] if you read this bit i did not type it someone else did ocver my shoulder if you didn't forget it |
| ||
I haven't been to this site as much as i used to. I hope you figure it out. |
| ||
here it finished the site here is the link hope it works www.allash.greatnow.com/index.html |
| ||
I'm sorry, Agamer, but I can't download it. Unfortunately, the changes didn't seem to do anything different. Is there anything the hosting agreement about sharing/storing files? |
| ||
ahh why i should work why it should why not i had it working before i think i anoyed them in some angry e-mails it's a free site so maybe thats it i can e-mal it to you but i don't know you're e-mail adress and i'm doubtful if you wanna post as it could be fdangerous but then again you're dager dave |
| ||
lol |
| ||
if you wanna e-mail someone, click on there name, and it usually has their e-mail address there :) |
| ||
Agamer, Yep. just click my name and you'll see my address. If you want, the offer is still there to host it for a while, until you figure out the problem. |
| ||
I wiill send it soon abd i am switching hosts soon onto some add free one hopefuly . I have got to find a file as at the momnet i tested it the other day and it was missing a file |
| ||
Ok, Agamer. I will wait. I hope you have better success with the new host than the current one. If you are in Canada or in US, try out clickhost.net |
| ||
No I am in the UK. I am going to try and host with my ISP. |
| ||
Have you found the missing file, Agamer? |