

-----------------------------------

guardian320

Thu May 24, 2007 9:30 am


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.


-----------------------------------

rollerdude

Thu May 24, 2007 1:42 pm


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

Thu May 24, 2007 4:51 pm


RE:Help with Movement Speed

-----------------------------------

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


-----------------------------------

Cervantes

Thu May 24, 2007 9:41 pm


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

