Clockwork TD Devlog #3: CursorState FSM
This is the third post in an ongoing series about the development of my thesis project, Clockwork TD.
Rather than define separate game states Building, Moving, Selling, etc., I chose to create a separate FSM for the cursor state. Like the game states, each of the cursor states is strongly defined as a ScriptableObject; this makes it easy to add new game & cursor states and also to access them from anywhere in the project. The base CursorState includes abstract & virtual methods to override, depending on the desired behavior of the current state.
As in the GameStates, CursorStates have Entered and Exited events that can be subscribed to, as well as OnEnter() and OnExit() methods for inheriting CursorStates to override. Buildable and Tile both implement the “IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler” interfaces, calling back to the current CursorState during those mouse events. This allows the code for say, Building to be fairly straightforward (incomplete code but you can get the gist — oh I just got why github named it that).
To keep reading this devlog and see the example code & gifs, visit:
https://onewinter.net/2023/07/11/clockwork-td-devlog-3-cursorstate-fsm/
Get Terrorformer TD
Terrorformer TD
Terraform a changing map in this Roguelike TD!
Status | In development |
Author | TJ Cioffe |
Genre | Strategy, Role Playing |
Tags | Indie, Low-poly, Procedural Generation, Roguelike, Roguelite, Singleplayer, Tower Defense, Unity |
Languages | English |
More posts
- Terrorformer TD Devlog #13: AchievementsFeb 05, 2024
- Terrorformer TD Devlog # 12: Adding Inter-Game ProgressionJan 31, 2024
- Clockwork TD Devlog #11: New Year, New Features, New... Name?Jan 31, 2024
- Clockwork TD Devlog #10: Year-End Wrap-upDec 16, 2023
- Clockwork TD Devlog #9: TowersDec 15, 2023
- Clockwork TD Devlog #8: EnemiesDec 14, 2023
- Clockwork TD Devlog #7: Map Progression Pt. 2Dec 13, 2023
- Clockwork TD Devlog #6: Instant Abilities!Sep 11, 2023
- Clockwork TD Devlog #5: Terrain BonusesJul 18, 2023
- Clockwork TD Devlog #4: Dynamic Build MenusJul 14, 2023
Leave a comment
Log in with itch.io to leave a comment.