14 Commits

Author SHA1 Message Date
fd22af5e65 Revert FetchDatabaseStatic because it prevents builds 2023-07-22 01:32:22 -04:00
ecd32b09b8 Level 1 to 6 and allow loading levels in worldMap 2023-07-22 01:24:05 -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
33fb1ffeee test scene, render issues, collision issues
problems :
- there were no test scene
- units would appear weird over some tiles
- units would not recognize some tiles when trying to know if it could place itself on it

solution :
- added test scene
- tweaked sorting layers in units
- added IsCollidable parameter in ILevelObject
2023-06-08 23:51:45 -04:00
Felix Boucher
102f646340 center GOs without offsetting them
problème : les game objects sont offsettés de (-.5, -.5) par rapport aux tiles

contrainte : on ne veut pas changer l'ancrage des game objects ou des tiles

solution : changer le point d'ancrage des tilemaps à la place. Cela peut se faire automatiquement à la création du niveau.
2023-06-06 14:46:33 -04:00
Felix Boucher
0a8f5d1a5a some last moment fixes 2023-06-03 09:42:50 -04:00
Felix Boucher
86cb9280b4 drag and drop 2023-06-03 09:35:13 -04:00
Felix Boucher
da519fe75f enlevé génération automatique de Level Manager
la génération automatique de level manager faisait bugger le jeu

j'ai effacé cette partie du code et ça marche maintenant
2023-06-02 14:11:51 -04:00
Felix Boucher
c1f008104e manage when tiles or objects are removed
problème : Le level manager n'était pas notified quand un objet ou une tile était enlevée du niveau

solution : LevelTile et LevelObject gèrent l'effaçage avec RefreshTile et OnDestroy.
2023-05-28 23:02:33 -04:00
Felix Boucher
8b5d0370dc tidied up + addressed issue with non-LevelTiles
problèmes :
- mon code et l'arrangement des fichiers avait besoin d'un peu de tidy up
- les tiles qui n'étaient pas des LevelTile ne loadaient pas

solution :
- rangé un peu + respecté structure une classe - un fichier
- tenté un build pour voir si tout roulait comme il faut, ce qui m'a porté à ajouter des directives de preprocessing et à bouger les custom inspectors dans le dossier Editor.
- ajouté une représentation simple des tuiles non-LevelTile dans la sauvegarde.
2023-05-28 22:00:47 -04:00
Felix Boucher
ef8a70aba4 finish to hijack update loop + serialization
problem : tiles dont have an update loop, neither do they have a start / destroy method

solution : finished working on a way to create a custom start/update/destroy pipeline for the projects custom tiles. it's using LevelManagerScript as to Update.

note : also created a database and a start of serialization system so we can save and load stuff.
2023-05-27 20:38:42 -04:00
Felix Boucher
d10677db6d tweaks to LevelManager
le fait qu'il faille updater des tiles du tilemap posait un réel problème

création d'un système d'héritage pour que les game objects et les tiles puissent cohabiter dans une même game loop

- ILevelObject contient des fonctions de start, de destroy, d'update, d'égalité et une position

- LevelTile et LevelObject héritent de ILevelObject et peuvent être hérité par des tiles ou des MonoBehaviours.

- le level manager est un monobehaviour singleton qui update tous les ILevelObjects à chaque frame.
2023-05-27 20:38:42 -04:00
Felix Boucher
22abe69340 tidy up level manager related scripts
scripts were not classified

created a LevelManager folder in the scripts folder
2023-05-20 22:42:03 -04:00