Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 choppy animation
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
PHP God




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
Solo




PostPosted: 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.
PHP God




PostPosted: Mon May 26, 2003 7:16 pm   Post subject: (No subject)

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




PostPosted: Mon May 26, 2003 8:25 pm   Post subject: (No 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
AsianSensation




PostPosted: Mon May 26, 2003 9:32 pm   Post subject: (No 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?
Homer_simpson




PostPosted: Mon May 26, 2003 10:08 pm   Post subject: (No 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
void




PostPosted: Mon May 26, 2003 10:33 pm   Post subject: (No 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.....
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: