Commit Graph

52 Commits

Author SHA1 Message Date
Fred Z eb9fb354ae
Remove pygame version
Troubles with `pygame==1.9.3` on `python 3.6.6`
2018-10-24 11:46:43 +02:00
Fred Z 1202cffee6 Adds documention file 2018-04-24 19:04:03 +02:00
Fred Z f564ebbac2 Updates comments & docstrings 2018-04-12 18:39:42 +02:00
Fred Z 79908e2316 Updates README.txt 2018-04-10 19:45:48 +02:00
Fred Z f1141158d8 Fixes pylint & flake8 warnings [deliverable] 2018-04-10 19:03:59 +02:00
Fred Z eb68f7c04d Updates only changed tiles
Before this, after each move, the whole maze was redrawed to update
display. Now it draws only the changed tiles (current/old player
position). Changed tiles are stocked in a list, for future needs,
others changed tiles can be add here.

TODO keep maze.string updated
2018-04-10 15:44:27 +02:00
Fred Z 69be4c1753 Reviews comments 2018-04-10 15:14:30 +02:00
Fred Z 5a7224aaad Renames 'void' element by 'floor' 2018-04-05 18:29:42 +02:00
Fred Z 80c22b9685 Clean and tidy images stock : ready for delivery 2018-04-05 18:24:39 +02:00
Fred Z 411668ed8d Creates a new object : GraphUI
Manages graphic display with pygame
Move from `func.py`: set_`header()` & `maze_draw()` (renamed `draw()`)
Deletes `Maze.maze_print()` (integrated in `GraphicUI.draw()`)
Removes the background, using only tiles

