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
Wu dynasty
13
Years of Service
User Offline
Joined: 7th Feb 2013
Location: In a democracy
Posted: 25th Apr 2013 18:38
Hello,
You may have seen my previous posts on this topic. I have figured out the title screen, but I need to make it work. When i click start game I want it to gosub room1:. Thanks


You are entering the Wu Dynasty. Boomshakalaka
-Nathan
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 26th Apr 2013 03:23
I just threw an eye on it before bed but won't what you have there work?

If you want to use labels, which I suppose is somewhat defendable in the given context, you could either replace the "Then But = 1" with - you guessed it - "gosub room1" (provided you have such a label somewhere in your code of course), or put a separate if- (or why not a select-)clause after receiving the button value. Like so:


There should be no colon after the label name when using the goto command by the way, that only applies where you actually put the label in your code.


"Why do programmers get Halloween and Christmas mixed up?"
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 26th Apr 2013 17:28
Quote: "There should be no colon after the label name when using the goto command by the way"

But don't ever use goto. I wouldn't even use gosub.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 26th Apr 2013 18:45
Quote: "But don't ever use goto. I wouldn't even use gosub."

But isn't it all goto's in the end? (assembly JMP etc. instructions).


"Why do programmers get Halloween and Christmas mixed up?"
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Apr 2013 20:05
I haven't tested the code but, looking at it, I suggest you record user input only once per loop.

At the moment Button(...) is called three times and the status or value of mouseclick() could change before the loop has completed the tests. I suggest you call mouseclick() once, store the result in a variable and then pass the result to the Button function calls. Similarly with mouseX() and mouseY() for the same reason.

Login to post a reply

Server time is: 2026-07-06 18:36:55
Your offset time is: 2026-07-06 18:36:55