Posted By
|
Message
|
infinitum3d
Registered 03/03/2012 22:18:24
Points 66
|
3rd March, 2012 at 03/03/2012 22:31:01 -
I'm using TGF2 to make a tower defense game. I have an Archer on a Tower and an attacking Thief. I can pivot the Archer (follows the mouseXY) but when I use the Shoot function, it just shoots straight across. I can't find anything for aiming at MouseXY when mouseClick.
Any ideas?
Thanks!
n/a
|
s-m-r Slow-Motion Riot
Registered 04/06/2006
Points 1078
|
4th March, 2012 at 04/03/2012 02:43:33 -
Although I have MMF2 and not TGF2, I reckon you can do the same thing. I also recommend Sketchy's 360-degree shooting engines to integrate into this, but it requires some extensions that may not be available in TGF2. In the meantime, do the following, and it should work...
- create a small "crosshair" object
- create an 'always' event to make the crosshair follow the position of the mouse cursor
- when the player clicks the mouse, have the archer shoot at the crosshair object
n/a
|
infinitum3d
Registered 03/03/2012 22:18:24
Points 66
|
4th March, 2012 at 04/03/2012 16:45:32 -
Brilliant! Works perfectly. Thanks!!!
n/a
|
infinitum3d
Registered 03/03/2012 22:18:24
Points 66
|
4th March, 2012 at 04/03/2012 19:58:31 -
So now my arrow only faces right, even when firing up or down. I tried setting it's rotation to match the archers but it doesn't work.
Any ideas?
Thanks!
n/a
|
nivram
Registered 20/07/2006
Points 171
|
5th March, 2012 at 05/03/2012 00:26:12 -
Originally Posted by infinitum3d So now my arrow only faces right, even when firing up or down. I tried setting it's rotation to match the archers but it doesn't work.
Any ideas?
Thanks!
Make a small active with how many directions you need. Have it always follow the main dude. When you get ready to fire put your active to the direction you want and have the arrow face in the direction of your active.A lot less hocus pocus to deal with.
Marv
458 MMF2 & CTF 2.5 examples and games
http://www.castles-of-britain.com/mmf2examples.htm
|
s-m-r Slow-Motion Riot
Registered 04/06/2006
Points 1078
|
5th March, 2012 at 05/03/2012 17:10:07 -
Originally Posted by infinitum3d So now my arrow only faces right, even when firing up or down. I tried setting it's rotation to match the archers but it doesn't work.
Any ideas?
Thanks!
That's why all my bullets are always round objects.
But I'll have to try out Nivram's suggestion. Or maybe there's some way to do it in MMF2 that's not available in TGF2, I don't know.
n/a
|
infinitum3d
Registered 03/03/2012 22:18:24
Points 66
|
6th March, 2012 at 06/03/2012 00:51:55 -
I used an Alterable Value (a simple Boolean variable). If inFlight = false, rotate arrow to face crosshairs. If inFlight = true, do nothing.
n/a
|
|
|