Skip to main content

Turning Off Player Input

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.


Popular posts from this blog

Level Buddy | Blender Addon

An old-school CSG inspired level editor add-on for Blender 3D. The add-on is still very much a work in progress but fairly solid for blocking spaces super quickly.  Just because graphic fidelity has gotten insanely good and hyper detailed doesn't mean we shouldn't look back how older games were put together, at least that is my opinion.  One thing I always come back to is how quickly the tools in the first 2 versions of Unreal Ed 2 and Doom level editors allowed anyone to block out a level, iterate on feedback or try an idea out.  So I just took some time to put together a similar pipeline right in my 3d package of choice.  I wanted to keep it simple and quick to try out level design ideas.  You can use it for simple white boxing of your level, break it up into multiple static meshes and import them into your game engine of choice or  you can use that as your starting point to start more detailed modeling .  When you build the map you get a single static mesh th

Plunder Bunny | Flash Game Character Mockups

Another collection of design/mockup sheets for a personal project.  The game was a very simple 2D platformer in the vain of Super Mario.  I got pretty far with the game but ended up getting busy with some contract work and the project feel into the ever growing abyss of personal projects.  When I get some more free time I'd like to try and re-visit it. The visuals were really fun to work on.  Inkscape was used to flesh out my initial sketches.  Each character was broken up into pieces like a paper puppet.  After Saving the pieces out at high resolution they would then be put back together in Blender 3D where they would be animated.

Landing Party Lost | 2D Pixel Art Game Screen Mockup

Mockups of a Sci-Fi Adventure Game Idea Landing Party Lost, is an idea I have been slowly kicking around.  I was watching the latest Star Trek movie and loved the look of the set where the first Klingon encounter takes place.  Then it got me thinking about Another World, also known as Out of this World.  I loved that game and have always wanted to do a game similar to it. So sat down and quickly did a rough sketch and started to build out from there.  I wanted to combine the visuals from Pitfall on the Atari but use modern per-pixel lighting.  So I brought all of the spites and 2D images into Blender 3D and started to piece a few scenes together.  From there player movement was wired up with logic bricks and a couple of python scripts to handle room transitions and sprite animation. I don't know if I will keep building upon this idea mostly because I just don't have a clear enough idea of how the game will play.  It did get me thinking about the need to really buckle