Thank you Pixel,
You did very well but to be honest this is beyond my skills! it seems you got the logic and a bit of Math knowledge ! which i don t have.Everybody need to know that the guys from Namco who did this game where absolutly genious.Pac man is not a simple game , it need a foxy approach.I like the idea to check wether or not there is a wall or not in any direction and that the ghost do not systematicaly engage in a free space but in a random way(i can t find the process of this randomness).i think from there it could be possible to make a kind a chazing mode.I m 3d artist and not a coder , i just know a bit of python.I m going to decrypt this code line by line until i understand the way you came to this.
questions:why you did not use the grid object ?
Do you think with more tools in construct it could be simpler ? if yes which kind of tools
do you think there is another way to accomplish this ?
Thank you from the community for your remarquable help and kindness.
M.