swatterused = false;
points = 0;
speed = 4;
stop();
b = 2000;
a = 2000;
start = false;
var timer:Number = setInterval(Poop, a);
var cap:Number = d;
var numberOfMovieclips:Number = 0;
function Poop2():Void {swatterused = false;
clearInterval(b);}
function Poop():Void {
bubble = _root.attachMovie("bubble", "bubble"+numberOfMovieclips++, _root.getNextHighestDepth());
bubble._y = -50;
bubble._x = Math.random()*500+0;
bubble.dead = false;
bubble.onEnterFrame = goLeft;
numberOfMovieclips = 0;
function goLeft():Void {
if (!this.dead) {
this._y += speed;
} else if (numberOfMovieclips<=1) {
numberOfMovieclips = 0;
}
if (this._y>=600 && this.dead == false) {
removeMovieClip(this);
this.dead = true;
} else {
this.dead = false;
}
if (_root.swatter.hitTest(this) && Key.isDown(1) && swatterused == false) {
_root.swatter.gotoAndStop(1);
setInterval(Poop2, b);
swatterused = true;
removeMovieClip(this);
points += 1;
} else {
this.dead = false;
}
}
}
Mouse.hide();
startDrag(swatter, true);
Right now, all of the bubble MCs that spawn are above the swatter mc, and the swatter MC is what the mouse cursor is replaced with, so it's supposed to be on top of all spawning bubble MCs.
I'm also not sure about a timeout after you swat, so you can't just hold down the mouse button, help is appreciated.