00:00
00:00
Newgrounds Background Image Theme

Jmurr12 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

As: Following/shooting At Mouse

33,940 Views | 190 Replies
New Topic Respond to this Topic

Response to As: Following/shooting At Mouse 2006-07-11 21:56:21


youd think more people would post here.anyway i tried to make a "turret"out of the arm of a stick figure thats holding a gun.but it doesnt work because no matter how i convert it into an mc it always puts the cursor at the shoulder.any ideas?


We are the resistance, we are the underground, we are Newgrounds: home of the original cock joke.

The world takes everything too seriously.

This is not a signature.

Response to As: Following/shooting At Mouse 2006-07-22 15:27:40


The turret tracks my mouse, but for some reason won't shoot. Why is this?

Response to As: Following/shooting At Mouse 2006-07-24 02:46:46


Is there any way to modify this script to make the gun follow a movie clip?
I'm using it for a cannon in a game i'm making with Taro Nuke


BBS Signature

Response to As: Following/shooting At Mouse 2006-07-24 04:24:00


At 7/24/06 02:46 AM, Hoeloe wrote: Is there any way to modify this script to make the gun follow a movie clip?
I'm using it for a cannon in a game i'm making with Taro Nuke

switch all the _xmouse and _ymouse 's for movieclip._x and movieclip._y

Response to As: Following/shooting At Mouse 2006-08-01 05:01:29


!PLEASE RESPOND!
The hittest that was posted before worked, but i want (_x,_y,true) hittest but it wont work. Help me.

Response to As: Following/shooting At Mouse 2006-08-25 23:08:18


how do I make enemys come out randomly from the sides

Response to As: Following/shooting At Mouse 2006-08-30 13:31:32


