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

Username:   Password: 
 RegisterRegister   
 Help with Movement Speed
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
guardian320




PostPosted: Thu May 24, 2007 9:30 am   Post subject: Help with Movement Speed

Hey, I'm new to the turing programming language, well, fairly new, I'm in a programming course and we're working on our final assignement right now, I'm making two games to make sure I get a good mark.

Starting with my shooter, which is perfectly a-okay at the moment, I don't need help with it, but with my platformer game I'm making,
I cannot figure out how to properly make the character move at a fair amount of speed, currently he moves pixel by pixel, very..very..slowly.
So could somebody please assisst me with a part of a code that inceases the movement speed of you're moving sprite? (You're character rather)

However it's written I'll be able to edit it so it works with my code so I feel that I don't need to display my movement coding..

Thank you.
Sponsor
Sponsor
Sponsor
sponsor
rollerdude




PostPosted: Thu May 24, 2007 1:42 pm   Post subject: Re: Help with Movement Speed

the only thing i could suggest is to draw the next frame in the animation 5 pixels,or something, apart rather than one, if he moves fast enough, it should look okay, otherwise, decrease your delay(if you have one)

hope i help!
tenniscrazy




PostPosted: Thu May 24, 2007 4:51 pm   Post subject: RE:Help with Movement Speed

if your not using offscreenonly and View.Update then it could be lagging the program
Cervantes




PostPosted: Thu May 24, 2007 9:41 pm   Post subject: RE:Help with Movement Speed

Actually, it will go faster if you're not using View.Update. Using offscreenonly means you're using two drawing layers, and then flipping the one at the back to the front when you call View.Update. This takes much more work than simply working with one drawing layer.

rollerdude is right: either increase the number of pixels by which your character moves each repetition of the loop, reduce number of milliseconds you're giving to the delay procedure, try to optimize your code so it takes less running time, or any combination of these three.

Keep in mind that your program will run at different speeds on different computers of varying capability, [i]unless you implement some kind of FPS (frames per second) limiter, which is always a good idea).
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  [ 4 Posts ]
Jump to:   


Style:  
Search: