actionscript 3 - AS3 collision with an eventual object -


I still can not understand what to do in such situations ...

I Trying to develop a simple maze game where you can not touch the walls or you will lose

I have created a player class and in a main square, stage.addChild ( Player) to add a child to it.

I also come under the graph on a wall platform ... When I play a game, it says that walls are an undefined property then class player - " This.hitTestObject (XXX) ?

You can check the collision in your main square Various wall: Array; Function Check Collision (): Zero {For each wall: your valle in the walls} {// Here is the Hit Test Object The easiest wall to check is that you can customize it (player.hitTestObject (wall) {}}}

or you can reference the walls in your player category Therefore, when you make a plane example with the walls defined in the main category.

public square player {Private wall wall: Array; Public function player ($ walls: array) {walls = $ Walls;}}

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -