Pert Posted January 8, 2014 Share Posted January 8, 2014 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-fuzedIn 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. LinksPlay [http://webviking.co.uk/github-gameoff/]Source code [https://github.com/vikerlane/game-off-2013] ConclusionI 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?! Quote Link to comment Share on other sites More sharing options...
rich Posted January 8, 2014 Share Posted January 8, 2014 Lovely looking game! I have to admit I couldn't work out where my nest was. I was trying to throw the nuts into the hole in the tree for one complete game, until I ran out of time. Then was just throwing them anywhere in the hope one might find the nest for me Quote Link to comment Share on other sites More sharing options...
Pert Posted January 8, 2014 Author Share Posted January 8, 2014 Yeah, I have to admit the "collision" with the hole on the tree does not always work, unless you find a nice sweet spot to throw them in.But, have you tried to walk over the nest while carrying a nut? Quote Link to comment Share on other sites More sharing options...
rich Posted January 8, 2014 Share Posted January 8, 2014 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? Quote Link to comment Share on other sites More sharing options...
Pert Posted January 8, 2014 Author Share Posted January 8, 2014 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). Quote Link to comment Share on other sites More sharing options...
rich Posted January 8, 2014 Share Posted January 8, 2014 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. Quote Link to comment Share on other sites More sharing options...
Pert Posted January 8, 2014 Author Share Posted January 8, 2014 Yeah, that would be super helpful - I tried to force it with setting velocities to 0 if they were below certain threshold, but I guess it was already "inside" a tile or still dropping so physic calculation was trying to move it next frame regardless. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.