Jump to content

UgnisKarolis

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by UgnisKarolis

  1. I think this is the answer https://github.com/photonstorm/phaser/commit/d15037e283eee433f3128e716a1468f83e2bbd44. You can always look through githubs history, it usually explains the intent of the code.
  2. For this Ludum Dare I have created Phaser-TypeScript-Kit and updated Phaser-Starter-Kit. Just a faster way to start creating games with example states and sprites. Can't wait to start creating a new game for LD, had a blast last time. Good luck and have fun everyone.
  3. Try using a dev branch of phaser and if that does not help, make an isolated test case and submit it to github issues. For sidescrollers in new versions of phaser you can set: game.camera.roundPx = false;This will remove the jaggedness but will not fix the slowdowns on camera.follow.
  4. OOP is probably the only way to create something bigger than a simple demo scene. Example of a Sprite object in Javascript https://github.com/UgnisSoftware/Phaser-Starter-Kit/blob/master/public/javascripts/states/example/views/SpriteAnimated.js and example controller https://github.com/UgnisSoftware/Phaser-Starter-Kit/blob/master/public/javascripts/states/example/exampleController.js. In reallity, code usually doesn't look that clean, this is how controller usually looks in reallity: https://github.com/UgnisSoftware/The-Lone-Wolf-Corp./blob/master/public/javascripts/states/space/SpaceController.js but the same OOP principles apply. Also, you should probably give TypeScript a try, it makes OOP much cleaner and Phaser fully supports it.
  5. This is a known bug in Phaser 2.1.3. There is a fix in the dev branch of Phaser. https://github.com/photonstorm/phaser/tree/dev#bug-fixes
  6. I created a similar game for the last Ludum Dare. And I had no problem running +200 asteroids with arcade physics. Phaser has an annoying feature for scrolling games https://github.com/photonstorm/phaser/issues/1175 To turn it off: game.camera.roundPx = false;Also, you should not use textures that are bigger than 2046, LG G2 did not load 1024x4608 in a default browser. After texture and camera rounding fix, your game maintains a stable 60 fps. I guess I am missing the part that I should test. Should I include more enemies or add a tilemap collisions? I would probably listen to valueerror and take the flappy birds approach to building levels. Just to be really annoying and nitpicky: Use player.update, instead of the state.update for player movement changes. "return this;" does nothing in Constructors called with new;
  7. Maybe you could provide a source code of your example? It's hard to debug just by watching at snipets. In theory, if your tilemap has many tiles (bodyObjects.length) then adding a new enemy with many polygons would increase the number of calculations significantly. Another problem might be that canvas mode has a hard time dealing with many polygons, have you tested it with iOS8 webgl?
  8. https://github.com/UgnisSoftware/Phaser-Sample-Pathfinding I have included both pathfinders (PathFinding and EasyStar). The example sprite is located at https://github.com/UgnisSoftware/Phaser-Sample-Pathfinding/blob/master/public/javascripts/states/map/views/Hero.js. Feel free to ask if you have any more questions.
  9. I have not used this boilerplate as I am using our internal boilerplate https://github.com/UgnisSoftware/Phaser-Starter-Kit. But generally you should add phaser_pathfinding-0.2.0.min.js to your index.html. This plugin then exposes a global Phaser.Plugin.PathFinderPlugin, so you can reach pathfinder with: pathfinder = game.plugins.add(Phaser.Plugin.PathFinderPlugin);and then use easystar.js as usual: pathfinder.setGrid(twoDimensionalArray);pathfinder.setAcceptableTiles(arrayOfAcceptableTiles);pathfinder.findPath(startX, startY, endX, endY, callback);pathfinder.calculate();However I would not use this plugin or easystar.js at all . A better way would be to download https://github.com/qiao/PathFinding.js and add it to your index.html, it would expose PF so you could: var finder = new PF.AStarFinder();To return an array with path: var path = finder.findPath(start.x, start.y, end.x, end.y, grid);I have used them both in my Turn base strategy game and easystar.js was buggy and slow. But maybe they fixed it, I can't be sure. Drop me a line if you need more help with pathfinding, I might be able to dig some examples with phaser.
×
×
  • Create New...