The Daily Click ::. Forums ::. Klik Coding Help ::. 360 degree shooting
 

Post Reply  Post Oekaki 
 

Posted By Message

Louis Moon



Registered
  24/10/2002
Points
  116
2nd May, 2004 at 20:37:38 -

I know this has been asked in this forum before, but how do you do 360 degree shooting? I have TGF and do have the advanced math object.

This is all I know about triangles-
-they have 3 sides
-in a right angle triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides
-interior angles add up to 180 degrees

Can someone please explain what sine and cosine are, and their significance in a 360 degree formula?

 
n/a

James Brothmen



Registered
  06/04/2004
Points
  11
2nd May, 2004 at 21:14:31 -

sohcahtoa

acronym-
sine of an angl e= opp/hyp
cos of an angle = adj/hyp
tanof an angle = opp/adj

opp=opposite side
adj=ajacent side
hypp=hypotenuse side



 
n/a

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
3rd May, 2004 at 05:49:18 -

I've done 360 degrees shooting before, but it's still not accurate enough. I've seen 3600 degrees before aswell. Could someone tell me how to do more than 360 degrees shooting\movement?

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
3rd May, 2004 at 06:22:45 -

If you do 360 degree shooting properly, then it's actually infinite directions, because you can specify a decimal angle like 47.736484 degrees to shoot at.
The formula is:
New X = X + (Cos(Angle) * Speed)
Speed is the number of pixels it will move per event read.
Same for Y but with Sin.

Image Edited by the Author.

 
- Tigerworks

Arf :: FPP Games



Registered
  15/05/2002
Points
  1364
3rd May, 2004 at 07:03:31 -

Yeah, with decimals you can have more accuracy than just 360 degrees. Although what you're referring to Andy is probably the direction object that came in the MMF bonus pack, which lets you choose how many directions you want.

 
n/a

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
3rd May, 2004 at 07:23:26 -

and it's called triganometry, not sohcahtoa!

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
3rd May, 2004 at 14:26:59 -

I do it the cheap way using fastloops to tag a bullet object and a target object with the same Number and always have the bullet look at the target, it's a cheap way of doing it, but it works pretty well once you fool around with it enough.

 
Craps, I'm an old man!

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
4th May, 2004 at 02:43:42 -

Arf - It wasn't the movement extension. I downloaded an example from the CT boards showing how much more accurate 3600 angles were than 360. I'll take another look at the example.

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Hagar

Administrator
Old klik fart

Registered
  20/02/2002
Points
  1692

You've Been Circy'd!Teddy Bear
4th May, 2004 at 14:01:44 -

I'll post a tutor when i finally get 5 minutes free (quite an hard feat at the mo )

 
n/a

Louis Moon



Registered
  24/10/2002
Points
  116
4th May, 2004 at 16:57:13 -

James and Chicken- I know what the hypotenuse, adjacent, and opposite are, but what exactly is the "opposite over hypotenuse" and etc. acutually referring to? The length of the sides?

Tigerworks- How do you work out the cosine and angle?

 
n/a

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
4th May, 2004 at 17:46:21 -

Yes, it's referring to the length of the sides.

 
http://www.klik-me.com

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
4th May, 2004 at 18:29:45 -

To work out Cosine: Use the Advanced Math Object, or use the built-in expression if you have MMF.

Angle = the angle you want to shoot the bullets in... from 0 to 360.

 
n/a

Cazra

Crazy?

Registered
  24/07/2002
Points
  4472

Game of the Week WinnerVIP Member
4th May, 2004 at 18:48:26 -

Cos=1 on angle: 0° (right)
Cos=0 on angles: 90° and 270° (up and down)
Cos=-1 on angles: 180° (left)

multiply your speed by the Cos of your player's angle to get its X speed.

Sin=1 on angle: 90° (up)
Sin=0 on angles: 0° and 180° (right and left)
Sin=-1 on angles: 270° (down)

multiply your speed by the Maester Seymour...erm...Sin of your player's angle to get its Y speed.

 
n/a

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
5th May, 2004 at 02:12:07 -

sohcahtoa is easy to remember?

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy
   

Post Reply



 



Advertisement

Worth A Click