2018-03-15 16:44:14 +00:00
|
|
|
-[_Open Classrooms courses_](https://openclassrooms.com/projects/aidez-macgyver-a-sechapper)-
|
|
|
|
|
2018-04-10 17:45:48 +00:00
|
|
|
# [PyDev] Projet 3
|
2018-03-15 16:44:14 +00:00
|
|
|
|
2018-03-30 08:51:31 +00:00
|
|
|
#### Help MacGyver to escape!
|
2018-03-15 16:44:14 +00:00
|
|
|
|
|
|
|
----
|
|
|
|
|
|
|
|
### Summary
|
|
|
|
|
2018-03-30 08:51:31 +00:00
|
|
|
Imagine a 2D labyrinth in which _[MacGyver](https://en.wikipedia.org/wiki/MacGyver_(1985_TV_series))_ would have been locked up.
|
2018-03-15 16:44:14 +00:00
|
|
|
The exit is watched over by a bodyguard. To distract him, you need to
|
|
|
|
combine the following elements dispersed in the labyrinth:
|
|
|
|
|
|
|
|
* a needle
|
2018-03-30 08:51:31 +00:00
|
|
|
* a tube
|
2018-03-15 16:44:14 +00:00
|
|
|
* ether
|
|
|
|
|
2018-03-30 08:51:31 +00:00
|
|
|
They'll allow _MacGyver_ to create a syringe and put our guard asleep.
|
2018-03-15 16:44:14 +00:00
|
|
|
|
2018-03-30 08:51:31 +00:00
|
|
|
### Usage
|
|
|
|
|
|
|
|
This have been made with `python 3.6.4` and `pygame 1.9.3`
|
|
|
|
|
|
|
|
#### On Linux
|
|
|
|
|
|
|
|
1. Clone repo: `git clone https://github.com/freezed/ocp3`
|
|
|
|
2. Install dependences: `cd ocp3; pip3 install -r requirement.txt`
|
|
|
|
3. Run it: `python3 main.py`
|
|
|
|
|
|
|
|
#### Other OS
|
|
|
|
|
|
|
|
Feel free to contribute, I do not use other OS
|
|
|
|
|
|
|
|
### Files
|
|
|
|
|
|
|
|
* `main.py`, main script the one to run
|
|
|
|
* `conf.py`, place for variables, constants and fuctions
|
2018-04-10 17:45:48 +00:00
|
|
|
* `maze.py`, Maze class
|
|
|
|
* `player.py`, Player class
|
|
|
|
* `gui.py`, GraphicUI class
|
|
|
|
* `01.maze`, maze file
|
|
|
|
* `img/`, directory for image files
|
2018-03-30 08:51:31 +00:00
|
|
|
* `requirement.txt`, dependences for feeding pip
|
2018-04-10 17:45:48 +00:00
|
|
|
* `README.md`, you're reading it!
|
2018-03-15 16:44:14 +00:00
|
|
|
|
|
|
|
### Features
|
|
|
|
|
|
|
|
* One level. The structure (departure, location of the walls, arrival),
|
|
|
|
should be saved in a file to easily modify it if necessary.
|
2018-03-30 08:51:31 +00:00
|
|
|
* _MacGyver_ will be controlled by the directional keys on the keyboard.
|
2018-03-15 16:44:14 +00:00
|
|
|
* The objects will be randomly distributed in the maze and will change
|
|
|
|
locations if the user closes the game and raises it.
|
|
|
|
* The game window will be a square of 15 sprites length.
|
2018-03-30 08:51:31 +00:00
|
|
|
* _MacGyver_ will have to move from square to square, with 15 squares along
|
2018-03-15 16:44:14 +00:00
|
|
|
the window's length
|
|
|
|
* It will retrieve an object simply by moving on it.
|
2018-03-30 08:51:31 +00:00
|
|
|
* The program stops only if _MacGyver_ has recovered all objects and found
|
2018-03-15 16:44:14 +00:00
|
|
|
the exit from the maze. If he stupid enough to comes in front of the the
|
|
|
|
guard without all the objects, he dies (according to the evolution theory).
|
|
|
|
* The program will be standalone, i. e. it can be run on any computer.
|
|
|
|
|
2018-04-04 16:51:23 +00:00
|
|
|
### Roadmaze
|
2018-03-15 16:44:14 +00:00
|
|
|
|
|
|
|
1. Create the starting frame
|
|
|
|
* [x] Initialize a Git repo on Github
|
2018-03-20 13:00:45 +00:00
|
|
|
* [x] Create the labyrinth without the graphical user interface
|
2018-03-23 09:20:39 +00:00
|
|
|
* [x] Start the graphical interface with PyGame
|
2018-03-30 08:51:31 +00:00
|
|
|
* [x] Represent the guard, _MacGyver_ and the objects in your program
|
2018-03-20 13:00:45 +00:00
|
|
|
and placed them at the beginning of the game
|
2018-03-15 16:44:14 +00:00
|
|
|
2. Animate the character
|
2018-03-30 08:51:31 +00:00
|
|
|
* [x] The only moving element is _MacGyver_, create classes methods for
|
2018-03-15 16:44:14 +00:00
|
|
|
animation and finding the exit
|
2018-03-30 08:51:31 +00:00
|
|
|
* [x] make a simplified version of the game in which _MacGyver_ wins
|
2018-03-15 16:44:14 +00:00
|
|
|
when he arrives in front of the goalkeeper
|
|
|
|
3. Recovering objects
|
2018-03-24 21:24:11 +00:00
|
|
|
* [x] Add object management
|
2018-03-24 22:38:54 +00:00
|
|
|
* [x] The way he pick them up
|
2018-03-27 22:26:53 +00:00
|
|
|
* [x] Add a counter that will list them.
|
2018-03-15 16:44:14 +00:00
|
|
|
4. Win!
|
2018-03-30 08:51:31 +00:00
|
|
|
* [x] _MacGyver_ has picked up all the objects and asleep the guard
|
2018-03-15 16:44:14 +00:00
|
|
|
|
|
|
|
### Deliverables
|
|
|
|
|
|
|
|
* program hosted by Github
|
|
|
|
* 2 pages text doc (pdf) explaining your approach:
|
|
|
|
* including the link to your repo
|
|
|
|
* develop the choice of algorithm
|
|
|
|
* explain the difficulties encountered and the solutions found
|
|
|
|
|
|
|
|
### Constraints
|
|
|
|
|
|
|
|
* version your code and publish it on Github
|
|
|
|
* follow the good practices of PEP 8
|
|
|
|
* develop in a virtual environment using Python 3
|
2018-03-23 09:20:39 +00:00
|
|
|
* code must be written in English
|