Computer Science Canada

choppy animation

Author:  PHP God [ Mon May 26, 2003 5:19 pm ]
Post subject:  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?

Author:  Solo [ Mon May 26, 2003 5:37 pm ]
Post subject:  View.Update

View.Update is a very valuable tool to use.

it works sorta like this:
code:
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:
code:

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.

Author:  PHP God [ Mon May 26, 2003 7:16 pm ]
Post subject: 

Its the screen refresh rate actually. Not the moniter itself, but turing is real slow. How can I jack up the refresh rate?

Author:  Homer_simpson [ Mon May 26, 2003 8:25 pm ]
Post subject: 

try this
code:
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

Author:  AsianSensation [ Mon May 26, 2003 9:32 pm ]
Post subject: 

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?

Author:  Homer_simpson [ Mon May 26, 2003 10:08 pm ]
Post subject: 

see for yourself
code:
var t1, t2 := 0
clock (t1)
for i : 1 .. 1000
    %drawbox (0, 0, maxx, maxy, colorbg)
    %cls
end for
clock (t2)
put t2 - t1

Author:  void [ Mon May 26, 2003 10:33 pm ]
Post subject: 

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.....


: