im creating an rpg game and im making it so if you hit the water or the house or anything else it will stop you but im having real difficulty and it is probobaly not that hard so do you think you could help me with this…
the script is
onClipEvent (load) {
speed = 5;
speed2 = 5
speed3 = 5;
speed4 = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_root.level1._x -= speed2;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.DOWN)) {
_root.level1._y -= speed3;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_root.level1._x += speed4;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
_root.level1._y += speed;
}
}
onClipEvent (enterFrame) {
if (this, hitTest(_level0.level1.sign)or(_level0.level1.water)) {
speed = 0;
} else {
speed = 5;
}
}
and there is an attachment if you can download it