Help with Movement Speed
Author |
Message |
guardian320
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
rollerdude
![](http://compsci.ca/v3/uploads/user_avatars/2012907293465dc2862c598.jpg)
|
Posted: 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! |
|
|
|
|
![](images/spacer.gif) |
tenniscrazy
![](http://compsci.ca/v3/uploads/user_avatars/16168420744a9c16d226a1c.jpg)
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Cervantes
![](http://compsci.ca/v3/uploads/user_avatars/1023105758475ab2e040bde.jpg)
|
Posted: 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). |
|
|
|
|
![](images/spacer.gif) |
|
|