I created a tumblr account. I'm not much of a tumblr guy but there is one major benefit of using tumblr. It makes it easy to link up all of your different social media accounts. Once they are linked you can simply post something on tumblr and it will post to all of your other accounts on twitter and facebook. I set it up and it works great! That was pretty much all I did for marketing.
Design:
I don't know how much you know about Game Maker but just to make sure you understand. Game Maker has a section for Scripts. A script is basically just a function that you can use inside of any object. Objects are basically just classes.
The idea is that you can use scripts to simplify the logic behind the coding and even the amount of coding that you have to do.
For example, let's say that you create a script named "rkey" and you put this code inside of it:
Cool trick right? Now you might be thinking. That's nice Ben, but it really isn't that new.
Don't worry. It get's better. Let's say that each of these scripts is now called an event. Game Maker already uses this term but not usually in this context. Now, using scripts like I just showed you, let's say that you create different events based on your type of game. For my game I would have some events like these.
facing //returns the direction the player is facing.
attacking //returns whether or not the player is attacking.
attsprite //changes the sprite to an attacking sprite by taking direction the player is facing as an argument.
For the sake of this example I'll also say that the "ckey" is the key that triggers an attack. Now that we have some different events created you can combine these events in ways that make sense logically.
Coding:
Well, this is the idea that I had yesterday and I already started coding it into the game. I'm really excited about it.
There's not much reason to do this. Just typing
ReplyDeleteif (keyboard_check(key))
Isn't that much longer at all, and it's still very readable, in fact, more readable to people checking out your code.
Not to mention, more efficient, since there's less if{}else{} checks going on.
DeleteThat is true. It is more efficient to simply write it that way.
ReplyDeleteI'm not sure I was able to get across the big picture to you though. I was only using that as an example. The idea is that you create smaller events and combine them in ways that does make the code more readable. I guess I didn't explain it as well as I wanted to.
Totally agree, the "divide and conquer" strategy is the only way to keep larger projects manageable.
ReplyDeleteEfficiency is not attained by eliminating a few if-then-else loops, people overestimate how long code takes to execute. Having functions with clear names makes a lot of difference.
Also, imagine not working on a project for two years and coming back for a sequel. Will you still be able to read your code? That's important too :)