Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Hsoj
15
Years of Service
User Offline
Joined: 6th May 2011
Location:
Posted: 6th May 2011 19:22


I do not know if it is due to placement of the if score = 3 is in the wrong spot or if the code is invalid for the game to understand. I have two more levels I want to go to next after the first and I cannot figure out how to do so. Please help.
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 6th May 2011 20:11
Your code looks incomplete, the if score=3 command is not even in there. A little more info please. I am sure it should be a relatively simple problem.

http://s6.bitefight.org/c.php?uid=103081
Daniel wright 2311
User Banned
Posted: 6th May 2011 20:37 Edited at: 6th May 2011 20:41
Im not shure how you are setting up your game but here is how I do it if it helps.

first I set up my health,wich would be your score, so I would

set cursor 1,1
print "score"

Then I would dec health every time I get hurt, but you would inc score, so after you inc score and if score=3 then you can do this

If score=3 then leval = 2

if leval =2 then delete all of objects in leval1:gosub _load leval 2

then your program will load in leval 2.BUT

What I do is i say in my loop,if leval=1 then do all my code then endif

then I also do this for all my other levals. but you will need to delete all of the object in that leval before you load in all of leval 2.

HERE IS A GOOD EXAPMLE



my signature keeps being erased by a mod So this is my new signature.
Hsoj
15
Years of Service
User Offline
Joined: 6th May 2011
Location:
Posted: 9th May 2011 19:00



I thought it contained the if score = 3 but it did not for some reason? I'm not sure why I retried posting it.
Hsoj
15
Years of Service
User Offline
Joined: 6th May 2011
Location:
Posted: 9th May 2011 19:09
Daniel what I want is for the game to continue to level 2 after you reach a score of 3, you earn points for hitting the opponent with your balloon. In level 2 I want it to go onto level 3 after you reach a score of 4. Level 3 will be the last level, also if the opponent reaches a score of 3 in level one, and a score of 4 in level two then the game is over is what I want. The code doesn't work and it worked in another game I did for my class.
noobnerd
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 10th May 2011 00:00
well in your code you say playerscore = 0
If playerscore = 3 then gosub...
How could the score be 3 if you just set it to zero?
Hsoj
15
Years of Service
User Offline
Joined: 6th May 2011
Location:
Posted: 10th May 2011 18:47
That's the starting score you begin with. You must earn a score of 3 to go to the next level. Or the monster gets 3 and you lose the game. I just happened to try and stick it nearby that part of the code to see if it would work. Should it be at the end of the game?
noobnerd
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 11th May 2011 00:52
is there some code between playerscore = 0 and the if ? If not then the playerscore = 3 will never be true.

Your code should look like this.
Playerscore = 0
Do
*program*
If playerscore = 3
Gosub _level2:
Endif
Loop

Login to post a reply

Server time is: 2026-07-11 04:24:22
Your offset time is: 2026-07-11 04:24:22