Be a Supporter!

Making something arc?

  • 271 Views
  • 10 Replies
New Topic Respond to this Topic
lunardragon96
lunardragon96
  • Member since: Oct. 28, 2007
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Making something arc? 2009-03-22 17:48:20 Reply

So, I'm working on a game called Grenadier. Now, the idea of the game is that the only weapons are grenades, in surrealistic variations (IE: Ice grenades, Electricity grenades, flashbombs...)
The problem is, I don't know how to make a Movie Clip go in an arc, and the game would suck if grenades just kept going straight. I'm using flash CS4. Help please?


PEW PEW LASERS
Waaaaaaaaaay original sig by this awesome guy.

BBS Signature
fluffkomix
fluffkomix
  • Member since: May. 5, 2008
  • Offline.
Forum Stats
Member
Level 11
Animator
Response to Making something arc? 2009-03-22 17:51:56 Reply

two different ways.

one is to use a motion guide, but i dont like using them as they clutter up my layers.

the second is to make a motion tween of a grenade from start point to end point. then in the middle of the motion tween, make a keyframe and put it in the top of the arc. then do it again putting the grenade in the middle of the two points, again and again until you have a nice arc going


Sig made by me
Once again i'm falling down a mountain like a metaphor
Here ends another post by the grand master of all things: fluffkomix

BBS Signature
lunardragon96
lunardragon96
  • Member since: Oct. 28, 2007
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Making something arc? 2009-03-22 17:55:19 Reply

At 3/22/09 05:51 PM, fluffkomix wrote: the second is to make a motion tween of a grenade from start point to end point. then in the middle of the motion tween, make a keyframe and put it in the top of the arc. then do it again putting the grenade in the middle of the two points, again and again until you have a nice arc going

Wait, do I do that in the Grenade MC or the stage?


PEW PEW LASERS
Waaaaaaaaaay original sig by this awesome guy.

BBS Signature
fluffkomix
fluffkomix
  • Member since: May. 5, 2008
  • Offline.
Forum Stats
Member
Level 11
Animator
Response to Making something arc? 2009-03-22 17:57:50 Reply

well since you're doing it in a game, its best to do it in the grenade MC then put stop at the end adding the explosion in the grenade MC


Sig made by me
Once again i'm falling down a mountain like a metaphor
Here ends another post by the grand master of all things: fluffkomix

BBS Signature
lunardragon96
lunardragon96
  • Member since: Oct. 28, 2007
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to Making something arc? 2009-03-22 18:00:57 Reply

At 3/22/09 05:57 PM, fluffkomix wrote: well since you're doing it in a game, its best to do it in the grenade MC then put stop at the end adding the explosion in the grenade MC

I see...
How do I make it so that if the grenade hits something, it blows up?


PEW PEW LASERS
Waaaaaaaaaay original sig by this awesome guy.

BBS Signature
dudejonne
dudejonne
  • Member since: Sep. 13, 2008
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Making something arc? 2009-03-22 18:04:04 Reply

If it hittest a enemy then delete the grenade and attachmovieclip a explosion to the x and y of the grenade?

fluffkomix
fluffkomix
  • Member since: May. 5, 2008
  • Offline.
Forum Stats
Member
Level 11
Animator
Response to Making something arc? 2009-03-22 18:05:39 Reply

well make the explosion an additional MC, then have it inside the grenade animation with stop AS at the end.

then have a hitTest in the enemy that says if it hits the explosion gotoandplay death animation


Sig made by me
Once again i'm falling down a mountain like a metaphor
Here ends another post by the grand master of all things: fluffkomix

BBS Signature
zuperxtreme
zuperxtreme
  • Member since: Jan. 2, 2005
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to Making something arc? 2009-03-22 18:07:30 Reply

Trigonometry!

http://www.kirupa.com/developer/actionsc ript/trigonometry.htm


BBS Signature
fluffkomix
fluffkomix
  • Member since: May. 5, 2008
  • Offline.
Forum Stats
Member
Level 11
Animator
Response to Making something arc? 2009-03-22 18:07:35 Reply

nvm i was thinking of having the explosion on the ground indefinitely like in a flat level. what the other guy said.


Sig made by me
Once again i'm falling down a mountain like a metaphor
Here ends another post by the grand master of all things: fluffkomix

BBS Signature
liam
liam
  • Member since: Dec. 11, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to Making something arc? 2009-03-22 18:07:57 Reply

The best way to do it is to use AS. If you make the y higher (i.e., close to the bottom of the flash) then the grenade will fall. Quite simple =o


Sup, bitches :)

BBS Signature
Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to Making something arc? 2009-03-22 18:30:15 Reply

At 3/22/09 06:07 PM, liaaaam wrote: The best way to do it is to use AS. If you make the y higher (i.e., close to the bottom of the flash) then the grenade will fall. Quite simple =o

Aye. Use an xvel, which may or may not be affected by air friction (*0.98 or so) and a yvel, which depends on the launch trajectory but is affected by a variable gravity (generally between +.5 and +2 every frame is a good bet)


- - Flash - Music - Images - -

BBS Signature