Hello.
I’m trying to get into programming Actionscript 3, but I’m still having a lot of difficulties. I’m currently trying to make a small platform game. I just want to create a ‘guy’ (ball, rectangle) and have the ability to move him around the stage, on which I would place several objects.
I’m doing it like this:
There’s a main class, GameControl.as, which places the ball, reads and makes the map. This class also listens for any keys being pressed, and pass that information to the Guy.as class. He will then change his x- and yspeed accordingly. Is this a good way to check for keys, and pass them on? Or should I add the keyboardListener to the Guy class?
Also, I’m still having lots of troubles checking for collisions. Let’s take the example with the guy being a ball. When I just place it in the air (not on the ground) it will fall towards the ground obstacle (I added some gravity to the ball, each frame). Then when it touches the ground it will bounce back up (by multiplying the yspeed by -1). After some time however the ball will either float a bit in the air, or make his way through the obstacle slowly, until it’s below it. I don’t know how to go about this, any hints please?
If there’s any other questions because I’m being vague, don’t hesitate to ask. I could really use some help, thanks in advance.
Maqrkk