hey guys, i'm still working on my game and there's a problem that i can't think of how to do..
so i spawn at some time intervals enemies that need to traverse downwards and avoid obstacles (using pathfinding ofc.)
my screen/layout size is 1366x768 pix. now i have set properly spawning points for every sprite, added them bullet behaviour, DooL, and solid (obstacles), gave them
angle 90 and speed 20. so my obstacles move at speed 20 downwards, which seems like you're traveling upwards, but now i spawn on the upper side enemies (with pathfinding) - example: create object enemy1 on (800,0). then i call find path (random(0,1366), 768) and on pathfound - move along path.
so what's the problem here? once my enemy starts moving it goes through my obstacles, but avoids them on the place they were before in time.
hacking that up, i've come up with idea to set "if on screen + every 0.5 sec" - regenerate obstacle map + move along path. - noticed that i need to use
find path (with new obstacle map) to find a new path for that enemy. problem is that this enemy now will gain different random position every 0.5 sec which i don't want.
so how can i create a function that updates general obstacle map (same cell size for every enemy) and find path for each enemy on screen to where it randomly got assigned when created, each 0.5 sec?
uhh.. i kinda feel like i could have simplified this.. anyway thnx for helping!