The Daily Click ::. Forums ::. Klik Coding Help ::. Need 360 Degree Help
 

Post Reply  Post Oekaki 
 

Posted By Message

_Randall_



Registered
  13/11/2008
Points
  5
17th November, 2008 at 12:50:19 -

Okay, so I’ve been making click games casually for a decent four years now and have only just discovered this community.

I feel like a bit of a tool for even posting this, because I’ve seen a handful of articles and forums on the topic... but something that I have never been able to figure out is 360 degree shooting.

Can anyone please help me out with a basic tutorial on how to make a weapon shoot in the direction of a mouse controlled crosshair?

Open source examples would be greatly appreciated… especially seeing as every other tutorial example I find has either a broken link, is completely useless, or needs a PhD in advanced mathematics to understand haha.

Any help would be greatly appreciated

(Oh, and im running MMF 1.5 if that’s relevant)


 
"This is you're life - and its ending one minute at a time"

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
17th November, 2008 at 13:35:18 -

360 degree bullet widget for mmf2
http://create-games.com/download.asp?id=7414

articles (some with source code)
http://www.create-games.com/article.asp?id=1925
http://www.create-games.com/article.asp?id=1221
http://www.create-games.com/article.asp?id=1322

assuming you're actually 18 as your profile says, you should have at least some knowledge of basic trig. thats pretty much all it is.

 
n/a

NeoMonkey

Finnish Army Fire Commander

Registered
  01/12/2006
Points
  243

VIP Member360 OwnerI am an April FoolPS3 Owner
17th November, 2008 at 19:46:01 -

First make crosshair then place hotspot into center. Now lets say you have your player or weapon. Now you have to place the crosshair into some distance. You can do this by setting the x-coord. with this formula:

Sin(AngleOfPlayer+90)*Distance+PlayerPosX

And Y-coord:

Cos(AngleOfPlayer+90)

Now you have to put hotspot of the player/gun into point, where the the bullet is going to start, and then just shoot object at direction of crosshair.

 
I have proven new mathematic formula to be true...

2D > 3D

Image


AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
17th November, 2008 at 20:37:27 -


Originally Posted by _Randall_
I feel like a bit of a tool for even posting this.



Which one? I feel like a Hammer for responding.

 
.

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
17th November, 2008 at 22:49:38 -


Originally Posted by NeoMonkey
First make crosshair then place hotspot into center. Now lets say you have your player or weapon. Now you have to place the crosshair into some distance. You can do this by setting the x-coord. with this formula:

Sin(AngleOfPlayer+90)*Distance+PlayerPosX

And Y-coord:

Cos(AngleOfPlayer+90)

Now you have to put hotspot of the player/gun into point, where the the bullet is going to start, and then just shoot object at direction of crosshair.



any time you use "shoot object in direction of.." it only uses the built in 32 directions.
you have to use more math to actually make the bullet use 360degrees.

the bullet widget is the best thing to use if you already have mmf2. just use the wdget and all the work is already done for you. the math is in the bullets behavior.

Image Edited by the Author.

 
n/a

_Randall_



Registered
  13/11/2008
Points
  5
18th November, 2008 at 08:57:25 -

Thanks guys, much appreciated =

I know some basic trig, but failing 11th grade maths is stunting my understanding a bit haha.

I think ill just upgrade to MMF 2 and use the widget. Im due for an update anyhow.

 
"This is you're life - and its ending one minute at a time"

alastair john jack

BANNED

Registered
  01/10/2004
Points
  294

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!VIP MemberMushroomI am an April Fool
18th November, 2008 at 11:59:58 -

Yeah MMF2 is quite nice!

 
lol
   

Post Reply



 



Advertisement

Worth A Click