TODO: Add a floor tile behind player, guard and items
2018-04-05 18:12:21 +02:00
Fred Z cea1f058e0 Creates a new object : Player
Splits player's related code in a new class
Renames some var, const, attr and methods
Done some cleaning in ELEMENTS
2018-04-05 02:05:30 +02:00
Fred Z bc024f9a9c Rename every occurences of map by maze
Map is a keyword and I using ma & maze in the script may be confusing
2018-04-04 18:51:23 +02:00
Fred Z 2fa3e6ff86 Updates requirements.txt 2018-04-04 18:44:00 +02:00
Fred Z d428059db5 Minor changes in the last_wait loop
The loop is now named last_message
2018-04-04 18:43:57 +02:00
Fred Z 5f7118b17f Exports to Map the EOL replacement in map string 2018-04-04 18:42:50 +02:00
Fred Z 89a02369e2 Dels redundant func calls 2018-04-04 14:59:47 +02:00
Fred Z f2be5fb874 Improves file error handling
DONE if a file error raises, do not warmup pygame
2018-04-04 14:49:46 +02:00
Fred Z ed5380376f Sets up file error (presence or line nb)
Clean exit and handling error when a map file do not exist or have a
wrong number of line (acording to the constant MAZE_SIZE in the conf
TODO if a file error raises, do not warmup pygame
2018-04-04 14:48:22 +02:00
Fred Z f624d23a45 Retrieve attributes definitions in __init__()
TODO pylint warning:
map.py:17: [R0902(too-many-instance-attributes), Map] Too many
instance attributes (10/7)
2018-03-30 15:58:01 +02:00
Fred Z a01fd836ab Moves maze file check to the `file_check()` method
Lightens init method and facilitates futures adds
2018-03-30 11:52:36 +02:00
Fred Z ffdd23c402 FIX #1 Adds build & launch instructions
…and minor changes
2018-03-30 11:19:56 +02:00
Fred Z 19bf777484 Massive static code cleanup
- Translating comments
- Flake8 & Pylint checking
- Adjust variable name consistency
- Rename tiles filename (and adds files)
2018-03-30 11:19:33 +02:00
Fred Z a2bfa46207 FIX an unreachable sector of the map 2018-03-28 01:32:26 +02:00
Fred Z 8cc28d6120 Adds last loop [deliverable]
… to keep end/quit messages readable
2018-03-28 01:17:47 +02:00
Fred Z 536e3fd0d4 Improves headers text-management
Manages 3 text-zones:
 - Title (top left)
 - Status (bottom left)
 - Items list (top right)

DONE draws items counter and message
2018-03-28 00:33:53 +02:00
Fred Z 4333c3dd86 Creates header for messaging, put welcome message 2018-03-27 02:39:40 +02:00
Fred Z 3e46a938ba Moves maze_draw() to conf.py 2018-03-27 01:23:46 +02:00
Fred Z 1104e34040 Checks if all items are collected (win or loose)
TODO draws items counter and message
2018-03-27 00:11:18 +02:00
Fred Z c0a3c1d1f2 Adds requirement.txt
Deletes obsolete file `gui.py`
2018-03-25 00:15:14 +01:00
Fred Z a937a79719 Collects items in a list
TODO draws items counter and message
TODO checks if all items is collected before exiting
TODO move maze_draw() to func.py
2018-03-24 23:48:28 +01:00
Fred Z f021ab5fa2 Finalise the general use of ELEMENT_LIST
Suppress MAZE_ELEMENTS_TILES & MAZE_ELEMENTS
TODO move maze_draw() to func.py
FIXME walk over collectables items
2018-03-24 23:11:45 +01:00
Fred Z 5ae9de6060 Moving conf & func in a new file
And renames some const/var to facilitate the reorganisation
TODO finalise the general use of ELEMENT_LIST (suppr. MAZE_ELEMENTS_TILES & MAZE_ELEMENTS)
TODO move maze_draw() to func.py
FIXME walk over collectables items
2018-03-24 21:12:31 +01:00
Fred Z 4ebc10c2ab Deploys use of ELEMENT_LIST, adds `elmt_val()`
Setup a function to retrieve data stored in ELEMENT_LIST
FIXME walk over collectables items
2018-03-24 17:35:54 +01:00
Fred Z b24ca47faa Places collectables items on the map
… but collectable are uncrossable as walls: BUG
Begin to use a list of dicts to store all elements informations in
the same place
FIXME walk over collectables items
FIXME generalise the use of the list of dicts
2018-03-24 17:32:54 +01:00
Fred Z 463e7864d7 Add **kwargs to `place_element()`
Better than using temp variable, but nore than that it prepares the next commit: using this method to put on the map collectables items (and maybe more in the future).
2018-03-24 00:38:02 +01:00
Fred Z 9ded9786a3 Adds movement to the player
Keep message loggin on console for dev, stop printing map on it
TODO Just changing the 2 tiles impacted by the move, not the whole maze
2018-03-23 11:11:57 +01:00
Fred Z 9c7ad6ccf0 Uses a background image for to render walls
Add background images and transparent tile
Use transparent tile to see background
Maybe do not use tiles for wall (perf?)
2018-03-23 10:54:11 +01:00
Fred Z 0c954f53ee Uses the mapfile to generate the maze
No gui object finally
Changing the window resolution to 30px
TODO animate the player
2018-03-23 10:26:41 +01:00
Fred Z 30be7539de Adds 30px tiles 2018-03-23 10:17:38 +01:00
Fred Z 11347f967d Massive refactoring to use tile in background
Use pygame's display to setup a 15 cells square grid, with a player
moving on it. Do not clean the trail, border collision.
Next step: build an gui object for representing the maze.
2018-03-20 23:40:46 +01:00
Fred Z 38a9834da6 Edit date of creation 2018-03-20 14:05:24 +01:00
Fred Z 9c12f59139 Update README.md 2018-03-20 14:00:45 +01:00
Fred Z 1a9daca08d Cleans code
- Check only arrow key, for playing, otherwise quit
- Quit game when maze exit is reached
- Sop using movement status
- Reverse the maze elements checking
2018-03-20 13:48:36 +01:00
Fred Z b3d6122b32 Fixes horizontal movement, border version
Player cannot go from side to side
2018-03-20 11:22:31 +01:00
Fred Z ef7db8ccb6 Fixes horizontal movement, borderless version
Player can move from left-side to right-side using left arrow (and vice-versa)
2018-03-20 11:02:35 +01:00
Fred Z 645108029b Partial repair of the movement
Code adaptation to wall surounded map to open map.
FIXME: ignore end of line when next_position fall on it.
2018-03-20 00:38:18 +01:00
Fred Z 75cf1775a9 Adds chaotic movements and translate comments 2018-03-19 13:59:41 +01:00
Fred Z dc5c100663 Adds first files and catchs key events
Display the maze map in console, use `pygame.event` to intercept
keyboard arrows (and escape for quitting).
`pygame.event` do not work without a window displayed, so a small
100x100 window is used.
The console displays a text for each arrow key pressed.
2018-03-18 00:46:06 +01:00
Fred Z b93c30e767 Update README.md 2018-03-18 00:45:26 +01:00
Fred Z e42050b608 First pygame test
Basic moving image over a grid using arrow keys
2018-03-15 17:47:05 +01:00