Wednesday, August 10, 2011

Current snippets update

Still working on getting some useful mechanics snippets out. I want to focus on posting snippets that are the most helpful and insightful into some of the problems in coding game mechanics and game logic. I am working on the jump mechanic and others for platformers. What I am finding more and more is that most platformers have very specific code for handling their basic mechanics, since this is the first time I've actually attempted to write platformer movement code it's taking a while to get right. So today I will am posting my current progress it works in the sense that you can add platforms and jump from platform to platform but there are a number of subtle issues that you wouldn't want in the end.

To Fall or not to Fall
All I really wanted to show was a jump mechanic then I decided to add gravity since it is needed in order to do jumping, and then I figured we need platform collisions to stop the player and provide a base for jumping. The problem I am facing as of this writing is that of gravity as a constant acceleration in a direction (at this point it's mainly in the positive y direction or down but it's not hard and set in code) I am thinking I am trying to do too much at once perhaps it's better to do some daily progress. I don't expect the progress to be that great as it is I don't have much time to spend on doing these snippets and often second guess posting some times to hold out for a better idea or a more critiqued snippet and post.

Why I never tried coding a platformer before?
I've been programming games for a long time now 10+ years and while I did originally start a project similar to a platformer at that time I did not know the necessary physics to code the movement. The main reason though is that I've never been that much of a platformer player or enthusiast. I traditionally like strategy games and action-adventure's and as a game designer am enthralled with the design of arcade and puzzle games mainly due to a history of diverse and interesting mechanics and design.

Small Simple Prototypes
As a game programmer I often find it very helpful to iron out small simple snippets to test drive certain game code such as creating a specific effect or as previous posts suggest, framework code (e.g Resource Manager, Game State Machine, and things like Timed Animation etc.). I am confident in my knowledge base for graphics and API code plus the core framework coding to move on to the more important code which is the actual interactive elements of game code. I think small self contained example code lends itself well to solving buggy mechanics or smoothing out small issues. It helps you experiment with an idea and I believe it allows you to evolve mechanics easily. At the very least it is the exercise of taking your ideas for a specific piece of code in a game and presenting you with actual syntactical and logic problems.

Once you've mastered the basic logic structure of something like, "obtaining gold coins to use in a store to buy better weapons to kill more enemies to get more gold". You can most likely implement it much better in the future. If you've never coded something before you can't predict how long it will take to get right, but once you have that and similar codes become easier and easier.


No comments:

Post a Comment