So, I've been working on this game and its being going pretty well except for the whole part about it being a maze like game and the "walls" don't stop you. Here's what I tried and thought how to do it,
Players AS:
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
this._y -= 5;
}
if (Key.isDown(Key.DOWN)) {
this._y += 5;
}
if (Key.isDown(Key.LEFT)) {
this._x -= 5;
}
if (Key.isDown(Key.RIGHT)) {
this._x += 5;
}
}
Walls AS:
onClipEvent (enterFrame) {
if (this.hitTest(player)) {
player._y -= 0;
}
if (this.hitTest(player)) {
player._y += 0;
}
if (this.hitTest(player)) {
player._x -= 0;
}
if (this.hitTest(player)) {
player._x += 0;
}
}
Help would be appreciated. Thanks ahead of time!