PacMan banner

PacMan

37 devlogs
46h 5m 33s

The game detects collisions between Pac-Man, ghosts, and food pellets. When Pac-Man eats a pellet, the score increases. If Pac-Man collides with a ghost, the game resets. Once all food pellets in the current level are collected, the game automatic…

The game detects collisions between Pac-Man, ghosts, and food pellets. When Pac-Man eats a pellet, the score increases. If Pac-Man collides with a ghost, the game resets. Once all food pellets in the current level are collected, the game automatically moves to the next level.

This project uses AI

i use AI for error deduction , readme

Demo Repository

Loading README...

prakashpvp2007

Shipped this project!

Hours: 6.85
Cookies: 🍪 44
Multiplier: 6.38 cookies/hr

I have updated the game to be mobile responsive based on user feedback from the last build now it works well on mobile devices

prakashpvp2007

I have updated the mobile controls in landscape mode to make them more user friendly and I also updated the README file

Attachment
0
prakashpvp2007

I have implemented a dedicated mobile landscape view and controls for the game.previously,the landscape mode looked like the desktop view,but now it has been optimized specifically for mobile

Attachment
0
prakashpvp2007

I have implemented a bonus points system,when pacman eats all items (pellets and cherries) in the current map,bonus points are awarded based on the number of maps completed,for example, 500 points for the first map, 1000 for the second, and so on

Attachment
0
prakashpvp2007

I have added a high score display in the lobby and the statistics section in settings.in the Game over popup, a congratulatory message is shown if the player beats the high score

Attachment
Attachment
Attachment
0
prakashpvp2007

I have implemented joystick controls for mobile, allowing Pacman to be moved using the on screen joystick

Attachment
0
prakashpvp2007

I have implemented joystick buttons in the mobile view to control the movement of pacman.currently,only the ui is implemented,and i will add the control functionality in a future update.i have also increased the header size for mobile devices to make it easier to tap the sound and pause buttons

Attachment
0
prakashpvp2007

I have started making the game mobile friendly by updating the lobby UI to be responsive.i will implement full mobile responsiveness for the gameplay in a future update.the development time increased slightly because i spent around 30 to 40 minutes on additional testing after the last ship of this project

Attachment
0
prakashpvp2007

Shipped this project!

Hours: 40.01
Cookies: 🍪 460
Multiplier: 11.5 cookies/hr

I build my second game using HTML ,CSS,java script and canvas ,based on the feed back and improvements suggested for my previous game, i created this new project called pacman ,which is inspired by the classic game, i’m very excited to know how users will feel about this project.

prakashpvp2007

Now i added the readme file

Attachment
0
prakashpvp2007

I have updated the folder structure by organizing images and sounds into groups such as pacman,ghosts,walls,powers and header icons.these images are now stored in seperate folder and accessed accordingly

Attachment
0
prakashpvp2007

i have added a sound on/off button to the board header.i also removed the canvas fill and stroke so that the button is more clearly visible.

Attachment
0
prakashpvp2007

i have added sound effects for various game events ,including the start of the game,eating pallets,eating cherries,collecting hearts and shields,eating bouns,ghost movement, and when pacman loses a life. i have also introduced a start delay and a respawn delay when pacman is out.
previously ,the game would restart immediately after pacman lost a life ,which was not user-friendly.now a start wait time is added for both the game start and respawn,improving the overall user experience.

Attachment
Attachment
0
prakashpvp2007

now i set pause and play button as responsive inside header in previous it is just in html not inside the header now it in header so it is now completely responsive

Attachment
0
prakashpvp2007

i have added bonus ghost behaviour similar to traditional pacman game,when pacman collects a big cherry,ghosts turn into bonus ghosts.when pacman eats them he earns 200,400,600,800 points for 1st,2nd,3rd,4th ghost.
After a bouns ghost is eaten it respawn at its starting position but only after the bonus timer eands once it respawns it remains inactive for 2 seconds to indicate its reappearance. during this 2 second period ghost are blink with white color and if pacman touches the ghost,it is consider as not out (in 2 seconds of respawn)

Attachment
0
prakashpvp2007

I have updated the heart spawn logic.previously the heart would spawn repeatedly wheneven Pacman’s lives were less than 3 ,which was not ideal .now pacman must earn 150 points before another heart can spawn

Attachment
0
prakashpvp2007

Now i added the pause and play button in game user can pause and play the game by clicking the pause and play icon or tab space bar

Attachment
0
prakashpvp2007

I have updated the game board by adding a header.The header now displays lives,score,and a shield shield timer(which appears only when Pacman collects a shield).Previously these details were shown inside the board ,making them hard to see .This change improves clarity and overall appearance.

Attachment
Attachment
0
prakashpvp2007

I have also added changing ghost position in the lobby.the ghosts now display different directional images,continuously changing directions,which makes the lobby look more visually appealing

Attachment
0
prakashpvp2007

I have updated the ghost direction visuals.Previously there was only one image for each ghost ,which always faced right ,even when moving in other directions.This did not look good.Now I have updated it so that ghosts face the direction they are moving,which improves the overall appearance.

Attachment
0
prakashpvp2007

I have fixed an issue where ghostswould sometimes get stuck(not move) after teleporting back to thier starting position.this occurred when they caught pacman or entered a tunnel and were reset.the issue has now been resolved.