My gun had dislexia, my mouse is in a totally different positon than the tip of my gun, therefor, the bullet comes out of the handle =(

Denvish, the world needs you.

Response to As: Following/shooting At Mouse 2006-09-03 22:50:11


this sucks........its not shooting!


Blok' Party, Orbital Khaos, site, MSMstudios, Phrozen Phlame

BBS Signature

Response to As: Following/shooting At Mouse 2006-09-04 12:42:34


What if I wanted to make a walking dude that holds said turret?

Response to As: Following/shooting At Mouse 2006-09-04 12:44:32


And how do I make it automatic?

Response to As: Following/shooting At Mouse 2006-09-10 10:51:22


Is it possible to make the bullet to hit something like a enemy? then how?

Response to As: Following/shooting At Mouse 2006-09-10 14:30:12


And like a wall so it can bounce?

Response to As: Following/shooting At Mouse 2006-10-03 03:05:50


My gun is inside a movieclip that you can control and move..

Hoever, the gun does not follow the mouse? Can anyone fix this problem?

The gun just goes crazy and spins in completely oposites directions ect..

Response to As: Following/shooting At Mouse 2006-10-04 02:24:34


At 10/3/06 03:05 AM, Claytron wrote: My gun is inside a movieclip that you can control and move..

Hoever, the gun does not follow the mouse? Can anyone fix this problem?

The gun just goes crazy and spins in completely oposites directions ect..

Ive got the same problem, if you change: _rotation = int((radAngle*360
to _rotation = int((radAngle*720

Then its better it spins around half way not just a quarter, however putting it up any more makes it really hard to control.

If anyone can find a better fix then please help.


BBS Signature

Response to As: Following/shooting At Mouse 2006-10-18 08:56:29


Maybe it's a little late... when the turret is in an MC change this:

Xd =_root._xmouse-_x; //Get _x distance from gun to mouse
Yd =_root._ymouse-_y; //Get _y distance from gun to mouse

into this:

Xd =_parent._xmouse-_x; //Get _x distance from gun to mouse
Yd =_parent._ymouse-_y; //Get _y distance from gun to mouse

Now it's following correctly but i couldn't get it to fire... :(

Response to As: Following/shooting At Mouse 2006-10-21 19:33:59


Hey i got your action script too work and everything, but wheres a tutorial that will show me how to make them explode or die when I hit an emeny with the bullets and possibly add points to my score.

Response to As: Following/shooting At Mouse 2006-10-21 19:38:15


just make the person a movie movie clip.
one the first frame have a button with them on it and the as to be
stop();

on the button put
on (release){
gotoAndPlay(2);
}

then make 2-whatever
the person dyiing a horrible blood filled death

Response to As: Following/shooting At Mouse 2006-10-21 19:41:18


I want my bullets to kill with hit.test and its not working can you help me with that?

Response to As: Following/shooting At Mouse 2006-10-29 16:42:09


Denvish,now that you made this how about making one about enemies?I mean what if some people(like me) wan't to make enemies?I suggest you do it.


hello

Response to As: Following/shooting At Mouse 2006-10-29 16:45:19


Yeah and I need the bullets able to kill enemies too.You know what I mean:shoot bullet at enemie,enemie dies.Help me out here.


hello

Response to As: Following/shooting At Mouse 2006-10-29 16:46:43


At 10/29/06 04:42 PM, Kaneyedoit wrote: Denvish,now that you made this how about making one about enemies?I mean what if some people(like me) wan't to make enemies?I suggest you do it.

You'll be lucky to find Denvish much around here now :( Plus, AS: Main is not being expanded anymore. And, there's already a tutorial on that :)

http://www.newground../topic.php?id=472641

Response to As: Following/shooting At Mouse 2006-10-29 16:49:54


At 10/21/06 07:33 PM, sherbert2 wrote: Hey i got your action script too work and everything, but wheres a tutorial that will show me how to make them explode or die when I hit an emeny with the bullets and possibly add points to my score.

Ditto.


hello

Response to As: Following/shooting At Mouse 2006-11-04 11:15:56


Denvish how do you get the hit Test to work in the bullet MC.I tried but it won't work.Need help some one look at this and help me.


hello

Response to As: Following/shooting At Mouse 2006-11-04 11:20:45


At 9/6/05 04:54 PM, liaaaam wrote: Click me plz

How did you get the platformer to scroll!?!?

Response to As: Following/shooting At Mouse 2006-11-17 00:05:22


TO SOLVE EVERYBODY'S PROBLEMS:

- Turrets inside MCs screwed up:
Change MC coordinates to global coordinates. Look it up in Flash Help.

- Tracks mouse perfectly but faces wrong direction:
Turret needs to face UP.

- Turret doesn't rotate on center:
MCs rotate on the REGISTRATION POINT, which is the little black + in them. You have to move the entire MC graphic to center on the +.

- Turret is screwed up:
Make sure you copied the rotate to mouse bit PERFECTLY.

-Turret doesn't shoot:
Check that the instance name of the turret is "gun" without quotes, the bullet is "bullet" without quotes, and make sure you got ALL the code in the RIGHT place.

duh.

Response to As: Following/shooting At Mouse 2006-12-14 17:32:40


I hope you're going to spend some time actually understanding the code, rather than just copy/pasting it...

It's gonna be changed a lot but.............

Response to As: Following/shooting At Mouse 2007-01-15 15:21:44


how could I do this

_root.onKeyDown=function(){

and tell it to use the (0) key?


PLEASE IGNORE MY USERNAME. If I knew what it was going to mean in a few years. I JUST MADE UP A RANDOM WORD FOR GODS SAKE!!!.......................this sucks.

Response to As: Following/shooting At Mouse 2007-01-24 15:45:46


I love this code and however there is one problem that I had. I want the bullets to start their path at the end of the gun barrel. What I did was make the tip of my cannon into a movie clip which i gave the instance name "barrel", then i changed the starting bullet coordinates to _root.gun.barrel._x and _root.gun.barrel._y .. however the bullets will not show up when I do this. I suspect it has something to do with global vs MC coordinates, but I am not sure how to fix this? anyone know how?

Response to As: Following/shooting At Mouse 2007-01-24 16:24:52


who revived this thing?

Response to As: Following/shooting At Mouse 2007-02-13 15:14:03


At 9/6/05 05:05 PM, Denvish wrote:
At 9/6/05 05:03 PM, T-H wrote: What does int() do ? I've never used it.
Converts up or down to nearest integer.
There's a Math. function that does the same thing, I think, but I prefer int().... less to type, cos I'm a lazy bastard.

I believe it's the Math.rint() function.

E.G.: var someVar:int = Math.rint(2.336);