Jump to content

Heppell08

Members
  • Content Count

    606
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Heppell08

  1. So i used to frequent these boards a while back but had to take a break from writing games and coding because of family life and children etc. I've decided to now come back to the coding scene and was just wondering what's new here? Spent alot of hours browsing these boards in the past and loved seeing this community flourish and help one another. Thanks for taking your time to read this and I look forward to speaking again sometime very soon! Also thanks Photon Storm you are one dedicated dude to this framework and i think alot of people would be very stuck or even lost withou
  2. RT @gustojunk: There is bad design, and then there’s shared touchscreen inside a public bathroom design. https://t.co/BqnhxtROHr

  3. This is something that requires you to destroy all the game elements and upon restarting that state again you create the game again. There are a few ways to achieve this with proper destruction and creation. Some elements may not need destroyed at all depending on what your game is and does etc but you do need to destroy then recreate on loading the state again.
  4. I would have used a for iteration loop with that group and moved them like that with some parameters in place for distance/alive etc. Even a forEach may have done the trick here too.
  5. You wouldn't need to ask the user if they are desktop or mobile to show the onscreen touch keys you would be adding because phaser has device code in there. If you're using states like boot and menu etc then you can decide if touchscreen is on or not via the boot with a simple if(). if(this.game.device.desktop === true) { return; } else { // load touch buttons here } I'm on mobile at the minute so that is psuedo code but look up device code in phaser. It is like the code above that can sit in the boot and either load or not load them buttons for you. The main change would really be to add a b
  6. Have you got a for iteration loop doing the checks and lifespan on the group of sprites to be killed at the alotted period you set? Have you any code examples or snippets on what you are doing? I don't personally use lifespan but to achieve the same result you require would be simple in the terms of creating a custom sprite timer but that is just overlooking what lifespan does for you in phaser.
  7. Yeah I use codevinsky's yeoman generator. Has watchify, server, minify and all the other cool stuff required. Don't see the use for more generators when Codevinsky's already does the job required. Suppose each to their own though.
  8. Destroy the layer the recreate the map as normal.
  9. i personally used this for my game to have the onscreen touch joypad. You can choose different looks and styles etc with it and its pretty responsive too. My code for it is: if (this.game.device.desktop) { return; } else GameController.init({ left: { type: 'joystick', joystick: { touchMove: function (details) { if (details.dx < -5) { left = true; } else if (details.dx > 5) {
  10. Maybe set them to out of bounds kill so when they go off screen they are killed that way?
  11. Hmm, well if even making it global doesn't help them maybe trying to user a getAt() in a loop and cycling them. I would have thought a forEach would do the job or a getFirstDead() cycling the group would do the work for you.
  12. Place coin as global and not anon in your create function.
  13. function coinKill(coin) { if(coin.x < 0) {coin.destroy();} } Its how I kill coins but its similar to collide coding the coins. You shouldn't need to reference the actual group itself because you can reference the children (coin) instead.
  14. In one of my games I just destroy the layer and then recreate the next map on the layer after destroying the previous maps layer. I also have a load of number variables keeping track of what map loads at what time. I did it that way to prevent having many many different state files per level. Also is useful because all the basic game core logic and level changing code is kept in a single state and file. Hopefully that makes some sense but if not I can show you some examples or even the raw function itself.
  15. I personally use this: https://github.com/codevinsky/generator-phaser-official Codevinsky set it up and it works perfectly.
  16. Have you tried: (function() { console.dump = function(myTilemap) { if (window.JSON && window.JSON.stringify) console.log(JSON.stringify(myTilemap)); else console.log(myTilemap); }; })(); Just as a means for testing it ffor outputting the correct data.
  17. I've had some experience using mySQL and can safely say it is not my favourite environment to code in. I do however know this is possible. CSV Storage - http://www.mysqltutorial.org/import-csv-file-mysql-table/ JSON Storage - http://stackoverflow.com/questions/12165456/import-json-file-into-mysql-database-with-php
  18. This may be of use to you then: http://www.html5gamedevs.com/topic/2016-rectangle-fade/
  19. if(activePointer.x < game.world.width/2) { ... Left } if(activePointer.x > game.world.width/2) { ... Right }
  20. You'd need to set up a few arguments like. if(player.exists === false) { ... Game over etc here } But it totally depends on how you have the logic laid out really. Just check for the death of player or use a physics collode/overlap to do the callbacks if the player dies on contact with the enemy.
  21. If you have a group of enemies and want them to spawn from the top of the screen randomly then in your group creation and spawn you can set the Y to above world height and set the X to game.world.randomX;
  22. var updateText;updateText = game.add.text(10,10,'Points:');// update loop belowupdateText.setText('Points:' + window.points);with setText it will update the text when you require it to do so.
  23. After updating to 2.0.7 today my buttons work fine with the events.add.onInputOver and onInputOut code.
×
×
  • Create New...