Nostalgia

It’s just gone midnight and I’ve spent a large part of today programming the next crappy game. I’m a few deep, Peach pit is playing, earlier it was music I used to listen to when I was either learning to program or early in my career. I reminisce about evenings spent gaming, learning things, making stuff. Tonight has been eerily similar to those I remember, almost like a familiar shoe. Evenings like this one have always been a bit of an escape from shitty days and this one is no exception.

I’ve got a list of ideas for crappy games but this one hasn’t come from that list, it was a spontaneous idea as I sat down to begin work. Mildly inspired by the “World’s hardest game”.

Gauntlet

Deciding to stay with Javascript for this one because I’m on a short time limit this week. In a few short hours I’ve got a decent base down to build the rest of the game. Player OOB detection is a bit broken but I think I’ve figured out how I can make it work. The objective is simple, make your way through the maze. I have ideas for obstacles and the like.

Will I eventually fill in all of the level or will I submit defeat and shrink the canvas? Find out, maybe, tomorrow. Maybe next week. No demo yet. Just an awful, rambling blog post.

Polishing A Turd

I pride myself with not spending longer than is necessary on a project.

That being said I present the final version of crappy higher or lower, a day late. At least I’m semi happy with it, right?

As before, it’s playable here.

Final features

I decided I’d add a score timeline to the history section. It felt like a good idea and made the history portion a non sensical mess. Goal achieved. Some styling would help but I’m not spending any more time on this. Time to kill it.

I added a function to toggle the behaviour of button presses too. This prevents weird behaviour where a user could press a control more than once at a time, triggering several rolls. This thing is more robust than some of the code in my day job.

I didn’t do local storage game saves because well, there’s no point. If anyone plays this final version more than once and gets upset that their high score isn’t saved then I’ll buy them a drink to make up for it.

Refactoring

I don’t know why I refactored it. The fact is the code was a bit messy and not my best. I reckon I could get it down to less than 100 lines if I tried but it’s current state is that it works and is readable, in my opinion. In my head I didn’t want to put messy code online but half way through me refactoring I realised that I already had in the previous two versions and that I’m currently anonymous too.

I also realised that I just don’t care anymore. I used to be afraid of showing others code that I’d written. These days I’m seeing it as a learning opportunity. If someone can show me a better way of doing something then great, I’m all ears.

Lessons learnt

  • Just finish the damn thing.
    I’m writing this blog post at quarter to midnight, a day after the deadline I set myself. Partly because this is when I work anyway but also because I’m lazy. I could have finished this by last weekend if I’d bothered but also, why not play overwatch? It wasn’t a particularly long project. If I don’t include the blog writing, I’d estimate about 3-4 hours spent on this in total. Realistically I could have done that in a single evening but I allowed other things to get in the way. Stop wasting time and just code for god sake.

  • Write code quickly.
    This is something I sort of subscribed to already. My point is that instead of trying to write the neatest code immediately just get something working. The options for more clever logic or simplified functions will appear and jump out at you. Obviously, take this with a pinch of salt. Should you begin writing a long term project in this way without regular, thorough refactoring? Absolutely not, the creator of in depth planning sleeps soundly in their grave. But I’m a firm believer of trying out a new concept or idea quickly to get some feedback from your own usage. Especially important with UI.

  • Practise pure javascript more.
    Some of the stuff I had to look up for this was just dumb. Partly because I always get some things confused with php syntax but also because I’ve only ever learnt to do some things in jQuery or in JS frameworks. I feel like I need to go back to my roots a little and rely less on frameworks. Yes they make my life easier but also, they’re just not needed for small stuff like this.

The First Crappy Update

So over the week I managed to get a little time to upgrade the look of crappy higher or lower. I’ve also just added a rough and ready game history.

Behold it’s slightly easier to look at crappiness.

As before, it’s playable in this version here.

Before I consider this game finished, I want to style the game history and refactor the code a bit. I won’t spend too long on it as this has had the sum total of about an hour and a half spent on it so far so isn’t worth the time. One last little update to come and I might see if I can squeeze local storage of game save state in at the same time.

The First Crappy Game

Technically, this isn’t my first crappy game. So I’m already lying to anyone reading this. I have actually made a couple of crappy games and I even released one on Android. In fact, that process is in fact part of the inspiration for this blog. I enjoyed learning something new and developing something that I wasn’t comfortable with. Combine that memory with an ever increasing disdain for my programming day job and this challenge is the result. Create a game every week for a year.

They won’t be good. However, if I limit myself to a week I have to focus on easy to execute ideas and actually trying to be better at programming as well as design. It’s a get good situation.

Let’s begin.

Higher or lower


Everyone has seen some sort of a variation of this game, whether it’s the one of the thousands of other clones of this game already available or the card based format as made popular by ol’ Bruce. God rest his soul.

My idea is based on the classic game with what you could barely classify as a twist. The objective is to play higher or lower and achieve the longest streak possible, inspired by a casino game in the largely toxic and obscure game Tower Unite.

To save wrangling with new languages in the first week of the year, I’m sticking with old faithful javascript. Let’s be honest, anything more is overkill.

My process


So the concept and idea is very simple;

  • Higher or lower is selected.
  • A random number from 0 to 10 inclusive is selected.
  • If the numbers were the same, nothing happens and higher or lower is selected again.
  • If the correct choice was made, add one to the current score and wait for another choice.
  • If the choice is incorrect, reset the current score and update the high score if it is greater than the current high score.

To get something up and running quickly, I templated a simple UI and got to work with the game logic. About half an hour and a couple of games of overwatch later, the game was made.

It’s playable in all it’s crappy glory here.

Future expansion


It doesn’t end there, I’m going to expand on it a bit to use the rest of the week. Things planned are;

  • UI upgrade, make it actually look good.
  • Stored high score & game state, probably through local storage.
  • Displaying previous numbers in current streak.

And that’s about it. A crappy game in a week.