Saturday 27 April 2013

._ for Ludum Dare 26



Controls: Left / Right / Up arrows.
Source Code link.
Ludum Dare entry link

How I found out?
I was subscribed to Loom's mailing list because I downloaded it before they started charging money and I received an email today that they were giving an offer for their engine for the Ludum Dare competition. Thanks to that, I checked out the competition and read that the theme was Minimalism.

Thoughts on the theme
I was not schooled in art but I did know a little bit of Mondrian and Minimalism through a game designer buddy of mine. I can't say I fully understand but I do know it is about taking away as much of something until you cannot take anymore away from it without destroying its essence.

I've read that Will Wright and several other famous game designers often use this technique of taking things away from a game to find its essence. For myself, I did not really spend too much time thinking of a new mechanic to showcase this. Instead I went for something staple which is that of a platformer. I thought of games like Canabalt and Mario and wondered if I could do something interesting other than what was already done before. I started thinking along the lines of gaps and manipulating them.

Other Concepts
My mind did want to explore other more interesting concepts but since I hadn't actually planned to do Ludum Dare and it was a spontaneous challenge, I thought I would just go with the flow and make something for fun, not so much as to break any ground. Some of the other concepts I was thinking about were a minimalist plane shooter, or maybe some even more abstract like some kind grid-base game where you can break a grid cell into 4 quads depending on where you clicked to partially create the Mondrian art style as part of the process.

Engine Choice
I think I should apologize to the Loom guys! I'm so sorry I found out about Ludum Dare through your email but I ended up choosing Flash as my engine choice because I'm more familiar with that. Also, I actually started working in Flash Builder for deployment on iOS but then I read that I should give up my source code so I decided to dump that project setup and move to Flash Pro for Web deployment, since I did not want to give away my source code for my previous mobile projects.

Code flow
Here's the coding flow which I used to make this game.

1. Player
I started by coding the player, it was a simple square that would act under gravity. I did this pretty quick since I have done this many times before. Basically just add velocity and gravity and have them act on the player's position.

2. PlatformsAdded some code to draw a platform.

3. Collision

I decided to go with the simplest kind of collision code of all. Extremely old school but I guess it works for my case, I just check if the player is within the platform manually or not. I actually do not use any hitTest or accurate physics for this.

if(player.x + player.width > platform1.x && 
  player.x < platform1.x+ platform1.width &&
  player.y + player.height > platform1.y &&
  player.y < platform1.y)

4. Game states
I prefer to do this early before the code gets messy so I added GameStart(), GameEnd(), GameUpdate() functions and also added the game over state in GameEnd.

5. Controls
Next up was the controls, I just went with left/right arrow keys for movement. And later I added Up key for jump.

6. Platform generation
There are always only two platforms in the game, especially since this was a minimalist game. I decided you would have to stand on the first before the second one showed up. I spent some time on this getting the platform to fade in according to how much time you stayed on the platform. After that, I swapped out the first platform to be the second and made a new (third) platform. At first I thought I'd just swap out the platform once the player jumped off the first platform, but I found that to be too punishing, and I wanted to allow the player to take his or her time with jump so I changed it such that the platform would only swap out once the player's x position is past the platform's right edge position. This would ensure that the player would have left the platform already and would allow the play to jump as many times as they want on the same platform if they stayed within the platform edges. I also chose to spawn platforms with greater gaps with each successful platform jump.

7. Deaths
Early in the development I actually already added a death sprite to show where the player died, which would indicate to them whether they've beaten their own progress if they replayed it. Then I suddenly had the idea to combine the previous idea of somehow developing a Mondrian painting as you played and I decided that the death markers would serve instead as an aesthetic to the game. So I changed them to be randomized rectangles that had these extending border lines or randomized line widths as well. Then end result was quite aesthetically pleasing such that when you died, you ended up making a splash on a painting.

8. Scoring
Scoring was simple and easy. It's an infinite game and your score is based on how far you manage to jump up to, so it is just the player's x position when he or she died as the score. A highscore is also kept at the top right.

9. To End or Not To End
By game jamming standards, this game was still really 'young', I only spent about 4 hours or so on it, I wondered if I should making the deaths markers be interactable or not. That could make the game really interesting. For example, maybe Blue rectangles could make the player float, Yellow & Red could do something different. But I thought oh well, I had not really planned to Ludum Dare and I was ok with what I had, it was meant to be a minimalist platformer and so it shall be. Not the best concept in the world but I'm glad I could execute it in a short time. It was also a really fun enjoyable concept experience for me.

10. Name
Now I had to think of a name, so I let my girlfriend name it. She came up with "._" which I think was awesome because it represented a minimalist platformer so well. Anyway, for trivia's sake, the working title was Gappy.

11. End
I think the final version of the game was pretty challenging. I ended up changing game variables on each jump so that it would get harder and less predictable as you played. For example, aside from the platform distances getting further, I also changed the jump power, the movement speed (which makes the game really slippery), as well as the camera catch up speed (which was necessary was there were bigger gaps).

12. Sound
And when I thought I had finished, and I even started writing this blog post, I forgot I had to do sound!! So here we go back to do the sound, luckily I'm just going to add one sound. And finally upload and end.

FIN

No comments:

Get Adsense

Want to earn money like me? Get Google Adsense now by clicking this