Navigation

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

    Big! Update

    Work In Progress
    3
    9
    423
    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.
    • waldron
      waldron F last edited by pianofire

      How can I get a game over screen to loop back to my dointro() if I fall off the bottom of the screen

      1 Reply Last reply Reply Quote 5
      • QIsLegit
        QIsLegit F last edited by

        This is coming along great!

        1 Reply Last reply Reply Quote 2
        • Dave
          Dave Fuze Team last edited by

          Amazing stuff dude.

          To attempt to answer your question, you might be able to use true/false flags to move through the different stages:

          // main loop
          loop
              splashScreen()
              mainGame()
              gameOver()
          repeat
          
          function splashScreen()
              while !startGame loop
                  clear()
                  j = controls(0)
                  // show Skater Kid title
                  // on A button press, startGame becomes true, breaking us out of this loop and moving into the mainGame()
                  update()
              repeat
          return void
          
          function mainGame()
              while !gameOver loop
                  clear()
                  // at some point, gameOver becomes true, breaking us out of this loop and moving into gameOver()
                  update()
              repeat
          return void
          
          function gameOver()
              while !restartGame loop
                  clear()
                  // at some point, make restartGame true and break out of this loop, then we can reset our important variables
                  update()
              repeat
              // when we break out of the loop we are here, and so can do something like:
              restartGame = false
              gameOver = false
              startGame = false
              playerPosition = blah blah
              score = 0
              // etc etc
          return void
          

          I hope this helps you to think about how to structure your program. As always, there are many, many ways to skin a cat - the example I've given is by no means the established way. It will work, however!

          waldron 1 Reply Last reply Reply Quote 1
          • waldron
            waldron F @Dave last edited by

            @Dave I understand it so it works for me thanks :)

            waldron 1 Reply Last reply Reply Quote 1
            • waldron
              waldron F @waldron last edited by

              @waldron why,
              j controls(0)
              I use, c controls(0)
              Just a different way to categorise?
              My noobnes is showing I know

              Dave 1 Reply Last reply Reply Quote 0
              • Dave
                Dave Fuze Team @waldron last edited by

                @waldron Yep makes absolutely no difference. I always start using c, then I'll be using j later in my code wondering why it doesn't work! It's literally just a habit thing.

                Although, using c does mean you can freely use j in nested loops without worrying. I had that one recently, doing nested loops like:

                for i = 0 to 10 loop
                    for j = 0 to 5 loop
                    repeat
                repeat
                

                Completely forgetting that j is my global controls variable...

                Moral of the story, use c, don't listen to me.

                waldron 1 Reply Last reply Reply Quote 1
                • waldron
                  waldron F @Dave last edited by

                  @Dave haha gotcha think I'm starting to get to jist, considering I knew 0% a month ago to 2% now lol thanks

                  1 Reply Last reply Reply Quote 1
                  • Dave
                    Dave Fuze Team last edited by

                    @waldron The fact that you knew nothing and now have the beginnings of a totally original, awesome little game in Fuze is just beyond fantastic. Ah! At 2%, you'll be catching me up in no time. I think I'm just about at 3%. Haha :)

                    waldron 1 Reply Last reply Reply Quote 3
                    • waldron
                      waldron F @Dave last edited by

                      @Dave maybe only 0.2% then, but i would be nowhere near that without fuze i just purely love it.

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