/hcmus_aif_PacmanGame_CSC14003

Using Search Algorithm to control Pacman.

Primary LanguagePython

🍗 hcmus_aif_PacmanGame


Abstract

HCMUS - Artificial Intelligence Fundamentals.
Project 01: Using Search Algorithm to control Pacman.
Team 15, CSC14003, 09/2023, HCMC.

Our team

👻 Nguyen Duc Nam
👻 Nguyen Thi Gai
👻 Van Ba Bao Huy
👻 Nguyen Bich Khue

Environment

  • Programming Language : Python
  • Game Engine : Pygame

Requirements

  • In the game Pac-Man, both Pac-Man and the monsters are constrained to moving in four directions: left, right, up, and down. They are not able to move through walls. The game is divided into four distinct levels, and each level has its own set of rules.
    • Level 1: Pac-Man is aware of the food's position on the map, and there are no monsters present. There is only one food item on the map.
    • Level 2: Monsters are stationary and do not move around. If Pac-Man and a monster collide with each other, the game ends. There is still one food item on the map, and Pac-Man knows its position.
    • Level 3: Pac-Man's visibility is limited to its nearest three steps. Foods outside this range are not visible to Pac-Man. Pac-Man can only scan the adjacent tiles within the 8 tiles x 3 range. There are multiple food items spread throughout the map. Monsters can move one step in any valid direction around their initial location at the start of the game. Both Pac-Man and monsters move one step per turn.
    • Level 4: involves an enclosed map where monsters relentlessly pursue Pac-Man. Pac-Man must gather as much food as possible while avoiding being overtaken by any monster. The monsters have the ability to pass through each other. Both Pac-Man and the monsters move one step per turn, and the map contains a multitude of food items.
  • The calculation of game points follows these rules:
    • Each movement deducts 1 point from your score.
    • Collecting each food item awards you 20 points.

Folder struct

Root
┣ 📂 Resources
┣ ┣ 📂 Character
┣ ┣ ┣ 📂 Food
┣ ┣ ┣ 📂 Monster
┣ ┣ ┗ 📂 Pacman
┣ ┣ 📂 Font
┣ ┣ 📂 Game Display
┣ ┣ ┣ 📂 Button
┣ ┣ ┗ 📂 map
┣ ┗ 📂 Map
┣ ┣ 📂 Level_1
┣ ┣ 📂 Level_2
┣ ┣ 📂 Level_3
┣ ┗ 📂 Level_4
┣ agent.py
┣ astart_search.py
┣ alpha_beta_pruning.py
┣ bfs_dfs_ucs_search.py
┣ constant_value.py
┣ game_logic_n_display.py
┣ localsearch.py
┣ main.py
┣ map_txt_builder.py
┗ map_txt_reading.py

Released Note:

report.pdf