21 Commits

Author SHA1 Message Date
Felix Boucher
27d329df71 fix unit cost not working anymore
turns out it was an inheritance problem
2024-01-25 14:45:50 -05:00
Felix Boucher
42fbffd306 working delete feature + placeholder refactor 2024-01-19 15:30:54 -05:00
Felix Boucher
795d6751ec refactor placement buttons to accomodate delete 2024-01-19 14:51:30 -05:00
Felix Boucher
7dba305d30 fixes to berry harvesting
- berry harvester appears on bush tiles
- change berry resource for food instead
- some structural change to reduce bugs
2023-11-12 18:26:36 -05:00
Felix-gabriel Boucher-luneau
4b800c73c2 Pull request #51: fix detection range
Merge in CGD/gather-and-defend from prog/fix_detection_range to main

* commit '937624f54fafd20cbc70dd752fa00314139ec795':
  remove underscore
  fix detection range
2023-11-01 01:13:17 +00:00
c6f819bee1 Fix compile errors 2023-10-31 21:06:05 -04:00
Felix Boucher
3c1a94257f fix detection range
problem :

detection range didn't show anymore on placeholders

solution :

calculate detection range from collider's offset and size instead of it's bound
2023-10-30 21:28:21 -04:00
Felix Boucher
b54627196c population mechanic with art
- added art for house and UI
- put population in ResourceManager
- create house prefab
- added code for adding and removing pop depending on entity
- refactor harvesters so they inherit from ally
- modify placeholders and buttons so that only units cost population
- add events for population and resources changing
- add population relative configs to global config
- add start resources values to Levels
- add debug feature for generating resources for free
2023-10-29 19:12:32 -04:00
Felix Boucher
8adc563d47 make transition fool proof
problème :
Il y avait plusieurs manières de faire planter le loading screen en appuyant sur des boutons

changements:
- turn off buttons when loading screen is active
- turn on buttons when loading screen is not active
- add event aggregator class to project and migrate every event to it
- fix bugs and regressions
2023-10-09 22:21:06 -04:00
Felix Boucher
27d72368aa finish integrating level selector
Level selector was already working after work by William but some small bugs remained to be fixed + it wasn't possible to return to level selector once we were in the level.

- it's now possible to go back to level selector from Level
- LevelManagerScript is no longer a singleton (this way, it resets with the Game scene unloading)
- Added a property drawer for using scene files in inspectors
2023-07-23 20:16:44 -04:00
fd22af5e65 Revert FetchDatabaseStatic because it prevents builds 2023-07-22 01:32:22 -04:00
Felix Boucher
9889ca76a7 harvesters
problème : il faut que les resource tiles produisent des resources seulement quand elles ont une unité au dessus d'elles pour les harvester.

solution : créer une classe harvester qui est vérifiée par la resource tile avant d'updater. Si aucun harvester n'est au dessus, aucune update n'est faite.
2023-07-13 12:40:37 -04:00
Felix Boucher
43bc2c75f2 work on game scene + fix bugs
problems :

- game scene was not as shown in the GDD
- problem when moving tilemap (the placeholders didn't follow)
- possible to place units outside the game area

solutions :

- try to make the game scene as close to the gdd as possible
- don't move the tilemap : move the camera instead (this keeps the world position of tilemap intact)
- there was a logic bug in the DraggablePlaceholder. It ain't anymore
2023-07-11 15:52:43 -04:00
Felix Boucher
878a80b1d7 réparer le drag and drop
problème : le placeholder apparait au milieu de la map random quand on clique sur le bouton de création d'unité

solution : ne pas permettre de placer l'unité quand on est à l'extérieur de la zone de jeu + ne pas la faire apparaitre.
2023-06-30 17:27:26 -04:00
Felix Boucher
43f4c6a39e Linked resource management to unit creation
Problem :

Les unités et bâtiments ne coutaient rien à construire

Solution :

J'ai link le système de drag and drop au resource manager.

Note :

J'ai déshérité le ResourceManager de MonoBehaviour aussi, vu que c'est pas une fonctionalité qui nécessite d'être updaté par frame vraiment, c'est plus du stockage.

J'ai testé dans l'éditeur et tout semble fonctionel *fingers crossed*
2023-06-22 13:58:02 -04:00
Felix Boucher
6a3a405753 cached and refactored a bit
problem : spelling errors and lisibility issues with some parts of the code

solution :

- used GetAllComponents generic nature to eliminate the need for casting
- cached sprite renderers in the Placeholder
- put hardcoded string in a const variable
2023-06-15 12:30:41 -04:00
Felix Boucher
5244bbcfbb change names + add commentaries 2023-06-13 18:35:08 -04:00
Felix Boucher
092aa026c8 drag&drop - montrer range et tweaker outline
problème :

- le range d'attaque n'apparaissait pas sur le placeholder des unités
- le outline ne fonctionnait pas bien sur toutes les unités
- le placeholder étant opaque, on ne pouvait pas voir la tuile en dessous

solutions :
- utiliser les bounds du collider de détection pour tracer le range des unités sur le placeholder
- utiliser un shader pour tracer un outline colorable autour des unités
- rendre le placeholder plus transparent
2023-06-13 18:30:15 -04:00
Felix Boucher
dfefec3dcc logic for placing object was not good
logic was supposed to allow placing object on farms, which it didn't

now it does.

+ changed ObjectPlaceholder's name so it follows the TilePlaceholder's convention
2023-06-11 14:29:44 -04:00
Felix Boucher
f65735c330 added one method summary
oublié de save, manquait ce changement
2023-06-11 14:15:06 -04:00
Felix Boucher
bdaedc28df address PR change requests
ranger les scripts au bon endroit

changer des noms de variables pour les rendre plus descriptif (turns out qu'elles étaient actually pas nécessaire)
2023-06-11 14:13:55 -04:00