Sabbatical Log: November 25thPosted: 2018/12/02 Filed under: code Comments Off on Sabbatical Log: November 25th
This blog series is running about a week behind my actual work, giving me time to clean things up. The date the actual work was done is in the title, horizontal lines indicate when I stopped writing and started coding.
Time to get to work on stairs.
First step is to actually make the entities and get the exit logic working.
I’ve managed to get all the actual loading parts of stairs working, and have reworked system enabling/disabling so animations can play during any exit transition.
Actually building the stairs animations is rather error prone, at the moment I’ve got the first half of going up stairs working alright. The rest will have to wait for later.
I also need to make some changes to rendering to make sure multi-level entities (like the door frames) render appropriately.
Now all animations for stairs are working.
Some interesting things that had to be solved:
- Stairs are necessarily wider than the player, so positioning pre- and post-transition isn’t trivial
- The transition time (that controls the fade in/out) has to be synced to both the player’s animations and their position
- Player’s have to be nudged out of doors so their first post-transition move doesn’t immediately trigger the stairs again
- Subsets of the player control and animation systems have to be enabled during a transition
I’m not in love with the code I’ve written, but it will do for now. There’s one more exit type – pits – I want to tackle, but I need a break from fiddling with sprites and animations. I’m going to detour into component reuse / object pools for a bit, and come back to the final exit type.