vin23
11-01-2007, 05:05 AM
hey guys,
can anyone help me, atm i have a game where the user hits bees, now the bees have a random function, so they can move around:
//this code is on the bees itself
acceleration = 5
newpos = function () {
ranx = Math.round((Math.random ()*200));
rany = Math.round ((Math.random ()*200));
}
newpos();
this.onEnterFrame = function() {
this._x += ((ranx-this._x)/acceleration);
this._y += ((rany-this._y)/acceleration);
if (Math.round(this._x) == ranx || Math.round(this._y) == rany) {
newpos();
}
};
now i have it so when they get hit, the acceleration = 30. the bees get dizzy.
after you hit it again it will splat, i want to make the bees come towards the screen, so they can splat on the screen, in the users face. can anyone help me, much appreciated
cheers
can anyone help me, atm i have a game where the user hits bees, now the bees have a random function, so they can move around:
//this code is on the bees itself
acceleration = 5
newpos = function () {
ranx = Math.round((Math.random ()*200));
rany = Math.round ((Math.random ()*200));
}
newpos();
this.onEnterFrame = function() {
this._x += ((ranx-this._x)/acceleration);
this._y += ((rany-this._y)/acceleration);
if (Math.round(this._x) == ranx || Math.round(this._y) == rany) {
newpos();
}
};
now i have it so when they get hit, the acceleration = 30. the bees get dizzy.
after you hit it again it will splat, i want to make the bees come towards the screen, so they can splat on the screen, in the users face. can anyone help me, much appreciated
cheers