EDIT: wow I posted a lot of stuff
didn't know it was THIS much
I think I know what you mean though: Zelda II style of encountering enemies
Where the enemies move around on the map liek you, but you don't fight them until you and them meet on the overworld map. Then the action begins.
I can give you some guidance on how to do moving enemies on an overworld map. My enemies are all 8 bytes large in data each, in this format:
byte1: enemy type, 0 if null
byte2: enemy x
byte3: enemy y
byte4: enemy health
byte5: extra byte, used for type-specific actions
byte6: direction of enemy
byte7: enemy movement counter
byte8: counter for whether the enemy is flashing after taking damage
Basically, you have to initiate all the enemies you want to have with stats you decide on (I suggest no more than 3 enemies -- that can get rather slow rather quick)
Once you do that, here is what you can do:
...Enemies...
Lbl ENE //label here for me, because I used the enemy loop as a subroutine
For(A,0,2) //A loop that loops for every enemy you have, in this case 3
If {A*8+L1+400} //Pretending that each enemy's stats are 8 bytes large and L1+400 to L1+423 is where the stats are held
//That also makes sure it's doing the following steps for an actual monster, not some random stats with no enemy type
(Here you do your method of collision detection, similar but not as advanced as for your avatar)(
(Here you see if your avatar and the enemy collide, and then the actions)
(Here you can do other stuff like changing directions and moving)
End
End //End of For statement
^basic format of dynamic enemies on the overworld
The moving stats and stuff for my enemies take up no less than about 100 lines, so I won't go through them here; but I can give you more tips on how my format works great:
Really quick -- make sure the bytes of stats enemies take up are a power of 2 for best speed (like 4, 8, or 16)
Accessibility -- to get to a stat easily, just do something like {A*8+L1+400+ (byte number of stat you wish to access - 1)}
Optimizational -- while this is already fast in {Loopvar * statvars_size + buffer + offset} format, you can always change something like:
If {A*8+L+403} < 5
0 -> {A*8+L+403}
Else
{A*8+L+403} - 1 -> {A*8+L+403}
End
to:
{A*8+L+400} -> H
If {H+3} < 5
0 -> {H+3}
Else
{H+3} - 1 -> {H+3}
End
cutting out half the size and speed.
If you have any more questions, feel free to post them, I can help you with anything you need!