In need of help on game
pixelpowervfx
Member Posts: 8
We are developing a shooting game, we want to have a character on the left side of our screen have the ability to aim and shoot enemies that are approaching from the right side of the screen. We want to develop a targeting system where you can have on screen crosshairs anywhere you point the mouse and hover over an enemy. How do you create the mouse target so that the target follows under the mouse pointer? Also how do you get a bullet (actor) to shoot in the direction of where you point the mouse, but continue to go beyond target point if there is no hit? Any and all help would be awesome. I am a Newbie with a lot of passion.
Comments
As for the bullets, you can make a rule in your player actor,
When mouse button is down,
Timer, every .5 seconds, spawn actor "bullet".
Then in the "bullet" actor create a change velocity behavior,
In the direction expression box put vectorToAngle( game.Mouse.Position.X - self.Position.X , game.Mouse.Position.Y - self.Position.Y )
In the speed expression box, put however fast you want your bullet to go.
It's a bit complicated. Let me know if you have any questions. If you would like, I can whip up a template to demonstrate.
AppTaco LLC
http://www.apptacostudio.com/
https://www.facebook.com/apptacostudio
Complete Guide to iOS Publishing {} Complete Guide to Mac Publishing
Here's a quick demo using some of the suggestions from above: