Commit Graph

394 Commits

Author SHA1 Message Date
7877cbb239 Added missing affinity to the player's init 2020-05-16 12:14:16 +02:00
5e1e089015 getInteractablesByClassifier's classifier param is now optional 2020-05-16 11:41:51 +02:00
6ec1c0b2d2 Game class revamp 2020-05-16 11:13:36 +02:00
15babde728 buffed fatigue 2020-05-16 11:01:01 +02:00
233ce2462c fixed movePoints 2020-05-16 10:59:46 +02:00
5d060ae8a4 Fixed return type 2020-05-16 10:54:31 +02:00
25372c2f34 Added tooltip to affinities 2020-05-16 10:44:34 +02:00
b6893379cf added getInteractablesByClassifier method 2020-05-16 10:44:19 +02:00
74093de1d3 Added weighted choice function 2020-05-16 10:44:01 +02:00
b61ffc008b Now uses classifier enum instead of stings 2020-05-16 10:21:37 +02:00
a0c315a600 Added Classifiers enum 2020-05-16 10:21:23 +02:00
64c9a4979c Added newline at the end of the file 2020-05-16 10:07:46 +02:00
fce8eea181 Player may now have affinities to entity types 2020-05-16 10:07:35 +02:00
8cad7be0a5 Added affinities container 2020-05-16 10:05:42 +02:00
2318000476 Added type fields to entities from JSON 2020-05-16 10:02:01 +02:00
454e0ac87d __str__ prints classifiers 2020-05-16 10:01:47 +02:00
fa1fe48abb Added __str__ method 2020-05-16 09:59:53 +02:00
90746c51d9 Added missing param hint in docstring 2020-05-16 09:51:04 +02:00
215dd876f7 Added classifier param to the constructor 2020-05-16 09:50:10 +02:00
8c3bdc3726 Interactable entities now have classification field 2020-05-16 09:48:42 +02:00
Michał Czekański
d38b2ff7d5 Use new printToConsole method in Ui class 2020-05-15 23:24:21 +02:00
Michał Czekański
d26703da5b Add comments in Ui.py 2020-05-15 23:24:21 +02:00
Michał Czekański
6832d41990 Add comments in UiText.py 2020-05-15 23:24:21 +02:00
Michał Czekański
b15382d9bc Add scroll up and down method in UiConsole class 2020-05-15 23:24:21 +02:00
Michał Czekański
76de35bc3d Add update method, static buffer, static printing to console method
Added static buffer in UiConsole class which stores lines to print. Even if there is no UiConsole object instantiated (cos it's static).
Everything from buffer is being printed on update() calls, update is called every frame.
To add lines to buffer use static printToConsole() method.
2020-05-15 23:24:21 +02:00
Michał Czekański
4e828de1c7 Add type hints for fields and method parameters in UiConsole 2020-05-15 23:24:21 +02:00
Michał Czekański
22355dc960 Add comments to all methods in UiConsole class 2020-05-15 23:24:21 +02:00
Michał Czekański
2cebcd3be6 Fix writeToConsole method
This method was adding given string to the console's list of lines, but wasn't displaying this given string.
User had to perform scroll to display this new string.
2020-05-15 23:24:21 +02:00
Michał Czekański
86394ef71b Add method writing to console 2020-05-15 23:24:21 +02:00
Michał Czekański
7d71333558 Add comments in UiButton.py 2020-05-15 23:24:21 +02:00
Michał Czekański
aab779d4e1 Add comments in UiImage.py 2020-05-15 23:24:21 +02:00
Michał Czekański
08643c7083 Remove unnecessary field in UiBar class 2020-05-15 23:24:21 +02:00
Michał Czekański
9d1ecf5d90 Add comments in UiBar.py 2020-05-15 23:24:21 +02:00
Michał Czekański
bb46f56ace Add comments in UiElement.py 2020-05-15 23:24:21 +02:00
8df63bb607 Stamina loss is quicker 2020-05-15 16:59:02 +02:00
d45daadc60 Player may now die out of exhaustion 2020-05-15 08:58:07 +02:00
492f37bda5 Pressing 'u' now selects random interactable entity 2020-05-15 08:54:49 +02:00
a40a598ffe Added getEntitiesByType method 2020-05-15 08:54:21 +02:00
dae94576e7 Fixed debug text 2020-05-15 08:54:05 +02:00
4fff56bd7d Better debug output 2020-05-15 08:52:06 +02:00
569128763b Entities list is now a pygame.sprite.Group 2020-05-14 16:33:35 +02:00
fad3d68b55 getFacingCoord screenRelative now defaults to false 2020-05-14 16:30:10 +02:00
3924023a92 Documentation fixes 2020-05-14 16:24:59 +02:00
c806d99d49 Changed tooltip from except to raises 2020-05-14 16:18:29 +02:00
085446ea93 Added more documentation 2020-05-14 16:16:19 +02:00
1610f9c0da Fixed imports 2020-05-14 14:54:11 +02:00
844397191a Added tooltips to getCoords and SetCoords 2020-05-14 12:56:33 +02:00
fed30b0ade Added tooltips 2020-05-14 12:44:27 +02:00
cc98db0a96 Methods now use relative coords 2020-05-14 12:39:09 +02:00
776be8fb90 A* uses relative coords 2020-05-14 12:38:48 +02:00
95972ac969 Entities now load with relative coords 2020-05-14 12:11:57 +02:00
065111dee9 Changed default param 2020-05-14 12:11:46 +02:00
dac8583665 Changed tooltips 2020-05-14 12:07:35 +02:00
824a7e33ea draw method sets mapOffset field properly 2020-05-14 12:05:52 +02:00
93f4e9f53d Changed tooltip 2020-05-14 12:05:32 +02:00
2618bbdf9c moveForward method uses relative coords 2020-05-14 12:05:12 +02:00
7ed974b194 Added newlines in docstrings 2020-05-14 11:46:52 +02:00
269e376756 getFacingCoord can now return non-relative coords 2020-05-14 11:46:06 +02:00
107bd0d8f7 Changed constructor 2020-05-14 11:32:13 +02:00
1eb75fc354 Fixed abysmal draw method 2020-05-14 11:27:54 +02:00
e66b0d4a59 Removed redundant draw method params 2020-05-14 11:24:51 +02:00
6ed8423463 Added setter method usage 2020-05-14 11:23:04 +02:00
823eefac86 Fixed relative coord update 2020-05-14 11:18:58 +02:00
2bf0ed035b Added map coord offset 2020-05-14 11:15:27 +02:00
f224c8c657 Removed removeSprite method 2020-05-14 11:13:29 +02:00
ce50622b89 Removed removeSprite method 2020-05-14 11:13:09 +02:00
57b95e10df Added relative coords 2020-05-14 11:03:50 +02:00
cba207f98c Changed item pickup method 2020-05-13 20:17:32 +02:00
649b61a84e Added pickup to move method 2020-05-13 20:17:17 +02:00
b3d38403ad Added documentation 2020-05-13 19:50:53 +02:00
93472900b9 Removed A* calls from game 2020-05-13 19:48:51 +02:00
48e81e206b Enums refactor 2020-05-13 19:48:08 +02:00
effa48d7c3 Fixing item pickup action after completing the movement 2020-05-13 19:47:53 +02:00
a51661ae6e on_interaction method now removes the entity itself 2020-05-13 19:45:52 +02:00
28d9013983 Enums refactor 2020-05-13 19:36:06 +02:00
d6cf76f6bc Updated A* function calls 2020-05-13 19:34:16 +02:00
3ac188103a Player's movement adds fatigue 2020-05-13 19:32:52 +02:00
549c4f207f Movement moved to Entity 2020-05-13 19:31:51 +02:00
81bed4adeb All entities can now move 2020-05-13 19:25:08 +02:00
25345ae317 Removed objective implementation 2020-05-13 19:02:31 +02:00
dcdb4ac87e Fixed major bug 2020-05-13 19:00:33 +02:00
e270360690 Added non-objective implementation 2020-05-13 18:08:22 +02:00
11b467db32 Added pickup action in Movement enum 2020-05-13 17:36:54 +02:00
45e7c412f8 rotation field and getFacingCoord method moved from Player to Entity 2020-05-13 17:33:45 +02:00
16bb2cd311 Cleanup 2020-05-10 14:25:30 +02:00
f104e90a0f Added documentation 2020-05-10 13:27:06 +02:00
0eea13331f Added documentation & code beautification 2020-05-10 13:17:11 +02:00
01ce5796da Removed timer 2020-05-10 12:53:08 +02:00
a76965cd91 Player now keeps track of the movement delay 2020-05-09 22:54:15 +02:00
752c3daa24 Added TODO markers 2020-05-09 22:30:21 +02:00
fc47c697df Added more comments 2020-05-09 22:03:36 +02:00
Mateusz
b4624c4c56 raport progress 2020-04-27 11:06:14 +02:00
6fbc9184f4 Algorithm now picks up items 2020-04-26 20:22:16 +02:00
Michał Czekański
a6b717935f Extract clicks on collidables to new method - make code clear 2020-04-26 18:45:07 +02:00
Michał Czekański
013e8b524d Add new getTileOnCoord method
New method uses pygame.rect.collidepoint method which doesn't need exact tile's coordinates
2020-04-26 18:42:00 +02:00
Michał Czekański
2ba090b2d4 Add debug printing terrain tiles under mouse click 2020-04-26 18:41:05 +02:00
Michał Czekański
87fc6bea1f Fix not adding grass tiles to terrainTilesList 2020-04-26 18:34:38 +02:00
Michał Czekański
08d425b938 Fix sea being not collidable
Player can't walk over sea
2020-04-26 18:11:54 +02:00
Michał Czekański
1255ab8e16 Fix problems with pathfinding to some map locations and add go-to on click
succesor method fixed
2020-04-26 18:09:02 +02:00
Michał Czekański
31d2bf0009 Fix random A* target selection
There was try catch catching all Exceptions, now it's only catching IndexErrors
2020-04-26 16:33:39 +02:00
Michał Czekański
dee9ebb77c Fix not stepping on final entity 2020-04-26 16:04:47 +02:00
Michał Czekański
b12c969d14 Add changes to last move detection 2020-04-26 15:20:17 +02:00
Michał Czekański
1edaa1f74e If A* destination is entity - disable stepping on it
Player shouldn't step on berry or rabbit, etc...
2020-04-26 14:41:22 +02:00
Michał Czekański
f1e0c3c593 Add automatic player movement delay 2020-04-26 14:33:04 +02:00
Michał Czekański
b8abacd4cc Add picking random target for A* algorithm
When user clicks "u" key target is being picked.
2020-04-26 14:13:27 +02:00
Michał Czekański
ab1b4e9efc Fix going to target in goToTarget method
Disabled trying to retrieve moves from empty movement list.
2020-04-26 14:12:54 +02:00
Michał Czekański
d5c9f5f801 Fix player rotation 2020-04-26 14:09:35 +02:00
Michał Czekański
a5569f0b8f Disable player stats lowering for A* test 2020-04-26 14:08:38 +02:00
Michał Czekański
0151413cdd Merge remote-tracking branch 'origin/latestThing' into latestThing 2020-04-26 13:47:40 +02:00
Michał Czekański
5facbfb2fd Update A_star so that it generates some movements (not always correct) 2020-04-26 13:47:22 +02:00
Mateusz
53ee1e1f10 refactor and describe map lists and methods 2020-04-26 13:36:19 +02:00
Michał Czekański
deeba7c740 Spaghetti code, not working 2020-04-26 03:59:09 +02:00
Michał Czekański
39b689d8f0 Merge remote-tracking branch 'origin/terrainTilesList' into NewMovementFinishing 2020-04-26 01:39:18 +02:00
Mateusz
8b9d953553 add terrainTilesList 2020-04-26 01:37:27 +02:00
Michał Czekański
7a79ccc9c2 Finish graphSearch method in AutomaticMovement.py 2020-04-26 00:55:36 +02:00
Michał Czekański
e01dfeb85a Change priority method in AutomaticMovement.py
Now priority method calculates pr for given node
2020-04-26 00:22:03 +02:00
Michał Czekański
2e6f2db543 Merge remote-tracking branch 'origin/NewMovement' into NewMovementFinishing 2020-04-26 00:18:37 +02:00
Michał Czekański
b6234b1a93 Move node class to separate AStarNode.py file 2020-04-26 00:13:31 +02:00
Michał Czekański
b296fbe492 Rename coords field to state 2020-04-26 00:06:20 +02:00
Michał Czekański
5af76a1b16 Change succesor method in AutomaticMovement.py
Now succesor takes state as an argument and returns all possible moves for that state.
2020-04-26 00:03:38 +02:00
Michał Czekański
cdcf5fb052 Add coordination field in node class 2020-04-25 23:56:07 +02:00
Michał Czekański
cef686a74f Add method calculating new state with given action 2020-04-25 23:55:31 +02:00
Mateusz
d44274397d describe sprites costs 2020-04-25 23:34:49 +02:00
Mateusz
4d6de52e8c add cost attribute 2020-04-25 23:33:55 +02:00
Michał Czekański
7d9dd06d09 Add import new class in Game.py 2020-04-25 23:19:41 +02:00
Michał Czekański
e6c36eea8d Add partially finished AutomaticMovement class 2020-04-25 23:19:19 +02:00
Michał Czekański
0084750629 Add todo at TerrainTile class 2020-04-25 23:18:29 +02:00
e37a17cadd Added getTileOnCoord method 2020-04-25 22:49:57 +02:00
5ca1a0b4d0 New movement testing 2020-04-25 22:02:21 +02:00
d7e0b37666 Added new movement methods 2020-04-25 22:02:08 +02:00
Michał Czekański
69313b0984 Add antialiasing 2020-04-06 15:45:05 +02:00
Michał Czekański
774d186653 Add "s" after printing time alive 2020-04-06 13:51:05 +02:00
Michał Czekański
3f7ed1e4b3 Add updating console on players death and closing game after time delay 2020-04-06 13:48:36 +02:00
Michał Czekański
2893b4dd2c Merge branch 'writingInfoToConsole' of https://git.wmi.amu.edu.pl/s444409/DSZI_Survival into writingInfoToConsole 2020-04-06 13:44:39 +02:00
deec08cec7 Changed alive checking 2020-04-06 13:42:56 +02:00
Michał Czekański
9d8768cb15 Add method updating console on player's death 2020-04-06 13:41:33 +02:00
Michał Czekański
b22e69712c Add updating ui bars and updating console on interaction in EventManager 2020-04-06 13:20:28 +02:00
Michał Czekański
178115cc4d Add method updating console on player interaction in Ui and fix bar updating 2020-04-06 13:20:04 +02:00
Michał Czekański
156f9977e0 Add ui updates on player pickup in EventManager 2020-04-06 13:13:47 +02:00
Michał Czekański
01511757a0 Change console updates
Added updateOnPlayerPickup method and modified updateBasedOnPlayerStats so that is used in former method.
Now info is written only on player pickup so that there is no spam.
2020-04-06 13:13:28 +02:00
748e317e2e Merge remote-tracking branch 'origin/development'
# Conflicts:
#	environment.md
2020-04-06 12:37:01 +02:00
8f65ce87e2 Entities load using abs path 2020-04-06 12:31:44 +02:00
89cf106432 Loads tiles from file properly on all platforms 2020-04-06 12:30:21 +02:00
479c6eece7 Game now knows the abs path of the program 2020-04-06 12:30:03 +02:00
e3b3fdd74f Events won't be handled if the player is dead 2020-04-06 12:05:57 +02:00
f1232956a0 Player cannot rotate dead 2020-04-06 11:55:56 +02:00
a275678e3f Implemented player death mechanism 2020-04-06 11:51:46 +02:00
04a3eaf928 Merge remote-tracking branch 'origin/master' 2020-04-06 11:13:17 +02:00
c080816908 Removed obsolete Collidable class 2020-04-06 11:12:49 +02:00
5542acc443 Player may now self regenerate stamina 2020-04-06 11:03:01 +02:00