I used a timer and cos, so that it gave a vertical shaking. I'll see if I can get the formula.
Nevermind, it seems I'm having that 'you don't have admin rights' problem everyone else is. So ya... can't access the scripts I had online.
Anyways it was something like:
PHP Code:
function onWeaponfired() {
this.force=.5; // force of the initial explosion
setTimer(0.05);
}
function onTimeout() {
if (this.force>0) {
this.angle=(this.angle+pi)%pi*2;
setfocus(player.x,player.y+cos(this.angle)*this.force;
this.force-=0.05;
setTimer(0.05);
} else resetfocus();
}
I haven't actually what I just wrote though, so there may be problems.