The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.36 / 5.00 33,851 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 12,195 ViewsSup guys! i need help right now!
I have a Script Here:
onClipEvent (mouseDown) {
if (shootable == true)
{
theX = this._x;
theY = this._y;
_root["bullet" + bulletsFired - 1].removeMovieClip();
_root.attachMovie("bullet","bullet" + bulletsFired,_root.getNextHighestDepth(),{_x:this._x, _y:this._y});
_root["bullet" + bulletsFired].bulletSpeed = 30;
_root["bullet" + bulletsFired].xmov = Math.cos((Math.atan2(_root._ymouse - _y, _root._xmouse - _x)) * (180 / Math.PI) * (Math.PI / 180));
_root["bullet" + bulletsFired].ymov = Math.sin((Math.atan2(_root._ymouse - _y, _root._xmouse - _x)) * (180 / Math.PI) * (Math.PI / 180));
_root["bullet" + bulletsFired].xmov *= _root["bullet" + bulletsFired].bulletSpeed;
_root["bullet" + bulletsFired].ymov *= _root["bullet" + bulletsFired].bulletSpeed;
bulletAngle = ((_root.player._rotation - 90) * Math.PI / 180);
_root["bullet" + bulletsFired]._rotation = bulletAngle;
_root["bullet" + bulletsFired].onEnterFrame = function()
{
this._x += this.xmov;
this._y += this.ymov;
if(_root["bullet" + bulletsFired].hitTest(_root.zombie)){
unloadMovie(_root["bullet" + bulletsFired]);
}
};
bulletsFired++;
shootable == false;
Shootable_Timer = setInterval(shooot, 10000);
}
function shooot()
{
shootable == true;
}
}
How do i make so that bullet removes when it touch the _root.Zombie?
13 Years old. I like Programming and making musics!
13 Years old. I like Programming and making musics!
i think no one wants to help me :P
13 Years old. I like Programming and making musics!
Be patient. It's not a rush.
At least not a muffin.
At 8/4/12 06:02 AM, doodle-bread14 wrote: Be patient. It's not a rush.
I think you are the only one that replied ;)
13 Years old. I like Programming and making musics!
At 8/4/12 06:10 AM, TheeCoffee wrote:At 8/4/12 06:02 AM, doodle-bread14 wrote: Be patient. It's not a rush.I think you are the only one that replied ;)
Waiting for an Answer :(...
13 Years old. I like Programming and making musics!
At 8/4/12 07:03 AM, TheeCoffee wrote:At 8/4/12 06:10 AM, TheeCoffee wrote:Waiting for an Answer :(...At 8/4/12 06:02 AM, doodle-bread14 wrote: Be patient. It's not a rush.I think you are the only one that replied ;)
I don't think most people want to mess around with AS2 stuff. They prefer to deal with AS3 issues.
This is AS1, notice the onClipEvent
Just an FYI.
I'll look at it for a second though and see what's up
At 8/4/12 10:52 AM, Truimagz wrote: This is AS1, notice the onClipEvent
oh, dear god. Somebody get this man FD.
and thanks for helping, I already helped solve his last issue.
Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P
At 8/4/12 10:54 AM, egg82 wrote:At 8/4/12 10:52 AM, Truimagz wrote: This is AS1, notice the onClipEventoh, dear god. Somebody get this man FD.
and thanks for helping, I already helped solve his last issue.
Thanks guys. i use AS1 & AS2. Both :P
13 Years old. I like Programming and making musics!
Here you, but please never paste code on clips again.
Add this to the frame where the clip is, but not on the actual clip.
var bulletsFired = 0;
var bulletSpeed = 30;
this.onMouseDown = function ( ) {
_root.attachMovie("bullet", "bullet" + bulletsFired, _root.getNextHighestDepth(), {_x:_root.player._x, _y:_root.player._x});
_root["bullet" + bulletsFired].xmov = Math.cos((Math.atan2(_root._ymouse - _y, _root._xmouse - _x)) * (180 / Math.PI) * (Math.PI / 180));
_root["bullet" + bulletsFired].ymov = Math.sin((Math.atan2(_root._ymouse - _y, _root._xmouse - _x)) * (180 / Math.PI) * (Math.PI / 180));
_root["bullet" + bulletsFired].xmov *= bulletSpeed;
_root["bullet" + bulletsFired].ymov *= bulletSpeed;
_root["bullet" + bulletsFired]._rotation = ((_root.player._rotation - 90) * Math.PI / 180);
_root["bullet" + bulletsFired].onEnterFrame = function ( ) {
this._x += this.xmov;
this._y += this.ymov;
this.hitTest(_root.zombie) ? this.removeMovieClip() : null;
this._x > Stage.width ? this.removeMovieClip() : null;
this._y > Stage.height ? this.removeMovieClip() : null;
this._x < 0 ? this.removeMovieClip() : null;
this._y < 0 ? this.removeMovieClip() : null;
}
bulletsFired++;
} You'll have to fiddle with the rotation, I was rushed and it prolly wont work, not itme ot open flash and I havent written as1 in years
At 8/4/12 11:22 AM, Truimagz wrote: Here you, but please never paste code on clips again.
Add this to the frame where the clip is, but not on the actual clip.
well done, sir.
Though I might suggest that instead of using a hitTest, you should check to see if an enemy is along the path the bullet is taking. This will eliminate false negatives when dealing with hitting enemies with the bullet.
the reason for this is because when the bullet moves at 30 pixels per frame, there's an entire 30 pixel gap between the bullet's movement that an enemy can easily hide in.
Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P