Giter VIP home page Giter VIP logo

pacman's Introduction

Recreation of Pac-Man classic game


For Linux:
Make sure you have SDL library installed https://www.libsdl.org/
If you don't have it, use these commands:

sudo apt-get install libsdl2-dev
sudo apt-get install libsdl2-image-dev
sudo apt-get install libsdl2-mixer-dev

To run this program on Windows please install MSYS2 first https://www.msys2.org/
To add SDL library to MSYS2 use this command:
pacman -S mingw-w64-x86_64-{SDL2,SDL2_image,SDL2_mixer,pkg-config} make

In case of successfull installation run make and start the program with ./pacman Screenshot-(98)
Game rules:
There are 240 food dots on the field. Level is finished when you eat all dots.
Use navigation arrows or A-W-D-S to move around.
There are 4 special food dots called energizers - when you eat them, ghost becomes frightened and you can eat ghost and get extra points.
2 times per level special food "fruit" appears in the game. It can give you big amount of extra points.
If a ghost catches you, you lose your life. You have 3 lifes per level. If you loose the level, you will go back to the Level 1.
Sometimes ghosts hunt you, sometimes they are just walking around. The higher is level the longer they hunt. Screenshot-(99)
More information about game mechanics:
The game window is splited on tiles. The ghost catches pacman if their centers are in the same tile.
The weak place of this logic: if Pacman meets the ghost at the edge of the tile, on the next step Pacman can jump to the ghost tile, and ghost jump to the Pacman tile. That's why you should check tiles twice - after each Pacman step and after each ghost step.
Ghosts are always running to some target tile. When they walk, they run to the corner tiles. When they hunt Pacman:
- Red ghost runs to the Pacman active tile;
- Pink ghost runs to the one 4 tiles before Pacman;
- Orange ghost runs to the Pacman active tile if it's not father then 8 tiles from him;
- Cyan ghost runs to Pacman but also follows red ghost direction.
Every ghost has different lenth of "shy mode" (when it sits in the ghost house).
At Level 1 they follow the next cylce:
7 sec of walk - 20 sec of hunt - 7 sec of walk - 20 sec of hunt - 5 sec of walk - 20 sec of hunt - 5 sec of walk - forever hunt

What happens on the higher levels?
1) Walk time gets shorter;
2) Hunt time gets longer;
3) Shy mode (time in the house) gets shorter
4) Frightened more (when you can eat ghosts) gets shorter and dissapear on level 10;
5) Fruit bonus grows.

pacman's People

Contributors

catidiana avatar simhj316 avatar mampir avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.