clemtinite
Programmer
Sorry, I imagine that title makes little sense.
So my problem is this:
I'm building the engine for a new game. I have a stick figure which is manipulated by using the directional keys along with other buttons. The movie is variable oriented as I am really just a high-intermediate flash user. The figure is meant to climb a ladder when the up button is pressed. I do this in a simplistic way: by using a simple graphic image of a ladder and two invisible movie clips, all grouped. The movie clips are placed above and below the ladder strategically so as to inform the movie clip 'man' when it comes into contact with one of these invisible clips. This means I referred to the invisible movie clips within themselves as 'this' "(this, hitTest(_root.Man.contactcentre))". This way, I dont require an instance name for the invisble clip, and in theory I can therefor use an unlimited amount of ladders in one scene.
OK, with one ladder running this method it works fine. The man can climb up and (with additional programming) can climb down. I use a 'climbup' and a 'climbdown' variable. These tell the 'Man' movie clip when upwards or downwards climbing is possible and from there, the man clip checks whether the appropriate button is down and perform a climbing animation accordingly. After this inital 'climbup' or 'climbdown' is used, the variables are returned to false and a third variable, 'climb', is returned true. This now means that the man has the ability to climb in both directions. Upon reaching the top/bottom of the ladder, the climb variable is returned false, enabling the man to go about his ordinary walking program normally.
This is really all not neccassary, I just thought I'd explain the entire situation.
The problem is this...
Only one ladder will every be climbable. This is due to some problem with the copies of the two invisible movie clips at the top and bottom of the ladder. (NOTE: Since I would start climbing from the bottom, I'm dealing only with the bottom movie clip). I have traced this down to the setting of a key variable. This is...
_root.Man.climbup = true;
This is the variable (returned to false by the movie clip 'Man' at the beggining of the movie) which allows the man to begin climbing upwards. As I said before, it works fine with the first ladder, only the copies do not work. Everything else does, however, work - including the initial hit test between the invisble clip and the man.
I had always presumed that if a clip only ever needs to refer to itself and needs no external input, multiple copies could be made without problems, but it looks like I'm wrong.
So, I know that may make little sense, but can anybody help me? I'm really quite desperate.
So my problem is this:
I'm building the engine for a new game. I have a stick figure which is manipulated by using the directional keys along with other buttons. The movie is variable oriented as I am really just a high-intermediate flash user. The figure is meant to climb a ladder when the up button is pressed. I do this in a simplistic way: by using a simple graphic image of a ladder and two invisible movie clips, all grouped. The movie clips are placed above and below the ladder strategically so as to inform the movie clip 'man' when it comes into contact with one of these invisible clips. This means I referred to the invisible movie clips within themselves as 'this' "(this, hitTest(_root.Man.contactcentre))". This way, I dont require an instance name for the invisble clip, and in theory I can therefor use an unlimited amount of ladders in one scene.
OK, with one ladder running this method it works fine. The man can climb up and (with additional programming) can climb down. I use a 'climbup' and a 'climbdown' variable. These tell the 'Man' movie clip when upwards or downwards climbing is possible and from there, the man clip checks whether the appropriate button is down and perform a climbing animation accordingly. After this inital 'climbup' or 'climbdown' is used, the variables are returned to false and a third variable, 'climb', is returned true. This now means that the man has the ability to climb in both directions. Upon reaching the top/bottom of the ladder, the climb variable is returned false, enabling the man to go about his ordinary walking program normally.
This is really all not neccassary, I just thought I'd explain the entire situation.
The problem is this...
Only one ladder will every be climbable. This is due to some problem with the copies of the two invisible movie clips at the top and bottom of the ladder. (NOTE: Since I would start climbing from the bottom, I'm dealing only with the bottom movie clip). I have traced this down to the setting of a key variable. This is...
_root.Man.climbup = true;
This is the variable (returned to false by the movie clip 'Man' at the beggining of the movie) which allows the man to begin climbing upwards. As I said before, it works fine with the first ladder, only the copies do not work. Everything else does, however, work - including the initial hit test between the invisble clip and the man.
I had always presumed that if a clip only ever needs to refer to itself and needs no external input, multiple copies could be made without problems, but it looks like I'm wrong.
So, I know that may make little sense, but can anybody help me? I'm really quite desperate.