Jump to content

[WIP] GitHub 2013 Gameoff entry


Pert
 Share

Recommended Posts

post-6101-0-99875700-1389184685.png

Here is my first try at HTML5 games, built in few weeks with Phaser JS for GitHub Gameoff.

Personally, the best "feature" must be randomly generated level, there are couple of errors / corner cases that could do with extra polish.

I was planning to add changing level graphics (ie if timer runs out, the level becomes covered with snow etc), but unfortunately ran out of time.

Sprites are mine, but all the tiles are from http://opengameart.org/content/gfxlib-fuzed

In case anyone feels like giving some coding pointers, the source code is a bit of a mess, a bit of a quickly bash out some code and hope for the best.

At first I used global variables to deal with everything, which is OK for simple example program, but not really a working game. Once I got to the enemies, everything is held in individual objects along with helper methods that deal with AI or death animations etc.

 

Links

Play [http://webviking.co.uk/github-gameoff/]

Source code [https://github.com/vikerlane/game-off-2013]

 

Conclusion

I found Phaser JS to be extremely fitting with my own coding style, and in the end I feel pretty confident on how I would tackle my next HTML5 game.

On the negative side, I'm not as strong in game art than I assumed I was and it was much harder to actually finish a simple game than it seems when looking at stuff other people put out.

On to the next challenge?!

Link to comment
Share on other sites

Ahh ok! So it IS the hole then. I was partly right :) Just replayed it and managed to make it to level 2. The time limit is punishing though, it took me a good 12 seconds just to jump from the ground up to the hole! So it would have been utterly impossible to get all the nuts I think. Sometimes the tree branches seemed to be generated in more friendly places making the trip up quicker - are they the random part you were talking about?

Link to comment
Share on other sites

Branches, tree trunk location and mountain left and right are randomly generated.

Terrain is mostly there just to stop player run out of the screen (sort of visible and believable invisible wall) and not many nuts will be dropped there, but the generation code is pretty smooth, it works from far side in, and then goes back one tile and does all the corner cases depending on what current random row height is, spent probably more on polishing that aspect than anyone would notice while playing it ha ha.

Sometimes you end up with really easy layout so you fly through levels with plenty extra time, so I roughly choose a random time limit. Sometimes it works, sometimes it doesn't, safe to say balancing is non-existent :)

Try to make it to few more levels and you can report in couple of enemy / nut collision bugs ;)

 

I could not figure out how to make all nuts completely stationary, physics code seemed to insist they had to move 0.00000001 - to be fair, now that I think of it, I probably could have easily said, if movement is less than a really small value, stop running said nut through physics calculations, as it is probably still and easily solved the most obvious problem (bears sometimes walking over stationary nut and getting hit/killed).

Link to comment
Share on other sites

I added a feature the other day that allows physics bodies to go to sleep if their velocity remains between a certain threshold for too long (you control the threshold and duration). Sounds like it could have been useful here, as you could have skipped creature - nut collision if the nut was sleeping.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...