hey guys, i need some help atm i have a character that you can move around, i want to put a code in , so if the character hasnt been touched for a while it will go to and play him doing somthing to get the users attention.
here is the code on the character
onClipEvent (load) {
var moveSpeed = 5
var idle_delay = 100
}
onClipEvent (enterFrame) {
idle_delay–
if (Key.isDown(Key.RIGHT)) {
idle_delay = 100
if (_root.walls.hitTest(_x+moveSpeed+(this._width/2), _y, true)) {
} else {
this._x += moveSpeed;
}
tellTarget ("_root.Guy") {
gotoAndStop(“Right”);
}
}
if (Key.isDown(Key.UP)) {
idle_delay = 100
if (_root.walls.hitTest(_x, _y-moveSpeed-(this._height/2), true)) {
} else {
this._y -= moveSpeed;
}
tellTarget ("_root.Guy") {
gotoAndStop(“Up”);
}
}
if (Key.isDown(Key.DOWN)) {
idle_delay = 100
if (_root.walls.hitTest(_x, _y+moveSpeed+(this._height/2), true)) {
} else {
this._y += moveSpeed;
}
tellTarget ("_root.Guy") {
gotoAndStop(“Down”);
}
}
if (Key.isDown(Key.LEFT)) {
idle_delay = 100
if (_root.walls.hitTest(_x-moveSpeed-(this._width/2), _y, true)) {
} else {
this._x -= moveSpeed;
}
tellTarget ("_root.Guy") {
gotoAndStop(“Left”);
}
if (idle_delay <= 90) {
this.gotoAndPlay(“stand”)
this._x =50
this._y = 50
}
}
}
onClipEvent (keyUp) {
tellTarget ("_root.Guy.character") {
gotoAndStop (1);
}
}
can anyone see why this is not working, im using a counter so if it counts down to a certain number and if it hasnt been touch it will play “stand”
any ideas???