The Daily Click ::. Forums ::. Klik Coding Help ::. Question about speed?
 

Post Reply  Post Oekaki 
 

Posted By Message

Paul_James



Registered
  02/07/2002
Points
  1320
20th March, 2007 at 03:52:57 -

Ive been working on custom engines - and getting the one that is perfect for me. So here's my question - how do you guys make good speed. Going pixel by pixel usually either moves at 1 pixel for every loop - which is a decent slow speed, but anything higher - 2 or 3, is way to fast. I guess I can make an engine using the bouncing ball movement. . .hmm

I actually just made up a method using a counter that loops back to Zero when it reaches An Alterate Value - then when ever the counter hits that number before it loops back - the player is moved one pixel in whatever direction
(thus the higher alterate value the slower the speed)
but it makes it look choppy

help?

 
Its not enough,I need more
Not enough to satisify
I said I dont want it, I just need it.
To believe, to feel, to know I'm alive.

Knuckle deep beneath the borderlines.
This may hurt a little but its something you'll get used to.
Relax. Slip Away...

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
20th March, 2007 at 04:13:13 -

I've always had problems with this too. How about trying this:

While key is pressed - toggle flag
Flag is on & while key is pressed - set position +- 1
Flag is off & while key is pressed - set position +- 2

Image Edited by the Author.

 
Old member (~2004-2007).

Paul_James



Registered
  02/07/2002
Points
  1320
20th March, 2007 at 04:16:03 -

that would work however +2 pixels every 02" can be faster than what is needed - i guess the real question is how to go slower that +1 pixel every 02" (event loop speed) than without using a ball movement

 
Its not enough,I need more
Not enough to satisify
I said I dont want it, I just need it.
To believe, to feel, to know I'm alive.

Knuckle deep beneath the borderlines.
This may hurt a little but its something you'll get used to.
Relax. Slip Away...

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
20th March, 2007 at 04:18:46 -

Oh, you mean even slower? The same as above, only use 0 and 1. It'd come out to an average moving speed of 0.5.

 
Old member (~2004-2007).

Paul_James



Registered
  02/07/2002
Points
  1320
20th March, 2007 at 04:21:51 -

very nice simple and it works
my way with using variables and a counter was good but urs saves space thanks man

 
Its not enough,I need more
Not enough to satisify
I said I dont want it, I just need it.
To believe, to feel, to know I'm alive.

Knuckle deep beneath the borderlines.
This may hurt a little but its something you'll get used to.
Relax. Slip Away...

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
20th March, 2007 at 04:25:53 -

Oh yeah, you can even leave out the event where you're adding 0 to his position, as that event does nothing anyway. That leaves the code down to two events!

 
Old member (~2004-2007).
   

Post Reply



 



Advertisement

Worth A Click