Need help whit pac-man Enemy behavior!!

For questions about using Classic.

Post » Mon Apr 06, 2009 9:32 am

Hello all

im making a kinda rpg game wich has an section whit pac-man like enviroment. i have the enemy, an person whit red glowing eyes and evil look, and the pac man, a guy eating his way in the maze.
im trying to have the enemy navigate towards the enmy, but whitout hitting any walls. i made loads of dots, which he should follow. he goes to the dot that is closest by the player, and reapeats this till he meets the player.
for this i use a mask that overlaps the dots so the enemy detects the dot and moves to it. but somehow the enmy doesnt center on the dot, but it hits on the top and then search for new dot. the mask is a cross of 1 pixel wide, so when it collisions its sure that he doesnt hit any walls. but this isnt working :( i had to chance the cross to a very large variant to make it detect the dots. this makes the enemy not move in straight lines, which is needed for this game to work properly :(

the game is on layout "kelder"im posting the cap here whit all the code. im trying to get this pac-man thing working for like a few weeks, so i would be very happy if someone could help me out:(

if anyone could help i would be very very happy :)

Regards, bart

http://dl.getdropbox.com/u/728676/themazeprblm2.cap
B
1
G
3
Posts: 2
Reputation: 829

Post » Mon Apr 06, 2009 9:46 pm

You might want to take a look at A* Pathfiniding algorithm..
http://www.policyalmanac.org/games/aStarTutorial.htm
B
16
S
10
G
5
Posts: 255
Reputation: 3,934

Post » Mon Apr 13, 2009 3:30 pm

I have found a solution for the pac-man game. everyone Many Many thanks for all help :D
B
1
G
3
Posts: 2
Reputation: 829

Post » Tue May 14, 2013 8:29 pm

Can you post your solution to help others.
B
7
S
1
Posts: 48
Reputation: 1,729

Post » Tue May 14, 2013 10:51 pm

Yup, I bump that! Posting solutions, even if simple ones can be tremendously helpful to all community. :)
B
4
S
1
Posts: 28
Reputation: 435


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests