Sunday, March 19, 2017

Moving on to something new

After the calculator got out there and did reasonably well, I was encouraged.  Maybe this is a thing I can do.  Lua is a pretty cool language and is as simple as languages get.   Corona is pretty straightforward.   So the next thing I started was a simple keep a balloon in the air game with a bee theme.  I say started because even though you can code in a language and understand the sdk, that doesn't mean you know how to create a working game.   Plus there is the problem with the graphics.   You have to have something to push around the screen.   Unless you plan on paying someone to do all your graphics for you, you need to learn how to use photoshop very well.   After coding this game for a few months I only got through 2 levels and the code was a mess.   When I say coding I mean coding, game designing, creating graphics etc.  You will find as I did that you spend as much time designing the game as coding it.   I found myself asking myself questions like "What is the theme of the game?  What makes it fun?  What types of characters does it have?  What do these characters look like?". 

   After, getting two levels finished I realized I didn't have enough of these questions answered completely.   You would think that a simple balloon pop game would be pretty straight forward but it really isn't.   The game design was mess and I realized that I needed to start over and come up with a better and more well thought out theme.   I guess I didn't want to just put out a crappy game.  There are so many of those out there already.  One more would just be a waste of everyone's time.

   But all is not lost.  It was all a learning experience.  I realized that I did not know how to code in an OOP fashion.   When I learned Lua I just learned it in a procedural simple fashion.   I need to also learn to code better or the code would be unmanageable.   I also realized that the code needed to be data driven.   That means one master file that drives the code.   If each level can not have its own code.  If you end up with 75 levels that would mean 75 modules and that would be totally unmanageable.  Everything would be duplicated over and over again. 

    There was really just so much to learn it is hard to fathom.  I ended up having to learn more that I could ever convey in a forum post, an example of which is something I mentioned in the last paragraph.   I had to learn how to break the code up into modules.   When you start writing a game you logically just start coding and your file just grows and grows.   At some point you realize this just can't continue and you have to start breaking up things into different modules.   When I started coding there was one way to break up things and then a year later everyone changed to a new method of doing modules by passing tables with meta tables associated with them.   In the middle of everything I had to refactor things based on the new method.

   So how does one learn how to code in an OOP fashion and learn an SDK and learn how to create a game anyway.   I started browsing the web looking for clues where I could find them. 

No comments:

Post a Comment