Hello guys, recently I’m developing a flash game…
it is an action shooting game but in tile based form…
the view i have used is top-down view… which u only see the head of the characters.
Ok, now my problem is… I would like to make some enemies chasing my hero…
How am I suppose to implement that? and I will have some block tile too… I’m able to implement some simple chasing algorithms…
example :
/*
if (enemy.x > hero.x)
enemy.x –
else if(enemy.x < hero.x)
enemy.x ++
*/
//this apply to y-axis too
and I’ve added some collision detection within block and enemy… I’m able to do that but the problem is, after the enemy detected the front tile is unmovable, then the enemy just stuck at there… i dunno how to make the enemy try to find another path towards the hero T_T…
Is there any other methods I can use for this case?