Attachment
0
prakashpvp2007

I have updated the map selection in settings to use a sliding feature .Users can click the left arrow to view the previous map and the right arrow to view the next map.I have also added a heading to display the map number.

Attachment
0
prakashpvp2007

I have updated the lobby by adding Pacman movement and pallet-eating animation. The pallets now move towards pacman,creating the effect that pacman is eating them in the lobby.

Attachment
0
prakashpvp2007

i have updated the ghost tunnel behaviour .In the previous version ,when a ghost passed through the tunnel ,it sometimes reappeared incorrectly or disappeared .I Have now fixed this issue ,when a ghost enter the tunnel it respawns at its starting position. Initially ,I considered making ghosts travel throughthe tunnel and appear on the opposite side like pacman .However after reviewing other pacman games ,i found that typically only pacman uses the tunnel to move across the map. when ghosts enter the tunnel they usually respawn at thier starting position instead of appearing on the opposite side

Attachment
0
prakashpvp2007

I have updated the map.In the previous version,some tiles were not properly aligned,and certain areas did not look good . I have now fixed the alignment to improve the overall appearance.I also changed the positions of the cherries to enhance the gameplay experience.previously cherries were placed too close to pacman,making them easy to collect.now they are positioned differntly to provide a better challenge

Attachment
Attachment
Attachment
Attachment
Attachment
Attachment
0
prakashpvp2007

I have updated the movement behaviour of the ghosts,previously they only changed direction when they encountered a block, turning randomly at that point.now they can also change direction randomly even when multiple paths are available (excluding diret opposite direction like left to right) .this makes their movement more dynamic and unpredictable

Attachment
0
prakashpvp2007

Now i added more map that makes game more interesting

Attachment
Attachment
Attachment
Attachment
0
prakashpvp2007

i have now added a random selection option for wall color in settings.By default it is set to random but the user can chnage it in settings ,i added this because having randomness only for the map did not look good ,so now wall coor are also randomized

Attachment
0
prakashpvp2007

i have updated the map selection in settings,in previous version maps were displayed as image ,so adding a new map required creating and adding a new image, which was time-consuming.now i have changed it to render maps directly from code instead of using images.
Previously,even when the wall color was changes in settings ,the preview still showed blue walls because it was based on static images ,iin this version the map preview is dynamic and updated according to the selected wall color
Additionally users can now view maps in larger preview mode in settings before selecting one which helps them see the map more clearly

Attachment
Attachment
Attachment
0
prakashpvp2007

i made some optimizations and clean up this code ,instead of scanning the full 21*19 grid every time the map loads it now loops only over the precomputed coordinates. along with that i add wall grid and an occupiedTiles set so randomEmptytile() can check whether a tile is blocked much faster ,without repeatedly looping through every wall. this version makes the game loop cleaner by using only one loop style RAF with fixed step tick (startloop->frame->tick),and it removed the old update( setTimeout loop so you can,t accidental run two loop at once.

Attachment
0
prakashpvp2007

Add a settings button in the lobby ,when clicked it should open the popup where user can choose preferred map and walls color. by defaulty, the map is selected randomly ,currently there are 4 maps available if the user selects specific map that map should loaded everytime they play otherwise ,a random map should be used. for walls blue color is the default and the user can choose from 4 available color options.the user can press enter or click save to apply or close or esc to exit without saving.the selected map and wall colorshould be stored in localstorage when the game starts, it check localstorage and load the saved map and wall color.

Attachment
Attachment
0
prakashpvp2007

now i make some debugging at first without pacman or ghosts it get some error ,i make some changes in code that support also without pacman and ghosts just for take some images of map

Attachment
Attachment
Attachment
Attachment
0
prakashpvp2007

now i add pacman moving animation as mouth full open,half open ,close for movement ,it is in half open in its idle position,and also add enter button for start and restart ,back space for back to lobby .

Attachment
Attachment
Attachment
0
prakashpvp2007

add lobby option in lobby show pacman and ghost image with game rules and instruction,and in game over popup add back to lobby option

Attachment
Attachment
0
prakashpvp2007

introduce heart and shield powerups to the game ,shield should spawn for every 250 points and last for 10 seconds in the map and provide prtection for 5 seconds upon collection ,the heart should appears when the pacman has fewer than 3 lives and stays for 10 seconds in map ,and restore one life when collected. Additionally modify the design of the game over popup.

Attachment
Attachment
Attachment
0
prakashpvp2007

adding more maps and place cherries in correct position

Attachment
Attachment
Attachment
Attachment
2

Comments

Airin a
Airin a about 1 month ago

I love this game! Keep it up

Saif
Saif about 1 month ago

this is cool, gotta love pacman!

prakashpvp2007

add some cherries in map ,small cheries and big cherries ,there are 6 small cherries and 2 big cherries,50 points each for every small cherry and for big cherry 100 points each

Attachment
0
prakashpvp2007

the controls and movement login where upgraded ,first the keyboard event change from listening on keyup to keydown,so pacman responds immediately, wrap the the board

Attachment
0
prakashpvp2007

i build the board ,pocman,ghost score ,for pocman is move my arrow moving there are three lives in this game i build this as basic ghosts move untill the block appears

Attachment
0