Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-16-2008, 09:55 PM   #1
TheKillaCon
Registered User
 
Join Date: Jun 2008
Posts: 3
Cool Point & Shoot Gun

Hello, I need the code for a gun (known as "G36c") that points to the cursor ("aim") and when clicked, shoots objects out ("bullet" and "grenade").

Please Help me,
Thanks.

Last edited by TheKillaCon; 06-17-2008 at 05:05 AM. Reason: ...
TheKillaCon is offline   Reply With Quote
Old 06-19-2008, 06:46 AM   #2
mulletchuck
Registered User
 
Join Date: May 2008
Posts: 33
Default

people aren't going to write your code for you. research methods for making an object/movieClip rotate to always point towards the cursor. it's simple trig.
mulletchuck is offline   Reply With Quote
Old 06-19-2008, 06:49 AM   #3
TheKillaCon
Registered User
 
Join Date: Jun 2008
Posts: 3
Default

i tried that, using code that worked b4, however it won't work now
TheKillaCon is offline   Reply With Quote
Old 06-19-2008, 06:56 AM   #4
mulletchuck
Registered User
 
Join Date: May 2008
Posts: 33
Default

so, post the code, and maybe someone with knowledge will help you.
mulletchuck is offline   Reply With Quote
Old 06-19-2008, 07:03 AM   #5
TheKillaCon
Registered User
 
Join Date: Jun 2008
Posts: 3
Default

ActionScript Code:
onEnterFrame=function(){     xdif=_root._xmouse-G36c._x;     ydif=_root._ymouse-G36c._y;     angle=(Math.atan(ydif/xdif))/(Math.PI/180);     if(xdif>0){         G36c._rotation=angle+90;     }if(xdif<0){         G36c._rotation=angle-90;     } }
TheKillaCon is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why doesn't the registration point change? nfh Flash 9 General Questions 16 09-21-2008 11:35 PM
Retaining the positions of a point. 0oMatrixo0 ActionScript 2.0 3 11-23-2007 10:12 PM
Cue Point Help SkyQuest ActionScript 2.0 5 11-02-2007 04:34 PM
Cue point help demerit Components 7 10-25-2007 02:56 PM
Draw a point? Hbegger ActionScript 1.0 (and below) 1 07-09-2001 12:15 AM


All times are GMT. The time now is 12:53 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.