Navigation

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

    Why is there this update()

    Help
    4
    7
    197
    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.
    • P
      petermeisenstein F last edited by petermeisenstein

      if i want to put out stuff in fuze
      print("hello world")
      update()
      why is there this update.
      I mean why cant there be only print?
      I mean maybe i understood it wrong and you dont have to use update()
      But i only was wondering

      1 Reply Last reply Reply Quote 0
      • SteveZX81
        SteveZX81 F last edited by

        I might be wrong but I believe update() updates the screen and thus without it the screen would remain blank?

        P 1 Reply Last reply Reply Quote 0
        • P
          petermeisenstein F @SteveZX81 last edited by

          @SteveZX81 Oh thanks. I know you made a lot of games so do you have to do this for every new picture?Or is update only for the text.

          1 Reply Last reply Reply Quote 0
          • SteveZX81
            SteveZX81 F last edited by

            Like I said I could be wrong but I believe it's needed for every frame, be it text, sprites, images, whatever.

            1 Reply Last reply Reply Quote 0
            • pianofire
              pianofire Fuze Team last edited by

              All screen operations are made by default to a screen buffer rather than directly to the screen. This is to stop too many screen updates affecting performance. It also makes it easy to control the speed of operation as the update() call will only actually draw the frame buffer to the screen once every 1/60th of a second (to maintain 60 fps).

              P 1 Reply Last reply Reply Quote 1
              • P
                petermeisenstein F @pianofire last edited by

                @pianofire Ok thanks

                1 Reply Last reply Reply Quote 0
                • PB____
                  PB____ last edited by

                  Besides controlling the frames per second, it allows you to do a lot to the next frame that is drawn, before it actually appears on screen.

                  When you use print("Hello World") you might also want to add print("How are you doing today?"). By not directly printing to the screen, you can put those things to the screen at exactly the same time, by only calling update() once everything has been done for the next frame.

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