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

Post Reply  Post Oekaki 
 

Posted By Message

Paul_James



Registered
  7/2/2002
Points
  1320
20th March, 2007 at 3:52:57 AM -

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
  9/4/2004
Points
  8001

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

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.

 
http://davince.tengudev.com/
Still a member of Ectoprods! If it still exists, that is.

Don't take me for a FOOL!

"you purple nurple " - Del Duio

Paul_James



Registered
  7/2/2002
Points
  1320
20th March, 2007 at 4:16:03 AM -

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
  9/4/2004
Points
  8001

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

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.

 
http://davince.tengudev.com/
Still a member of Ectoprods! If it still exists, that is.

Don't take me for a FOOL!

"you purple nurple " - Del Duio

Paul_James



Registered
  7/2/2002
Points
  1320
20th March, 2007 at 4:21:51 AM -

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
  9/4/2004
Points
  8001

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

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!

 
http://davince.tengudev.com/
Still a member of Ectoprods! If it still exists, that is.

Don't take me for a FOOL!

"you purple nurple " - Del Duio
   

Post Reply



 



Advertisement

Worth A Click