PDA

View Full Version : Two questions!


Chronos
06-11-2003, 04:31 PM
I know that all I do is ask questions around here, and once I'm a lil' better hopefully I can start answering some :).


1 Ok, I wrote a simple pong-like game to test some stuff out, and I noticed that the ball moves around kind of choppy if it's not going slow, is there some way (with flash) to get a faster movement and still have it move smoothely?

Here's the pong game. (http://www.raptisoft.com/flash/pongg.swf)

2 This is a kind of dumb question, but here goes.. I noticed that you need to click inside the flash animation before it responds to the keyboard. Is there any way to automate this?

Once again, thank you guys alot for helping me :).

Sualdam
06-11-2003, 04:53 PM
Two questions back :)

What's the frame rate of your movie?

What code are you using to move the ball (and bat - that looks choppy too)?

Fugee
06-11-2003, 04:57 PM
the problem with the 'choppy' animation is that you are probably using an onEnterFrame callback...a simple way to make it smoother is simply to increase your document's fps :p

oh! and if you're checking the collisions with the hitTest method you could actually use 'ball._x + ball._width/2' and 'ball._y + ball._height/2' (ball is the name of your bouncer mc, and of course height and width are the same here but... :p) so that the ball doesn't clip your walls but seems to bounce off as soon as the border touches these ;)