Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Keeping the main menu showing and switching

    Help
    2
    2
    178
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RiskyCrimson
      RiskyCrimson F last edited by

      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()
      Repeat

      Function Title()
      Print("bla")
      Update()
      C = controls(0)
      If c.x then
      Start()
      Endif
      Return void

      Start()
      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

      1 Reply Last reply Reply Quote 0
      • A
        Alexander last edited by

        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 entirely

        The 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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post