Keeping the main menu showing and switching
-
I dont have my switch on me now but I have been working on a text RPG game. My code looks kinda like this
Title()
While game loop
Title()
Start()
RepeatFunction Title()
Print("bla")
Update()
C = controls(0)
If c.x then
Start()
Endif
Return voidStart()
Game = false
Print("bla")
Update()
Return void.....
This code is not exact. What I want the code to do is show the title screen and wait until I press x to go to the start function. With my code it waits like I want it to and it goes to the start when i press x. Then after a couple of seconds it goes right back to the title function. How can I fix this.Ps My code might be weird, open to any suggestions
-
iAM just having a hard time trying to break down the code, but, from what it looks like to me, your title and start will always be true because of the first line...
When you just want title to be true for title, and start to be true for start...like, i grasp, kinda whats going on....
but at the same time im just like, no....Like, the naming, when start, shouldnt game be true..
because, title and start are not your game, thats title and a function...but that first line... is forcing title true....
so no matter what you do, its just gonna turn back on
//solutions ill add :
//remove the very first line
//change the second line to
while !game loop
//add a
while game loop
// or keep it opposite, either way it needs to know what to do after you are no longer running while game loop, because start kills that entirelyThe more i look at this code the more of a headache i get, title is always active due to the very first line,
so by activating start, you are turning off title and start... except for the first title.... because that is independent of the game loop mechanic...Ive rewritten this more than id like to admit... but you cant expect to run title twice, kill it once and not have it return... its line one thats making the title screen reappear its also the reason the program doesnt close when you "start" your game...
:I start making game = false I: I cant even at this illogical syntax...
When plug in laptop - power = false.... no... just... no