druphoria

Members
  • Content Count

    73
  • Joined

  • Last visited

Everything posted by druphoria

  1. Tiled editor basically just generates a JSON file with an array like the one I described. It doesn't generate a new image file. Here's an example of a tilemap created with Tiled for my most recent game (also a real time multiplayer game, though it's not procedurally generated): https://github.com/ahung89/bomb-arena/blob/master/client/assets/levels/level_one.json Notice that each layer has a "data" array. The values in this array are just the indices of the tile. So in the example I pasted, the ground layer has tile 0 in the upper left hand corner, tile 128 next to it, etc. As for what tile 0 and tile 128 actually are, those are tiles found in the tileset image. Tile 0 would be the first tile found in the tileset, tile 128 would be the 128th, etc. Here's the tileset image that I used: https://github.com/ahung89/bomb-arena/blob/master/client/assets/tiles/tileset.png Your actual tileset is typically a single image file, so you don't have to worry about loading a ton of different image files. The JSON file contains metadata on the dimensions of each tile within the tileset so that phaser can just find the tile at the correct offset in the image, basically just like a spritesheet. If you procedurally generate the array and then put it into your own JSON object just like the ones generated by Tiled, it'll be the exact same performance-wise as if you created the tilemap in Tiled editor. If you're worried about the overall performance of tilemaps in general, then that's a different story altogether but I can tell you that there are plenty of games that use tilemaps and have no performance problems. Anyway, it seems like your game is getting along great as it is, but just wanted to elaborate on the suggestion I was making in case you decide to go down the procedural route in the future
  2. So I haven't explored this idea enough to know how well it would work, but the simplest thing that comes to mind is just generating an array of the tiles, creating a tilemap JSON object, and passing it into the Phaser.Loader.tilemap method: http://phaser.io/docs/2.4.2/Phaser.Loader.html#tilemap You've probably noticed by this point that tilemap files are basically just JSON files where the data is an array (or a 2D array, I forget) where the array is populated by numbers that represent the tile index. From the looks of the API, it seems like you could just use your procedural level generation algorithm to create this array, generate the rest of the JSON which is basically just metadata about the tileset, and then just pass it into the tilemap method (via the "data" parameter).
  3. This looks totally awesome! Are you procedurally generating the levels?
  4. Really nice work . Fun game and really polished looking. By the way, I'm curious - how did you calculate the percentages (of the sliced pieces)?
  5. I haven't worked directly with Pixi.js, so my answer is going to contain a lot of assumptions based on the fact that I know that it is a rendering engine and not a game engine. Phaser is a full-fledged game engine. As such, it handles tons of things beyond just rendering: PhysicsI/OCamera scrolling (e.g. camera following you in a sidescroller like Mario)CollisionsState managementTilemap SupportSpritesheets/Animations/TweensAudioGame Loop
  6. Brilliant write-up. I love it. Very clever solution - I had no idea that such an effect could be achieved just by having overlapping tilesprites scrolling in opposite directions. Just to clarify... the entire map is a single giant tilesprite and the ground tiles are simply covering it up?
  7. I'd love to hear more about the specifics of the performance issues you identified in ImpactJS and how you tracked them down/implemented the fixes (aside from the obvious boost from converting every single bit of canvas code to WebGL, which, by the way, sounds amazing and like a ridiculous amount of work). I think a lot of people here would be able to learn a lot from what you did .
  8. I appreciate the feedback, both of you. Thanks . So there are two reasons for that: 1) Only about 8 slots could fit onto the 600 x 600 canvas, and when I created the lobby initially my goal was just to get it to a working state and then move on and finish the rest of the game. I told myself I'd come back to it and adding either scrolling, pagination, or search but by the time I finished the game I no longer saw the necessity of it. 2) I'll need to run tests to confirm this, but I would be worried about network performance with unlimited games since the whole thing is running on a single heroku dyno (which is basically a VM on a VM). Managing lag has been a constant battle throughout this whole process, and I'm not sure if the game in its current state can handle that much concurrent traffic without a spike in packet drop/delay. The game is built with WebSockets, which uses TCP, so the game is especially sensitive to these issues. To be completely honest, it's about 90% reason number 1. Thanks for the suggestion. This is something I'm definitely considering, since I think it'd be a really fun challenge for me to implement some artificial intelligence that works well in the multiplayer environment. I haven't posted my game on any indie game portals yet, but maybe when I do, there'll be some more users. As for understanding the gameplay/testing the mechanics, I did this during development by just opening up two windows and playing against myself.
  9. Great job!! I really like this game. It's creative and the art is great. It also makes me hungry .
  10. Since I always loved playing bomberman as a kid, I decided to make an online multiplayer clone of the game using Phaser. I've called it "Bomb Boy Online" but it pretty much plays like the classic bomberman games. You walk around, place bombs, and try to blow up the other players. You can get various powerups that can increase the blast radius of your bombs, the number of bombs you can hold, and your speed. The game contains a lobby where you can host/join games. Up to 8 games can be in session at the same time. Here's a link to the game: https://limitless-brook-9339.herokuapp.com/ Source code: https://github.com/ahung89 Here are some screenshots of the game:
  11. druphoria

    HTML5 vs Unity

    Use the HTML5 game framework phaser.io. Extremely easy to use/learn and flexible enough to make basically any 2d game you can imagine. Check this link for tutorials: http://phaser.io/learn
  12. This is cool! Makes me even more pumped up for my next game, which also involves robots .
  13. Good concept, but I agree with Rich on the difficulty. It's difficult to the point where it's more frustrating than anything else. I don't think you should have to start an entire level over after making a single mistake - maybe give a few lives or something along those lines?
  14. I've been noticing that a lot of people have been implementing their own engines lately and I'm curious - how much time do you typically have to spend building up this architecture before actually diving into the implementation of your game? I've thought about building my next game from the ground up for fun (and as a learning exercise), but I've been leaning a bit towards continuing to use existing engines just because my primary goal is still to create and complete polished games in a reasonable amount of time. I'd love to hear about your experiences with rolling your own tech, and your thoughts on how this has affected your overall timeline/development experience.
  15. I've never tried it or looked into it at all. I just picked Phaser right off the bat because there is such an abundance of learning resources for it, and because the community is so helpful. I've been able to find an answer for nearly every question I've had about Phaser just by googling, looking around on the forums, or looking in the docs/source code.
  16. It really depends on what your goal is. Do you want to make 3d games? Do you want to develop skills to work for an indie company eventually (most use Unity)? Do you like working in a GUI/are you not very good at coding? Unity is better for these scenarios. However, if you're a decent coder and you prefer a more programming-centered workflow, and if you are planning to build 2D games, then use Phaser. Phaser is flexible enough to allow you to build pretty much any 2D game that you can imagine, and it's MUCH better for 2D than Unity. I've done a bit of 2D game development in Unity and I found the UI a bit cumbersome, though this may be more due to my personal preferences than anything else. The fact that Phaser is open source is also a huge plus, since you can figure out exactly how your code is working fairly easily just by looking through the javascript and you can modify/extend the framework's behavior.
  17. Pick Phaser if you want to start making games as quickly as possible. Pick one of the other two if you want to build the game engine from the ground up and spend a much longer time developing your game.
  18. Just tried again and it's working beautifully now. The bug is officially squashed!
  19. I'm on Windows 8... it happens on both Chrome and Firefox for me. I'll check later once I get to my office to see if it happens on my macbook. To reproduce the issue, just open up the game and wait for the music to start. Then switch to another tab and then switch back. If I do this three or four times then the music starts getting weird.
  20. Good work! Really fun game. Love the sounds too, and the overall aesthetic. I'm running into a bug with the music though. When I click another tab and then click back on the Tower Loot tab, it seems like it's starting the song over but still playing the song from the last time I was on the tab, resulting in two songs playing at the same time (well actually the same song, but at two different points). Not sure if this is happening for anyone else. Might be worth looking into though.
  21. Great idea for a jam! How many waves are there going to be? If there's one next month, I'll probably jump in. I love the visuals in the kitty game. Backgrounds/environments are gorgeous. I would suggest adding more things to destroy so that it feels more shmuppy.
  22. "this" is set to window because you're invoking the function directly. Here is a breakdown of how "this" works: 1. If you call a function directly, like this: fun();, then "this" is set to be window. 2. If you call a function as a method of an object, like this: var obj = { fun: function() {// do stuff}};obj.fun();, then "this" will be obj. 3. You can also use Function.prototype.apply, Function.prototype.call, or Function.prototype.bind to force the value of "this". In your case, you're doing number 1 because you're calling success directly. That's why "this" is the window object. And yeah, actually the way I outlined it earlier won't work (I missed the fact that you were invoking the function from the callback for onreadystatechange). Try doing this: loadJSON: function(path) { var xhrCallback = function() { if (xhr.readyState === XMLHttpRequest.DONE) { if ((xhr.status === 200) || (xhr.status === 0)) { // status 0 = local file testing this.onJSONsuccess(JSON.parse(xhr.responseText)); } else { this.onJSONerror(xhr); } } }; var xhr = new XMLHttpRequest(); xhr.onreadystatechange = xhrCallback.bind(this); xhr.open("GET", path, true); xhr.send(); } Then in onJSONSuccess, get imageShapes from "this" instead of from MyGame: onJSONsuccess: function(data) { // load data from JSON this.gamedata = data; console.log('TESTING -- data.imgshapes='+data.imgshapes+' test123='+MyGame.test123+' imageShapes='+MyGame.imageShapes); this.imageShapes.src = 'img/mybackground.png'; }I made a little JSFiddle just to make sure that the context would get set correctly using this method. Open up your console and click "Run" in the JSfiddle and you'll see that "this" on onJSONsuccess is being set properly to your "MyGame.start" object. This is happening because I'm using Function.prototype.bind to force "this" to be the MyGame.function object.
  23. I'm a full time software engineer but I've been doing HTML5 game development in my spare time for the past half year or so. Both of my projects, a realtime multiplayer bomberman clone (still under active development but almost completed) and an incredibly challenging platformer, can be seen on my github: https://github.com/ahung89. I'm wondering if there are any other HTML5 game devs in the Seattle area who would be interesting in meeting up and collaborating on something. I think it'd be fun to work with another person for whatever my next project ends up being, and it'd be cool to make friends with other indie devs in the area. If you're based in Seattle and are interested in the idea of building games and learning together with another motivated developer, PM me or leave a reply on this thread.
  24. By far the best resource for progressing beyond a beginner stage in javascript: https://github.com/getify/You-Dont-Know-JS Required reading for all HTML5 game developers. This will turn you from someone who hacks away blindly without understanding the language into a true javascript ninja who understands how the language works and how to make it do what you want it to do.