Hi everyone,
I have some questions regarding box2d.
First of all I’m trying to develop a simple game with the use of box2d. The principle of the game is that the user will have a gun (Triangle) which will be placed at the bottom of the screen and asteroids (Box) will fall from the top of the screen, users mission is to shoot the asteroids with the help of the gun.
The game interaction will be simple. When the user touches the screen, he will be able to control the gun’s shooting direction but with the same touch the gun will also start to shoot. So with one touch he can shoot and control the direction. When the bullet hits the asteroid (Box) the asteroid (Box) will disappear from the screen.
The game now is at the stage where the user can shoot bullets with the gun but there are some issues that I haven’t overcame like: I can’t control totally the bullets with the mouse…It’s limited. I’ve also managed to destroy the asteroids when the bullets hits them. My only problem now is how to control the gun(triangle) so it can move with the same direction as the bullets and also make the bullets to be more “neatly” I’ve attached the patch so you can see what I mean. The gun’s(triangle) density is set to 1 so it’s static…but If I change the value to 0 it will have the gravity of the world and it will not stay at the position I want to.
Any help would be great.
Box2d (350.7 kB)