Why is there this update()
-
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 -
I might be wrong but I believe update() updates the screen and thus without it the screen would remain blank?
-
@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.
-
Like I said I could be wrong but I believe it's needed for every frame, be it text, sprites, images, whatever.
-
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).
-
@pianofire Ok thanks
-
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 addprint("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 callingupdate()
once everything has been done for the next frame.