In the last post I talked about how thanks to the data first design idea how easy it was to add in "on_enter" and "on_exit" logic when the player enters and exits a room. Well after I posted that a situation came up where I really wanted to turn off the players input while a bit of logic ran and then turn it back on when it was done.
Again this entirely new feature was implemented in a couple of minutes. To do this I added in a simple bool variable called "player_input" at the root of my data format. Then I added two new functions to my "system" functions called called "input_on" and "input_off" where I set the "player_input" to either True or False.
Next I added the "player_input" variable to my if statements where I check for input. There are only 9 spots I check for input 3 for rooms, 3 for actors and 3 for objects. The inputs there are normal "mouse_down", "mouse_over" and "mouse_down" checks. So again in a matter of minutes I had implemented another finished feature, exposed it through the tools and had it an in-game example running perfectly.
I think the thing that I did the most out of this entire approach of data first is that the engine side code is so simple and small that bugs have remained very small. Most of the bugs I have hit have all been very minor and so far content only.
Again this entirely new feature was implemented in a couple of minutes. To do this I added in a simple bool variable called "player_input" at the root of my data format. Then I added two new functions to my "system" functions called called "input_on" and "input_off" where I set the "player_input" to either True or False.
Next I added the "player_input" variable to my if statements where I check for input. There are only 9 spots I check for input 3 for rooms, 3 for actors and 3 for objects. The inputs there are normal "mouse_down", "mouse_over" and "mouse_down" checks. So again in a matter of minutes I had implemented another finished feature, exposed it through the tools and had it an in-game example running perfectly.
I think the thing that I did the most out of this entire approach of data first is that the engine side code is so simple and small that bugs have remained very small. Most of the bugs I have hit have all been very minor and so far content only.
Comments
Post a Comment