Commit Graph

300 Commits

Author SHA1 Message Date
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
6994f39864 Player cannot walk if it runs out of stamina 2020-04-06 10:57:44 +02:00
87c7198199 Player can now interact with interactable entities 2020-04-06 10:38:12 +02:00
9e7c4f1ae0 Map can now load interactable entities 2020-04-06 10:35:58 +02:00
6d1dc4ffb7 Refactor Interactable.py and Pickupable.py 2020-04-06 10:33:29 +02:00
c6ab7cc2f4 Refactor: interactable now has methods from pickupable 2020-04-06 10:29:43 +02:00
c69c923d31 Lowered walking fatigue values 2020-04-06 10:26:16 +02:00
903a406c74 Added invoking sprites update() method every frame 2020-04-06 10:25:28 +02:00
052e56836b Player now passively looses stats 2020-04-06 10:25:01 +02:00
8339797409 Removed unnecessary line 2020-04-06 09:56:07 +02:00
318f7881a1 Fixed imports 2020-04-06 09:54:51 +02:00
0c46a6ec32 Run.py refactor 2020-04-06 09:53:27 +02:00
Michał Czekański
50d8f78ac8 Fix thirst console info print 2020-04-06 01:08:31 +02:00
998c6c0094 Merge remote-tracking branch 'origin/passingEvents' 2020-04-06 01:01:27 +02:00
Michał Czekański
880c0af3c2 Move updating time text view to Ui class 2020-04-06 01:00:02 +02:00
Michał Czekański
ee20ac3214 Add appending time stamps before console lines 2020-04-06 00:55:43 +02:00
d45eb55b28 Hunger now rises instead of falling 2020-04-06 00:53:51 +02:00
b110ee9f34 Hunger now starts from 0 2020-04-06 00:52:34 +02:00
325adc7de5 Merge remote-tracking branch 'origin/passingEvents' into passingEvents 2020-04-06 00:50:20 +02:00
3dd6a4a7e7 Implemented fatigue system 2020-04-06 00:50:12 +02:00
Michał Czekański
a0abfdf11e Merge remote-tracking branch 'origin/passingEvents' into passingEvents 2020-04-06 00:49:20 +02:00
Michał Czekański
04898fc27b Fix console scrolling 2020-04-06 00:45:52 +02:00
Wirus
cfd3b05981 Merge remote-tracking branch 'origin/passingEvents' into passingEvents 2020-04-06 00:43:35 +02:00
Wirus
752284a90d transparent textures 2020-04-06 00:43:20 +02:00
9a5556ff7b Merge remote-tracking branch 'origin/passingEvents' into passingEvents
# Conflicts:
#	src/entities/Player.py
2020-04-06 00:41:37 +02:00
bc8474b4c5 Player can now pick up items 2020-04-06 00:40:16 +02:00
a45befd4fa Implemented getFacingCoord method 2020-04-06 00:39:58 +02:00
Michał Czekański
53417ecab9 Merge remote-tracking branch 'origin/passingEvents' into passingEvents 2020-04-06 00:11:12 +02:00
Michał Czekański
679cc3f9f4 Add writing to console when player stats change 2020-04-06 00:10:40 +02:00
Michał Czekański
30896285db Add value field in Bar class 2020-04-06 00:06:19 +02:00
Wirus
e8e9cca0bb Merge remote-tracking branch 'origin/passingEvents' into passingEvents
# Conflicts:
#	data/mapdata/mapEntities.json
2020-04-06 00:03:06 +02:00
Wirus
38b6adc8a1 add bush and rabbit in mapEntities 2020-04-06 00:01:16 +02:00
Michał Czekański
076a377cda Add pass after empty elif in Player 2020-04-06 00:00:00 +02:00
Michał Czekański
b56269888c Merge remote-tracking branch 'origin/passingEvents' into passingEvents 2020-04-05 23:59:13 +02:00
Michał Czekański
932073d72a Reformat file Ui.py 2020-04-05 23:58:45 +02:00
2af94a27e9 Fixed filename 2020-04-05 23:58:03 +02:00
Michał Czekański
4985794b44 Add updating time in top left corner 2020-04-05 23:57:53 +02:00
Michał Czekański
0add2066e2 Add method updating text in UiText 2020-04-05 23:57:28 +02:00
05ce54933d Merge remote-tracking branch 'origin/passingEvents' into passingEvents 2020-04-05 23:53:25 +02:00
7d5c07c598 Fixed filename 2020-04-05 23:53:15 +02:00
Michał Czekański
f7fb38b7ff Bring timer back to Game class 2020-04-05 23:51:22 +02:00
Michał Czekański
df83f13bef Merge remote-tracking branch 'origin/passingEvents' into passingEvents 2020-04-05 23:45:48 +02:00
Michał Czekański
17125f9dd9 Add passing events, stats to update Ui when handling events 2020-04-05 23:45:19 +02:00
Michał Czekański
0fb5f925d2 Add method updating ui based on player stats 2020-04-05 23:44:31 +02:00
jonspacz
46e2b601f4 Merge remote-tracking branch 'origin/passingEvents' into passingEvents 2020-04-05 23:44:28 +02:00
jonspacz
1c287d65d4 fixed statistics 2020-04-05 23:43:53 +02:00
Michał Czekański
a60a46cc53 Add method returning stats field from Player 2020-04-05 23:43:40 +02:00
jonspacz
a7d7ff840a Merge remote-tracking branch 'origin/passingEvents' into passingEvents 2020-04-05 23:43:26 +02:00
jonspacz
86d9efe837 Merge branch 'passingEvents' of C:\Users\Paul\Desktop\DSZI_Survival with conflicts. 2020-04-05 23:43:23 +02:00
7b34e04665 Fixed syntax 2020-04-05 23:43:15 +02:00
a06ce53fc1 Implemented getEntityOnCoord method 2020-04-05 23:42:41 +02:00
Michał Czekański
df040b54f8 Merge remote-tracking branch 'origin/Player' into passingEvents 2020-04-05 23:26:19 +02:00
Michał Czekański
fd3f7180c8 Import Timer in Game class 2020-04-05 23:24:51 +02:00
Michał Czekański
a28fab0956 Merge branch 'UI' into passingEvents
# Conflicts:
#	src/game/Screen.py
2020-04-05 23:23:30 +02:00
c46745f8c0 Merge remote-tracking branch 'origin/MapNew' into EntityCreator 2020-04-05 23:15:28 +02:00
864877b866 Added loading sprites from json 2020-04-05 23:14:21 +02:00
Michał Czekański
967146e45c Add drawing all Ui elems in on screen init 2020-04-05 22:58:32 +02:00
Michał Czekański
c822a1bfd4 Add calculating pos ui elems in Ui.__init__ 2020-04-05 22:58:06 +02:00
1ef4d65045 Implemented loading entities from json 2020-04-05 22:49:50 +02:00
Michał Czekański
e73fc03fc4 Change how UiText renders text
Now UiText renders specified rect surface and on this surface blits text.
2020-04-05 22:37:37 +02:00
15a2010c5d Merge remote-tracking branch 'origin/entities_branch' into EntityCreator
# Conflicts:
#	src/entities/Collidable.py
2020-04-05 22:20:06 +02:00
b386eca2f4 Merge remote-tracking branch 'origin/entities_branch' into EntityCreator
# Conflicts:
#	src/entities/Collidable.py
2020-04-05 22:18:06 +02:00
Michał Czekański
7f624fe56e Use colors enum properly in Ui class 2020-04-05 22:16:09 +02:00
Michał Czekański
9ddcec6d73 Add fields for params in __init__ in UiText 2020-04-05 22:15:23 +02:00
5c80033a0b Added getStatistic method & enum 2020-04-05 22:04:40 +02:00
dc7023adfa Fixed: statistics now change by invoking methods instead of variable change 2020-04-05 22:02:15 +02:00
a0bbee30d1 Player movement now costs stamina 2020-04-05 21:59:40 +02:00
f4e2799009 Player class now has statistics 2020-04-05 21:59:26 +02:00
Michał Czekański
d6945f2bed Move up initialization of bar height in Ui class 2020-04-05 21:58:36 +02:00
c5fddf144d Merge remote-tracking branch 'origin/master' into Player 2020-04-05 21:56:59 +02:00
Michał Czekański
097dbf1bf4 Merge remote-tracking branch 'origin/Time' into UI 2020-04-05 21:56:00 +02:00
d9c4e9b97b Added timer to main loop 2020-04-05 21:54:35 +02:00
Wirus
2f605c2919 Game: change player spawnpoint 2020-04-05 21:53:10 +02:00
jonspacz
46b9ce8f95 changed id to size 2020-04-05 21:52:52 +02:00
Wirus
3c8f3e817f Merge branch 'Player' of https://git.wmi.amu.edu.pl/s444409/DSZI_Survival into MapNew 2020-04-05 21:49:52 +02:00
46d018dbfd Fixed wrong spawnpoint coords 2020-04-05 21:48:55 +02:00
Michał Czekański
aec4ddf2d3 Add method returning specified screen part width 2020-04-05 21:48:43 +02:00
Wirus
55fb38aa0a add water texture to Map 2020-04-05 21:46:04 +02:00
Michał Czekański
900e8e2203 Add ui fields in Ui class 2020-04-05 21:39:08 +02:00
jonspacz
404d2f1b50 deleted not needed Map elements from Pickupable 2020-04-05 21:36:58 +02:00
Wirus
061455605d Merge branch 'entities_branch' of https://git.wmi.amu.edu.pl/s444409/DSZI_Survival into MapNew 2020-04-05 22:44:43 +02:00
Wirus
cceb1d50c6 add sand texture to map 2020-04-05 22:07:37 +02:00
Wirus
36fbdbab62 Map: removeSpriteFromMap 2020-04-05 21:18:11 +02:00
Wirus
93f3df85fe Merge branch 'MapNew' of https://git.wmi.amu.edu.pl/s444409/DSZI_Survival into MapNew 2020-04-05 21:12:34 +02:00
d7ff3037cd Added sprite removal method 2020-04-05 21:06:45 +02:00
c91c82d80a Fixed bug: not being able to rotate with specific collisions 2020-04-05 20:47:24 +02:00
8557eabb97 Merge remote-tracking branch 'origin/MapNew' 2020-04-05 20:37:12 +02:00
jonspacz
057f711317 Removed Collidable because was not useful finished todo in pickupable and added Statistics to contstructor 2020-04-05 20:34:45 +02:00
161e869e9f Merge remote-tracking branch 'origin/Player'
# Conflicts:
#	src/game/Game.py
2020-04-05 20:33:21 +02:00
jonspacz
169a931329 Merge remote-tracking branch 'origin/MapNew' into entities_branch
# Conflicts:
#	src/entities/Collidable.py
2020-04-05 20:27:21 +02:00
Wirus
f399ba0d53 add entity to collidables in Map method 2020-04-05 20:24:28 +02:00
Wirus
c121519605 move collision to Map class 2020-04-05 20:20:37 +02:00
Wirus
853a3b1601 Map: collidable group of sprites
TerrainTile: position attributes
EventManager: collision method
2020-04-05 19:08:08 +02:00
Michał Czekański
cbb9508c19 Add method addLinesToConsoleAndScrollToDisplayThem in UiConsole 2020-04-05 19:06:15 +02:00
Wirus
16e361540e Map: delete import Player 2020-04-05 15:51:16 +02:00