Problem with applicating map system... reversed (pedagogic .fla included!)
Sorry, couldn't think of a better title
Here's the thing; i have an RPG map system that works pretty well with hittest and transitions (This system is frame nr 1 on the .fla) basically its the character walking around.
Now i want to expand this system to an overworld thing. In essence have the world walk around the character (with the character immobile in the middle). This was fairly easy. Just putting the character in the middle, taking the moving script and put it on the map instead and reversing all the keys (Up is down, etc) as you can see in frame 2 the desired effect is there.
Except.
That im having trouble adjusting the associated hittest that tells the character (now map) to stop when he hits a wall or object (the character)
its in essence the object or wall that hits the man and its supposed to stop
Can someone take a look at my .fla and see if they can adjust the hittest approprietly? I've been experimenting but cant seem to get it to work.
The .fla itself have text and arrows that should explain the problem.
Very nice! That takes care of the basic problem, but theres two bugs i can spot:
1. Everything stops the movement, including the roads and grass. Is there anyway to make the hittest apply specificly to the "hit" part inside the "map" movieclip
i tried this:
if (_root.mapp.hit.hitTest(x, y, true)) {
but that didn't work.
2. It seems that you also somehow move the static room in the first frame when walking around since when you jump back from the big map the static room has changed position depending on how you walked. How to get around that?
place those items on another layer or in another object and don't name them "hit".
as to the static room, remove the two extra lines there. only add them in the 2nd frame.
does it work now?
First of all (a little late) thanks alot, the script is amazing and works perfectly now. It does exactly what i wanted it to do.
So this is just a bonus, it could be worked around in some otehr way i supposed but i thought i'd ask:
I was wondering if theres a line of code one could add to the script that makes an exception of certain movieclips. For example i have movieclips called "statusbar", "inventory" and "variables" that i would like to stand still on the frame while everything else moves.
You should put them inside another movie clip, and call it something like hud (as in head over display?)
Then add some code that does the same to hud as it does to player.
So if you had player._x += speed, now you use hud._x += speed, too.
Does that help?