• Content Count

  • Joined

  • Last visited

Reputation Activity

  1. Like
    RubbleGames reacted to BastardCode in Phaser Keyboard Codes Cheatsheet   
    Subjects in the title. For those who bashed their head against their keyboard figuring this out (like myself) here it is, buried in the (very readable) source.
  2. Like
    RubbleGames reacted to AntonBel in Clicking outside game window causes freezing   
    I had this problem with iframe freezing.  It happens   when you use new versions of Phaser.  Switch to 2.6.2 version it it will work fine. 
  3. Like
    RubbleGames reacted to samme in Clicking outside game window causes freezing   
  4. Like
    RubbleGames reacted to mattstyles in Problem with local storage save   
    No, from his response just change "zombie_save" to "save", the problem is that you're assuming that is localStorage.length > 0 then "save" will be there and correct, however, from my screenshot localStorage.length will equal 5, so, in your code, you'll carry on and get `null` returned from getting the item from localStorage, which you then try to access with saveObject.hordeSpeed which will blow up.
    Infact, BdR's answer isn't quite going to work for you either as JSON.parse(null) won't error, it'll just return null (as you should expect) so you'll never set the default values.
    However, you should go ahead and change the key to something more specific to you (I'd suggest zombie_save isn't unique enough to be safe), the problem you're having is that some people maybe already have a "save" key in their localStorage as you said some peeps seem to be able to playing as if they had previously saved.
    In short, it sounds like you might have two problems:
    * Your key isn't unique to you as games on newgrounds seem to share a domain and hence share a localStorage -> solved by making the key really very unique (i.e. 'rubble_zombies_save_XYZ')
    * You're not checking carefully enough that your saved variable is actually what you expect
    To solve problem two you could do something like the following to populate with default values:
    const defaultSaveState = { hordeSpeed: 10, level: 1, coins: 0 } function getSaveState (key) { const savedObject = localStorage.getItem(key) return Object.assign({}, defaultSaveState, JSON.parse(savedObject)) } // Call it const state = getSaveState('rubbles_super_zombie_game_save') console.log(state) note: old browsers need a polyfill for Object.assign, if you're transpiling you can use object spread to make this even more succinct
    The `getSavedState` function grabs a certain key from local storage, if it does not exist it'll be `null` (I'm guessing this happens in all browsers, might not though), we then use Object.assign to clone the default state and then overlay savedObject on top of it, meaning that if the savedObject contains `level: 3` then your resultant object will also contain that, check out how Object.assign works if its not clear.
    Note the initial empty object parameter to Object.assign, this is important to ensure you don't try to mutate the defaultSaveState, even though it is a `const` it isn't immutable in JS. 
    Your savedObject might be `null` but JSON.parse(null) also evaluates to `null` and Object.assign can handle assigning `null` (it becomes ignored) so you know that the object returned from `getSaveState` is going to be of the right form and populated either with defaults or with details from a previous save.
  5. Like
    RubbleGames reacted to mattstyles in Problem with local storage save   
    It's the underlying domain ( that newgrounds use, seemed to be a shared domain for all games (I fired up another couple) so yeah, you'll all be potentially sharing storage data, wow! Security anybody? Aren't non-isolated environments fun?
    In any case, not sure if I've played a game on newgrounds before (probably have) but my storage for (where your game comes from) looks like:

    I get the same hordeSpeed error as BdR so the game doesn't load so I'm guessing its not you setting those values in storage, so it has been someone else.
    The fix BdR suggests should fix your problem and you wouldn't have to change the keys you're using, unless you are worried that other games might be sharing those keys, and, yes, changing the key would be a breaking change for any existing users you have with saved stuff.
  6. Like
    RubbleGames reacted to YngNAmbitious in [WIP] Mad World, Cross-platform MMORPG   
    Hey guys,
    My name is Mike and I'm from Korea.  Me and 14 other guys are making a HTML5 MMORPG called "Mad World".  
    Here's its trailer.
    And here's rain animation
    The game has all the familiar features of MMORPGs but the combat is more face-paced.  It has hand-drawn artstyle like you see here.
    I will be posting some updates here from now on, and maybe some development tips we learn along the way.  We want to be a pioneer in the area HTML5 in Korea which is still very new in the country.
    We want to make it available worldwide by the end of 2018, so we still have a long way to go.  Any feedback is welcome by the way.
    Thanks and let me know what you think of the game!
    For more information on the game, you can visit our website:
    or follow us on
    Here's the latest update
    We are throwing an in-game Halloween event next week from October 30th to November 1st.  Anyone interested here's a link to the game.  We will open the server during the event time.  Hope we see you guys there. =)

    Here's a wip customization system,.  Oh, and we recently opened a forum.  Come by and say hello if you're interested. =)
  7. Like
    RubbleGames reacted to BdR in Problem with local storage save   
    I assume you mean this page: Zombie Cannon Attack! on Newgrounds.
    Your game on Newgrounds doesn't work either on my laptop using Chrome, it gives this error:
    I've looked at the JavaScript code and it seems to me the problem is the way you check to see if there are already any settings in the localstorage. If I understand correctly, the local storage is specific to a page (or URL) and I suspect that Newgrounds page also uses the localstorage for the menus and ads banners and such. So the localStorage.length is higher than zero, but your game's "save" key does not exist yet.
    if (localStorage.length > 0) {     var t = localStorage.getItem("save");     saveObject = JSON.parse(t);     null == saveObject.hordeSpeed||void 0 == saveObject.hordeSpeed||(power = saveObject.power;     infectSlow = saveObject.infectSlow;     bounceSlow = saveObject.bounceSlow;     //etc. I would change that to something like this:
    // use a game specific keyname var t = localStorage.getItem("zombies_save"); // error checking, localstorage might not exist yet at first time start up try { saveObject = JSON.parse(t); } catch (e) { // if an error occurs, set default values saveObject = { "hordeSpeed":10, "infectSlow":true, "bounceSlow":false, //etc. }; };  
  8. Like
    RubbleGames reacted to mkhan074 in Body Overlap Detection   
    Hi everyone, I was able to figure it out, I switched the physics to arcade physics. It has a better overlap detection overall and it's not as jittery as the p2 physics (I feel p2 physics still needs a lot of work to have it on par as the other physics systems in this engine in terms of collission, then again, I am a newb and still learning)
    This is my simple enemyAI method
    var isColliding = game.physics.arcade.collide(playerKen, enemyBison, hitEnemy, null, this); if (!(isColliding)){ bisonWalkingForward(); console.log('walking forward'); } else { bisonLightPunch(); } the collide method returns true if the size of the hitbox is collided rather than the size of the sprite, which is good. 
    Doing a punching battle with the AI

  9. Like
    RubbleGames got a reaction from samme in Unable to destroy button   
    It looks like you're adding the button more than once, in which case destroy will only destroy the last one added. Try changing your code to check if the button is already there before adding another or using a boolean to stop it being added more than once.
  10. Like
    RubbleGames reacted to GameAnalytics in From 0 to 2 million DAU: One HTML5 Game Developer's Story   
    Some of you may be interested in this interview with FRVR from GameAnalytics, where we chat with FRVR founder to find out how his approach to HTML5 game development and distribution helped him build a studio that generated $1500 per day in ad revenue, within 6 months...

    It's a great story. Check it out
  11. Like
    RubbleGames got a reaction from end3r in Flood Escape   
    It looks really nice. I'm pretty rubbish at it though so it would be nice if the power-ups were permanent so I felt like I was getting somewhere.
  12. Like
    RubbleGames reacted to Umz in Flood Escape   
    I love the sound it makes when you get it good or excellent. It's really rewarding! I want to use that sound.. It's amazing.
    Also, I love how it shaves off a little bit every time you're off, that's a great idea. Perhaps if you get (n) good/excellent in a row give a little bit back to the width, that way the player can extend the height record distance and be rewarded for being skilled. Also, if you get (n) correct in a row, do another sound or something to show.
    And the effect of the power ups should be written or shown or explained, as I can't figure out what is what from the icon, and I don't want to spend my hard earned coins on something I don't know the effect of.
    I'm hoping for a 'slow down' power up 
  13. Like
    RubbleGames got a reaction from Umz in Flood Escape   
    It looks really nice. I'm pretty rubbish at it though so it would be nice if the power-ups were permanent so I felt like I was getting somewhere.
  14. Like
    RubbleGames got a reaction from bibixx in [Phaser] Feed The Bob   
    That's an interesting game, I died from too much protein . I'd suggest trying to find a simple way to present the nutritional info somewhere ingame though if you can, I'm not sure how many of your players will want to take the time to read the wiki.
  15. Like
    RubbleGames got a reaction from Kacper Pietrzak in [Phaser] Feed The Bob   
    That's an interesting game, I died from too much protein . I'd suggest trying to find a simple way to present the nutritional info somewhere ingame though if you can, I'm not sure how many of your players will want to take the time to read the wiki.
  16. Like
    RubbleGames got a reaction from EvaFatal in Music you listen while working.   
    Music doesn't usually help me concentrate when I'm coding, but if I'm testing or doing artwork I like a bit of 90s Indie Rock  
  17. Like
    RubbleGames got a reaction from Cheslava in Heart of Galaxy - HTML5 space game   
    This is nice work. It's good to see an idle game that doesn't rely on constant resets, and it looks like there's a lot of content here.
  18. Like
    RubbleGames reacted to mattstyles in Seamless integration of a phaser game in a webpage.   
    Conceptually you just shove a canvas into the html (literally, just the canvas element and your scripts, although I dont think you even need the canvas element as Phaser will create it) and use css to size it to the screen, I think there might be some issues with css scaling (where the actual dimensions of the canvas do not match on-screen dimensions) so you might want to create it in code and grab the current screen dimensions and create the canvas element that size. You probably want to attach some resize handlers too to handle when the screen changes dimensions.
    Then you have to handle how you want to present to varying sizes of screen/canvas, which is a much harder problem.
    Do you just want to choose a reasonable fixed size and scale it? Then position it centrally as large as it will go when the w/h ratio does not match the screen, this results in some letterboxing/pillarboxing but is generally acceptable and usually easy enough to manage although you have to be careful of blurring. 
    Or, do you want your game world to resize itself based on the available space? i.e. if its a top down map affair then display more or less of that world as the screen real estate accommodates.
    The biggest issue is usually handling the difference between portrait and landscape for mobile devices as the screen wildly changes ratio when switching orientation and this is always difficult to manage (for apps, games, anything).
    Having said all this, I think Phaser has a ScaleManager which might be able to help with this sort of thing.
    You'd also want to explore the full screen options, which give you proper full screen experience, again, I think Phaser has some helpers for this too.
  19. Like
    RubbleGames reacted to Cheslava in Heart of Galaxy - HTML5 space game   
    Hi guys!
    I wanted to show you a game I made (full html5+css+javascript) that is basically a strategic incremental space game. The core mechanic of the game is to set up the production of several resources (raw and refined) that will be used to construct ships to conquer other planets to boost your production. Planets are different in bonuses they got and in buildings available, so you have to make decisions on which resource to produce locally and which to send/receive via shipments to and from a other planets in order to optimize your production and have the maximum profit possible. Another way to boost your production and thus progressing faster in the game, are Researches (upgrades) which will unlock new features and mechanics.
    The game is playable here:
    I feel like I need to implement quite something more to the game (I'm still actively developing it) like sound, story, quests and diplomacy between alien civilizations so that the world could feel more alive and less static. Also, the UI could feel messy and confusing sometimes, so I will also need to rework that. Besides these, I need feedback and suggestions about the game from another point of view, so please, feel free to suggest and critique the game! And of course if you have questions of any kind, just ask!

  20. Like
    RubbleGames got a reaction from Umz in Terrartisan (simulation/puzzle game for Ludum Dare #38   
    That's a nice little game, only a few minutes content but a good base to start from if you feel like adding more, congrats. 
  21. Like
    RubbleGames got a reaction from spinnerbox in Stuck on transition between preload to menu state   
    In index.html you refer to your preload file as load.js but in your post you've called it preload.js.
  22. Like
    RubbleGames reacted to scheffgames in Quick Tips for the Solo Game Developer   
    Also don't forget exercise and eat healthy. Keep crunch at minimum levels. Socialize. Don't abandon project mid-time just because the code it's a mess and you "can do it better if you start over". Remember to shower.
  23. Like
    RubbleGames got a reaction from samid737 in Astroe - 100 Player 2D Space Battle   
    It looks good and the controls are easy to use. However for some reason the first asteroid I killed gave me over 100,000 gold which was easily enough to fully upgrade my ship twice over so I'm assuming that's a bug. I was mostly alone which makes it difficult to test how fun multiplayer will be. Sorry to the one person on the green team who I blew away in seconds though, I was totally exploiting  
  24. Like
    RubbleGames got a reaction from MichaelD in Game list of phaser games   
    Hi, this is my first attempt at a game using Phaser (or any game at all). 
    Super Endless Kingdom is a top-down arcade shooter/rpg with resource/city management elements. It's still in beta although it is fully playable and released on Kongregate here:
    I'd really appreciate any comments, feedback or suggestions anyone has. Also if you can take the time to give the game a rating that would really help.