Jump to content

sleekdigital

Members
  • Content Count

    26
  • Joined

  • Last visited

Everything posted by sleekdigital

  1. Texturepacker... https://www.codeandweb.com/texturepacker Just set trim mode to none and maybe some of the other options would work as well. Not sure if this feature is included in the free version or not.
  2. I would guess you have to either tell your texture packer to conserve the space (if it has that option), or you have to re-position the sprite. But it isn't 100% clear what you are doing... I can only guess from your description. As far as the "type". It seems that Phaser supports any one of those... http://docs.phaser.io/Phaser.Loader.html atlas(key, textureURL, atlasURL, atlasData, format) → {Phaser.Loader}atlasJSONArray(key, textureURL, atlasURL, atlasData) → {Phaser.Loader}atlasJSONHash(key, textureURL, atlasURL, atlasData) → {Phaser.Loader}
  3. It's still pretty unclear what you're trying to do. You say you are using... "game.load.atlasJSONArray(name, 'image.png', this.path + 'image.json');" which is Phaser code, then later you say "I am writing my own game engine". If you are using Phaser, try your JSON and see if it works. You can also compare your JSON to the output from texturepacker. I think this is a valid example of what you are looking for... https://github.com/photonstorm/phaser-examples/blob/master/examples/assets/sprites/atlas_json_array_trim.json
  4. I'm not sure Tiled is the tool your looking for in this case. You want texturepacker... http://www.codeandweb.com/texturepacker
  5. I would suggest adding an issue on github... https://github.com/photonstorm/phaser/issues
  6. https://github.com/photonstorm/phaser-examples Under "projects" you will see some examples that might help you there. They have states such as boot, preloader, menu, game... Also, I like this yoeman scaffold generator for a nice starting point... https://github.com/julien/generator-phaser
  7. Option A = inheritance, Option B = composition. This topic has been discussed to death since the birth of OOP, so you will find plenty of resources out there. Most of the general OOP concepts related to this topic can be applied to game programming and Phaser. https://www.google.com/#q=favor+composition+over+inheritance In this specific case, it probably won't make much difference. When you start getting into more complex structures, then it can make a world of difference.
  8. Are you sure it isn't something more specific about the content of your layers or your scrolling code? I just did a quick test. My test map is 80x60 tiles with tiles that are 64x64 pixels. I created 6 layers. The layers have very few tiles filled in except for one of them. I did not notice any change in performance with the extra layers. I'm using chrome with the game configured to use canvas. Do you have debug turned on?
  9. Perhaps not, but it is the fundamental difference between the two approaches, and it can be an advantage in some cases.
  10. The prototype approach gives you the option of easily creating a new instance of the state if you wanted to. In other words you can reuse the state over and over without having to duplicate code. One use case for this might be procedural or random level generation. Hopefully my meaning is clear here, but if not let me know and I can explain further.
  11. It may be a little inconvenient, but I think that is exactly what you need to do. I don't think it defeats the concept of phaser's states at all, It just means you need multiple preload states.
  12. Do other games run smooth? What GPU does your machine have?
  13. I don't know too much about blend, but I guess you could write some code to parse the XAML that blend generates and load your assets and position game objects based on that data. Or maybe write something to convert your XAML to JSON so that it will be easier to work with.
  14. Here is my rough start project on github... https://github.com/skrichten/Phaser-Level-Editor
  15. Cool, I'm using Angular too! I'll check out what you have. Maybe we can combine our efforts.
  16. Not yet, but I will try to have it up on github later this week and I will post back here.
  17. I haven't been able to find any good options either. As a result, I have started to build my own level editor with Node-webkit, using Fabric.js for easy entity manipulation. I've made pretty good progress, but I haven't had much time to work on it lately. I also have a Phaser plugin for loading the assets and rendering the level. If anyone is interested in helping me on this project, let me know.
  18. One way is to use multiple states for your preloading. In your first state's preload function, load the JSON and any other assets you already know you need. Then in the next state's preload function, read the json and load the textures. Then in create function of that state you are all set to render. http://docs.phaser.io/Phaser.StateManager.html
  19. http://www.html5gamedevs.com/topic/2312-ludei-cocoonjs-xml-bitmap-font-workaround/
  20. Your js file is busted... Uncaught SyntaxError: Unexpected end of input koanoftheday.com/wp-content/themes/toolbox/js/main.js:1114
  21. That tells Webstorm about the js file, but you still need to tell the browser... you need to keep the script tag in the html. AFAIK, when you do this in Webstorm, it aids in things like code completion and highlighting in the IDE, it doesn't automatically make it load in your browser.
  22. Somewhat related to this topic... http://www.html5gamedevs.com/topic/4277-group-anchorpivot/ What if I want to position a sprite based on the usual top left anchor, but I want it to rotate around the center? Would I have to wrap it in a group or is there another way? I've been playing with pivot and anchor directly on the sprite, but haven't had any luck.
  23. I have a different point of view on this... While ECS can be and has been implemented without OOP, it can also be implemented WITH OOP. It just means you use composition instead of inheritance. Composition is just as important in OOP as inheritance. I think ECS could work just fine with Phaser. Although your Entities will already have many systems baked in by Phaser, any new ones that you code yourself could be implemented as components.
×
×
  • Create New...