Hey I am in trouble here
I've used the tutorial you have given at the Front Page
and when I put the gun mc in the character mc it does not works
help!!!!!!!!!!!!!!!!
At 12/5/07 04:41 PM, Psycho wrote: Not sure if it's been mentioned before, but if the pointing at mouse code is given to a movieclip inside another movieclip, it messes up. I tried playing around with the code, but have no idea what to change.
Basically you're making point towards the _x of the movie clip. Instead of _root._xmouse you put: _root.MC_INSIDE._xmouse. So the MC the turret is inside would ahve the instance name of MC_INSIDE
Therefore the code would be:
onClipEvent (mouseMove) {
Xd =_root.MC_INSIDE._xmouse-_x;
Yd =_root.MC_INSIDE._ymouse-_y;
radAngle = Math.atan2(Yd, Xd);
_rotation = int((radAngle*360 / (2*Math.PI))+90);
updateAfterEvent();
}
Im trying to have multiple, but this code doesnt seem to work. Can anyone help?
var bc = 1000;
_root.onMouseDown = function() {
bc++;
if (bc>1100) {
bc = 1000;
}
duplicateMovieClip("bullet", "b"+bc, bc);
};
var bc = 1000;
_root.onMouseDown = function() {
bc++;
if (bc>1100) {
lc = 1000;
}
duplicateMovieClip("laser", "l"+bc, bc);
};
var bc = 1000;
_root.onMouseDown = function() {
bc++;
if (bc>1100) {
lc = 1000;
}
t
duplicateMovieClip("laser1", "l1"+bc, bc);
};
ok so heres for all the people who have wondered how to make it so you can fire auto but it fire every other second. Well here we go
put this code on your gun
onClipEvent(load) {_root.timer = 0}
onClipEvent(enterFrame){_root.timer++}
So timer is the var telling when it can shoot or not
so heres the bullet code. Bare with me as i try to explain
var bc = 1000;
//Bulletcount
var shooting = false;
//shooting boolean/trigger basicaly
var timer = 0;
//timer
var d = 0;
//delay time in shooting
_root.onMouseDown = function() {
shooting = true;
};
onEnterFrame = function () {
if (shooting) {
bc++;
//sets the bullet count higher so that it dosent over lap each time
if (bc>1200) {
bc = 1000;
//if you shoot more then 200 bullets then it will destroy them
}
if (timer>=1) {
//if the timer is greater then 1 it will shoot
duplicateMovieClip("bullet", "b"+bc, bc);
//creates the duplicate of the bullet
timer = -d;
//this is where the delay comes in.
}
}
};
onMouseUp = function () {
shooting = false;
//your not shooting anymore
};
as you can see i would mess around with the D var, so that you can have a diff type of delay. For me i did a code that reloved around my gun
ex:(might not work)
put on gun
onClipEvent(load) {
_root.gun = "pistol"
}
onClipEvent(enterFrame) {
if(_root.gun =="pistol") {
_root.d = blah(make it w/e you want)
this.gotoAndStop("pistol")
}
}
Thats about it. I hope it works for you.
Gimme me a script that makes the player cover and not cover then continue shooting..
Mystery is singing some crap and ugly songs xD Joking!
At 1/17/08 09:26 PM, cashleycool wrote: Gimme me a script that makes the player cover and not cover then continue shooting..
Dude..
At 12/16/07 06:27 PM, Healthy wrote:
Instead of putting in a delay, why not just have bc += something_less_than_1?
Hey guys i need the code for making a guy go on a track and gravity
At 1/17/08 09:26 PM, cashleycool wrote: Gimme me a script that makes the player cover and not cover then continue shooting..
No...but please make your own.
At 2/5/08 12:39 PM, taco857 wrote: Hey guys i need the code for making a guy go on a track and gravity
Good for you, now learn to actionscript and return with a real question!
Cool. I might be able to use this in the future.
Is it possible to do this with attachMovieClip instead of duplicate though?
"Be peaceful, be courteous, obey the law, respect everyone; but if someone puts his hand on you, send him to the cemetery"
Hey, thanks man! The other tutorials I saw for this stuff spanned 10 or so pages and were unclear, so you've really saved me heaps'a time!
Sorry to be a pester. In fact this is the first time a script like this has worked for me. but I do have a question. Is there anyway i can get the bullet to not appear until its outside the range of the gun. Cuz i made a tank and i noticed that the bullet came out of the buttom of the turret. So i tried to make a whole outline around it and mask it (xD). Then i tried to make a seperate barrel inside the turret so they wud both rotate but instead the barrel only rotated in a weird way (like the guy above me mentioned. so if any1 can tell me how to hide the bullet until its outside the barrel that wud be great.
(im no good at actionscript but i did what you said and end up understanding around a quarter of the code...wudnt know how to reproduce it for my life tho.
At 9/6/05 08:51 PM, CUCKA-DUDE wrote: Thanks, i had already posted a game at
http://img377.images..ssinteractive8ee.s wf
CLick the gun to shoot.
It didn't Seem to work for me, and the gun rotates on the wrong point. Break the MC Apart then remake it with the registration in the centre.
At 3/8/08 10:20 AM, Serpent60 wrote: It didn't Seem to work for me, and the gun rotates on the wrong point. Break the MC Apart then remake it with the registration in the centre.
Look before you bump dude. That guy must have figured out his mistake by now seeing as its been three years.
Hey.. if anyone can get me a script for reloading.. because I tried my own.. but it doesn't work. so if you can... could you make a script of this with the gun reload/limit. Thank you, and yes, I did try the ones before this post, they won't work. Please help.
I can make the gun rotate and all, even shoot rapid fire but I can't make the bullets appear from the muzzle flash, this is really getting annoying, can anyone please help?
At 9/6/05 04:54 PM, liaaaam wrote: Click me plz
Good tutorial =D
du u have a tutorial on making that? i made a game and i cant make him shoot and move like that
thanks man im using this for an army game.
and wouldn't it be better if you make bullet count do this
var bc = 1000;
_root.onMouse = function() {
<bold>bc--;
if (bc<100) {
bc = 1000;
}</bold>
duplicateMovieClip("bullet", "b"+bc, bc);
}
so it minus and make a dynamic box so you can see how many bullets you have
just a thought, thanks again
At 4/13/08 11:10 AM, coreymaroc wrote:
<bold>bc--;
if (bc<100) {
bc = 1000;
}</bold>
just without the bold in it
My character no longer aims towards the mouse.
He aims at approximately a 90 degree angle upward from where my mouse is located.
Help please?
I can't figure this out. OK I will use a visual for explanation. I want my gun to rotate from where the green dot is and I need the bullets to come from the red dot. Please help, nothing I have tried works.
Hey Denvish can I use ur code in a game that contains Newgrounds API (Flash Ad's); I though I'd ask you since it is your work. I'll PM you about it to.
At 5/15/08 10:01 AM, Brycearoni wrote: Hey Denvish can I use ur code in a game that contains Newgrounds API (Flash Ad's); I though I'd ask you since it is your work. I'll PM you about it to.
Although good practice to ask developers about using their code. You don't have to ask to use anything in the AS:Main that is why it was created.
...
So, how would I go about making the shooting a little bit more random? Like a spray?
Really informative, nice one denvish =)
great guide but I have a problem!! all of the angles r realy messed up and My player shoots the bullets 90 degrees right of my mouse. ive tried to change the angles but its still doesnt work. any help?
can someone please JUST make a sidescroller shooter tutorial please