Cthulhu32 home

New Screeney

Posted on 2005/09/08 23:46

Yup, I made a title screen along w/ a bouncing ball for selecting things. I'm running into problems right now making the ball move smoothly, something to do w/ floats vs ints. But I'll get this thing working! Anyways, thought I'd show people my afternoon's work.

Add comment
Comment by saluk on 2005-09-09 00:10

It's best to use ints for position. If you want smooth movement, instead of adding .2 to position every frame, you can have a counter that determines how long before it moves 1 pixel.

Or you could try decimals...

Then again the smooth movement problem might be because you have a wonky framerate and your movement routines are highly framerate variable.

Comment by Cthulhu32 on 2005-09-09 01:13

Thanks for the advice, I know what you're saying about the position. I know how to take care of that fortunately, but the problem I think was my math. I'm now going to try the math.sin(math.pi*i) method, using a true sin wave. Because you know between i = 0 to 0.5 (or 1/2) sin is 0..1, between i = 0.5 to 1.0 sin is 1..0, between i = 1.0 to 1.5 sin is 0..-1, and finally between i = 1.5 to 2.0 sin is -1..0.
anyways, I'll keep working on it and get a .zip up (anyone have a suggestion where to host it?)

Comment by Richard Jones on 2005-09-09 01:32

Animation is always going to be the best-controlled if you "deltat = self.clock.tick(TARGET_FPS)" and then use the deltat to animate things. Use floats.