Rotate and aim actor (Gun turret) at touch position on screen
Hello everyone.
I was wondering if anyone had a good template for helping me sort out a constrain actor/aim and shoot problem.
I have a tank actor on screen and when I click on a part of the screen the tank moves to that new position...thats sorted out.
Now, I have also constrained a turret actor to the x & y position of the tank so it sits nicely on top,
My problem now is to incorporate a new aim system so when the tank is static or moving, I want the turret to rotate and aim to any new position the player clicks on the screen (like shoot in this direction)...the turret need to rotate and aiming the direction of where the player clicked. I can then add a fire bullet to this.
Is there a good template or does anyone have a good idea on to active this?
Thanks guys
It takes a Zombie to know a Zombie!!!
Comments
It's not quite what you're after, but perhaps check out my tank demo here as it has (slightly different) turret rotation.
http://forums.gamesalad.com/discussion/70000/armelline-s-free-stuff-for-everyone/
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Thanks Armelline
Will check that out and let u know.
It takes a Zombie to know a Zombie!!!
Thanks Armelline, got the turret rotating nicely now.
I do have a new question.
I have the tank moving to the waypoint but I want the firing bullet to happen when the player drags their finger on the screen using your rotate to rule.
How do I get gamesalad to identify a finger being held down and dragged on the screen?
It takes a Zombie to know a Zombie!!!
Need Help? Email Me | Templates | Full Game Source Code
Need Help? Email Me | Templates | Full Game Source Code