
-----------------------------------
PHP God
Mon May 26, 2003 5:19 pm

choppy animation
-----------------------------------
I am making a pong type game for a project. I read the turing manual, and read that using a buffer will kill the chopiness, but I'm not right sure how it works. can anyone help me?

-----------------------------------
Solo
Mon May 26, 2003 5:37 pm

View.Update
-----------------------------------
View.Update is a very valuable tool to use.

it works sorta like this:
View.Set ("offscreenonly")

for i : 1 .. 255
    Draw.FillBox (i, i, i + i, i + i, i)
    View.Update
    delay (50)
    Draw.FillBox (i, i, i + i, i + i, white)
end for


Try that.

And now try this:

for i : 1 .. 255
    Draw.FillBox (i, i, i + i, i + i, i)
    delay (50)
    Draw.FillBox (i, i, i + i, i + i, white)
end for

Notice how the first one is much smoother?


I think this is what your asking, if you were asking how to fix Slowness of your game, thats a whole nother issue, for that you might wanna post parts of your game that you think are going slow and someone can take a look at it to see if optimization is possible.

-----------------------------------
PHP God
Mon May 26, 2003 7:16 pm


-----------------------------------
Its the screen refresh rate actually. Not the moniter itself, but turing is real slow. How can I jack up the refresh rate?

-----------------------------------
Homer_simpson
Mon May 26, 2003 8:25 pm


-----------------------------------
try this
View.Set ("offscreenonly") 

for i : 1 .. 255 
    Draw.FillBox (i, i, i + i, i + i, i) 
    View.Update 
    delay (5) 
    Draw.FillBox (i, i, i + i, i + i, white) 
end for 

-----------------------------------
AsianSensation
Mon May 26, 2003 9:32 pm


-----------------------------------
im not sure if it's true or not, but someone once told me that instead of cls, drawbox(0,0,maxx,maxy,colorbg) was faster, maybe that could save some time?

-----------------------------------
Homer_simpson
Mon May 26, 2003 10:08 pm


-----------------------------------
see for yourself
var t1, t2 := 0
clock (t1)
for i : 1 .. 1000
    %drawbox (0, 0, maxx, maxy, colorbg)
    %cls
end for
clock (t2)
put t2 - t1


-----------------------------------
void
Mon May 26, 2003 10:33 pm


-----------------------------------
yea...it works faster because cls adds and extra refresh command, it has to reset the whole screen, that drawbox jus draws ontop of wat is already there, masking it and thus making it disappear....and its also not as noticeable as a cls command in the middle of animation, but nothing beats View.Update with turing 4.....
