Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / A Game similar to pac man

Author
Message
sprcoll
12
Years of Service
User Offline
Joined: 26th Aug 2012
Location:
Posted: 15th May 2015 22:32
Hello all together,
i hope that someone want´s to help. I want create a game similar to pac man. For the movement everything is clear but for the stops at the walls i am unsure.
At the moment i use the sprite collision and i set at some positions flags, it works but it´s very complicated.

Maybe, is there a better way? I have thought to use fields and than move or move not, what do you think?

I would be very happy, if someone want´s to help.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th May 2015 22:39 Edited at: 15th May 2015 22:39
For games like this, you use a simple text map of the maze. Use * for walls, and if you enter a square with an * you have collided.




Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
sprcoll
12
Years of Service
User Offline
Joined: 26th Aug 2012
Location:
Posted: 16th May 2015 00:02
thank you,
the map as text with stars would not be a problem, but i don´t understand the collision and what do you mean with the square?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 16th May 2015 01:00
The logic behind the game is that you move from square to square. Take a look at the original Pacman; you can't move just one or two pixels, you always move a full grid square.

Therefore, you can base you collision on a quick lookup to see whether the next grid square is free, or a wall.

You can also add your powerups as different text symbols on the map.

Take a look at Manic Miner in AppGameKit Showcase. Muckypaws uses exactly the same logic.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
x3meblue
15
Years of Service
User Offline
Joined: 11th Dec 2008
Location: Nuremberg, Germany
Posted: 16th May 2015 01:05 Edited at: 16th May 2015 01:06
The 'square' is your level map, you simply create it with a text-editor, then you read the text file in an array. This only works if your movement is tile based. So, for example if pacman walks 1 tile up, then you check your array, if there is a star at this position. If so, pacman collided and you prevent him from going up. (You store pacmans position in a 2d array, like [5,2], now his position would be on tile 6 horizontally and tile 3 vertically).

AGK2 Tier 1 / GameGuru / DB PRO / ProMotion 6.5
sprcoll
12
Years of Service
User Offline
Joined: 26th Aug 2012
Location:
Posted: 17th May 2015 22:22
Many thanks for your replies. This method seems to be a little bit complicated, so i have to learn some more things. I have only a basic knowledge about arrays and loops. I think my method isn´t so bad, but sometimes i have a prolblem with the position if collision, the position varied about 1 pixel, and that depends on the player start position, i don´t know why.

I hope i can ask in a few days again.
Journey
AGK Backer
19
Years of Service
User Offline
Joined: 2nd Feb 2005
Location: Mexico
Posted: 3rd Jun 2015 02:59
¿Is it possible to use the AppGameKit placement editor to make the pacman mesh?.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Jun 2015 10:25
I would check this suggestion made earlier...

Quote: "Take a look at Manic Miner in AppGameKit Showcase. Muckypaws uses exactly the same logic."


Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Alien Menace
AGK Developer
19
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Earth (just visiting)
Posted: 3rd Jun 2015 10:37
As Batvink and x3meblue have suggested above is exactly how I wrote my Pacman-type game. The concept is little tricky to understand at first but I have also found it to be the best way to go.

I love my Altair 8800 Replica.

http://altairclone.com/

Login to post a reply

Server time is: 2024-09-29 01:14:33
Your offset time is: 2024-09-29 01:14:33