GaryS Posted April 19, 2016 Share Posted April 19, 2016 Shiftah is not only my first LD entry, but also my first ever game! I've been messing about with Phaser for a few months now, loving every minute of it... so thought I'd enter Ludum Dare for the first time. The theme was 'ShapeShift', which just basically screams 'Altered Beast' to me... however with my limited graphical acumen, what I've ended up with is an endless runner style game where you navigate your ship through an onslaught of blocks and shapes, trying not to get stuck. The physics are a bit shonky, it has to be said - (I could do with a bit of help on that), but as it stands the game is playable. All in, this was about 30 hours work and includes my first attempts at MOD tracker music too! You can play the game directly or view my LD submission page. Quote Link to comment Share on other sites More sharing options...
mattstyles Posted April 20, 2016 Share Posted April 20, 2016 Good work Gary, well done on the LD entry! Use of local storage for scores is a nice extra for an LD entry and it plays well. I'd probably like to be able to slide up and down the obstacles, I kinda got stuck on them, but it certainly made it more difficult. Quote Link to comment Share on other sites More sharing options...
GaryS Posted April 20, 2016 Author Share Posted April 20, 2016 Thanks Matt! Also, thanks for noticing that I've got local storage working on that! As it happens, local storage was really easy. No more difficult than writing a cookie... and if I'm honest, I already had the code to do it laying about. I've been playing with Phaser for a while, using a basic game as a testbed for techniques and ideas. One of the things I always like to do is write code that can be reusable, and thus I wrote a 'GameData' prefab that handles keeping, updating and displaying stats... scores and the like. I'd hoped that my prefabs could be dropped into any game I create, and so far that seems to be working well! As for the blocks, you should be able to slide up and down them... I've had a bit of difficulty there with arcade physics. As best I can tell, the issue is that the blocks the player collides with are constantly moving, and the collide function aims to move the player back outside of the collision range - this seems to override the velocity that the player happens to have and causes it to stop dead. Someone suggested I make the collision boundry per row instead of per block, which might work - but will be fiddly to implement. I've also had a bit of a problem with the movement of the ship... I was trying to be clever with my ship prefab - it has multiple ways of moving - and the best way I could find to allow switching between rotation style movement and basic 8-way movement was to use velocityFromAngle to propel it forward and backwards. All seemed to work well in testing, but I've found when playing the game that for some reason when rotated to face backwards and moving 'forwards' (relatively, so, backwards), the ship can sometimes move much slower than I think it should. No idea why that could be!! Quote Link to comment Share on other sites More sharing options...
mattstyles Posted April 21, 2016 Share Posted April 21, 2016 Ah, I see, you're sliding the blocks? I assumed that the blocks would be static and then it is the camera that moves. I don't know anything about arcade physics but naturally you should be able to slide against a surface (which would take into account friction) and that is far easier when one of those objects is static, like sliding against a wall, it would be significantly harder to slide laterally if the wall was pushing back towards you. This reduces your physics logic too as static objects are far far cheaper to model. Writing reliable and robust reusable code is key. Yes local storage is very easy and its pretty much ubiquitous now so little reason not to use it, its certainly easier than faffing with cookies. I actually have a system going (not particularly useful for fast paced games) that uses a centralised state object (all of the state for you app is in one place), when there is an error it pings the entire state tree into local storage (if it can, there are limits on local storage), from there I can grab the state tree and use it to exactly replicate the state that caused the error. No more faffing with a complicated set of replication steps, just grab the state and reproduce the error. 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.