my project is in the attachments.
I'm trying to write a basic dualstick shooter test. Unfortunately I only have the gamepad implemented right now, so testing things out might be hard for people that don't have an x360 controller (I'm attaching screenshots and video though to make matters a bit clearer).
My problem at the moment is the collision detection. I have my sprite "arrow" drawn at an angle i calculate within the "Projectile" class but of course the Rectangle I use to draw the arrow (projectilebox) and to calculate the collision doesn't rotate with the sprite (as shown in the following screenshot):
Besides that the projectilebox itself drawn without any origin or angle values seems to be very far away from the actual arrow i draw.
My collision detection at the moment basically consists of checking whether the hitbox of the ship (shipbox) intersects with the projectilebox, but as this is not in the proper position, the detection is way off :S
So basically my question is: How do I align the projectilebox to properly fit to the sprite (arrow) I draw?
btw: The controls for the executable are: LStick: move ship, RStick: aim, RShoulder: shoot
As soon as the projectilebox hits the shipbox I make the game crash/freeze to be able to see where the box actually hit the ship (this is probably very bad programming, right? )
Here is a video so you may be able to see it a bit more clearly: