Implemented color-component rules, generic rule system, and time blocks!
Black color can now be used as a beam and works similar to the other colors. When mixed with any color, the resulting color is black - so this works like an override. There is the concept of a “null” color value, which is either represented as black by default, or just simply no color/light. The concepts are sort of merged into one, so there are still only a total of 8 colors.
- black + anything = black
- null + anything = anything
Colors are now mostly treated as the existence of their sub-components: Red, green, and blue. This makes colors more interesting, but with a slight cost of having 3 mixed states instead of 8 unique states. It could be more limiting for more complicated levels, and could be initially less intuitive to the player, but it’s something I’m trying out for now. This concept can be slowly introduced by starting with base components, then later adding intermediate colors that show how they contain 2 base colors.
Color areas now have filtering capabilities due to this. They work similarly for both light and base colors of objects. The cases that the full light color is allowed through, are the same cases where base color objects are allowed through - you can’t split an object into separate objects this way (yet). Here are examples of all the important cases of color-component based light filtering:
Example with a control block:
Example with wall blocks - note the base goal block color must still exactly match the light color for it to have an effect:
Generic rule system
Wrote a generic library/system to handle all the color component matching logic with entities, and to be able to easily apply rules to them. This helps keep the logic working in a consistent way that should make the game more intuitive as well.
The older wall blocks and control blocks have not been updated to use this new system, because they do not necessarily change rules. But, it might make sense to change the game’s design to allow for this, so that they are rule blocks instead. The control blocks have very similar logic already, but have the extra “>= 1 alive” condition. It would make sense if the players turn to ghosts when dying, that you’d still be able to control them and they would just have limited interactions/capabilities. Just by removing that one arbitrary rule and updating the theme, that logic can now match how everything else works and lots of extra code can be deleted and replaced with 1 line of code to register the rule.
Added the time block as the first official block to use the generic rule system. This pauses entities that match the light color(s) of all time blocks. This level is interesting, because you have to kill one of the players to solve it (since having 2 locked are in the way), and use time travel to make the “shape” of players match the color areas. Since the player death state control logic isn’t finalized yet, I don’t want to post an actual recording yet. In the next post - when the player logic is updated - I will show a recording. Here’s a screenshot of the working time block level:
Resurrected the old offset code, and added a temp XY offset block for testing. Eventually, I will add an official offset rule block, that works just like the time block. Fixed a few minor rendering bugs, and added a gray background to indicate the void areas as a placeholder:
There is actually a 2nd way to expose the void world as well:
I’m planning on some way to have usable level space instead of an empty area. Maybe the alternate level can be “anchored” on one edge of the level, and exposing it in different ways will let you access different parts of it. There is still a lot to do with the offsets: the camera isn’t working correctly, the change in offsets is not animated smoothly, and the void spaces are not yet usable. I’ll be working on this, along with improving the theme, player mechanics, and making existing mechanics more consistent with each other.