Jimmy Chattin - I make better games.

Friday, April 20, 2012

Program All the Things - Mami Update


I’ve recently promised to provide some code samples from our work on Mami, and have been talking about it even longer than that.  So, without further ado, le program:



Let’s start with some puzzles.  Above is the triggering code for the puzzles, and below that is the platforming code that handles various collisions with specific blocks within a level that open doors/grant recognition for this, that, and the other thing.  To reset the platforms, a simple timer will be used.  Easy!


As you can see, the implementation of special “shards” is a bit sparse; their collection throughout a level would activate various bonuses, but creating and managing another array within the game is currently being put on the back-burner.  The question is really how we would like to do it, and again, the time to implement and debug.


The last of the puzzle sections we are using, the map is very straight-forward; if the player is in reach of a special node, allow them to activate it.  Once activated, move to a new frame to show a picture, remove player control (aside for a deactivation button), and revert back to the playing frame once they are done looking at the map.  Only bringing in the picture into the library is the thing left to do.



AI seems to be the most fickle thing currently in our design.  To translate changing XY coordinates between the tiles, the enemies, and the player is just making a mess of things.  The chief programmer and I managed to make good progress on it, but the buggy nature of the beast has caused us to comment-out everything past our “patrol” mode and the self-deletion function.  For a demonstration of what we have, that code should be satisfactory (for the most part).

What’s here is but a very small part of the code structure, but the work I put in to creating these chunks of code helps the game flow in a way such that Team Squaybies may just make our deadline in 2 weeks!  Speaking of deadlines, I’ll let you go until next time.  Take care in commenting and reading future posts; I’m currently grinding through Majesty 2 and the original Half-Life.  Those are … interesting games.

No comments:

Post a Comment