Quote:
Originally Posted by fowlplay4
PHP Code:
function onCreated() {
setImg("blackbeltben_bullet.png");
setShape(1, 32, 32);
moveBullet();
}
function movebullet() {
temp.dx = this.newx - this.x; // delta = final position - initial position
temp.dy = this.newy - this.y;
temp.dist = vectordist({this.x, this.y, 0}, {this.newx, this.newy, 0});
temp.speed = 0.5;
temp.time = temp.dist / temp.speed;
move(temp.dx, temp.dy, temp.time, 0);
setTimer(temp.time);
}
function onTimeout() {
destroy();
}
|
Please forgive me if this sounds like a dumb question.. But what is the point of putting temp? Couldn't you just put this.dy, this.dist... etc
Keep in mind I don't know much about "temp" stuff