Game Actionscript

I was wondering if you could help me with something. I am trying to make a game where you have random objects falling vertically and must land in a bucket. The bucket is controlled by the mouse(it follows the mouse). I have not yet found an appropriate script to perform this action. Please help me out, that would mean a lot to me. Thanks

if you are duplicating the falling thing put in the mc

if(_parent.hitTest(_root.basket)) {
_parent._visible = false;
_root.score += 1;
}

thats how you get them to disappear and add to the score when they hit the basket.

onLoad = function() {
this._x = random(400);
//change 400 to the width of the stage
}

that makes them appear in random spots

onClipEvent(enterframe) {
this._x = _root.xmouse;
}
}

this makes the bucket follow the mouse

wasn’t sure what you were asking, so i answered most everything you stated you were going to do…

if(_parent.hitTest(_root.basket)) {
_parent._visible = false;
_root.score++ //jingman changed to ++;
}
onLoad = function() {
this._x = Math.random()*(Stage.width);
//jingman changed '400' to Stage.width
}
onClipEvent(enterframe) {
this._x = _root._xmouse; // jingman changed to _xmouse
}

Just cleaned it a bit, hope that’s cool Yeldarb.

yeah, that should be _xmouse, shouldn’t it :slight_smile: lol missed that when i re read through my post

no prob, mess with it as you please :slight_smile:

The reply you gave was good untill the hit testing. I don’t know if it has to do with the score or anything. If you could give me a working script for hit testing without a score that would be great thanks.

just take the score line out
if you could post the .fla, that would help too