Jump to content

drhayes

Members
  • Content Count

    1315
  • Joined

  • Last visited

  • Days Won

    2

drhayes last won the day on April 14 2016

drhayes had the most liked content!

2 Followers

About drhayes

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    drhayes.io
  • Twitter
    drhayes

Profile Information

  • Gender
    Not Telling
  • Location
    Austin, TX

Recent Profile Visitors

3589 profile views
  1. I was working on a game in Phaser and I was targeting the desktop. My plan was to wrap in Electron. Ultimately, the memory usage of Chromium before it had even loaded my game proved very restrictive (hovering between 500 and 800 megs and I hadn't even loaded music assets yet!). I made the decision to switch to love2d for my desktop game, unfortunately. The main factor in my decision was that I was using Phaser (and a browser) in a way that wasn't congruent with the browser or my goals. Phaser's a great game engine, especially for making games that feature things that the web is *real
  2. That explains problems I've had with start for forever. I never get exactly what I want the first few times and always have to dig in. Thanks for letting me know about those methods.
  3. This is cool! Thanks for open sourcing it.
  4. drhayes

    Physics glitch

    This is a common fail state in 2d physics engines. The engine usually has to have special code to overcome this. Phaser's special code is in its Tilemap implementation. I would suggest making your blocks a Tilemap (even if you have to generate it dynamically) and going from there. What's happening is that the physics engine tries to move your sprite by its velocity. Each dimension (x and y) are exactly the same mathematically: add the velocity * time delta to the position and you're done. However, there are two components to velocity, so which one do we do first? Phaser picks a really com
  5. Might be worth creating a TileSprite that's the width/height of your canvas and adding it directly to the Stage, behind the World. It should tile the same way and will obey the regular ol' canvas fullscreen.
  6. It's okay, this stuff is confusing. Phaser declares a global object named "Phaser" more or less like this: "window.Phaser = window.Phaser || {};". That means "assign to the Phaser property on window the already existing value of window.Phaser. If there's nothing there, assign an empty object to it instead." That's a good way of making it assign an empty object if there's not one already. You'll see this everywhere in JavaScript code. After that, there's code in the Phaser library that keeps adding functions and objects to this top-level thing: "window.Phaser.State = ..." and "window.
  7. You can add a custom collision method to the tiles you care about -- when something (e.g. the player) touches them it'll call your callback. The method you want is "Phaser.Tilemap.setTileIndexCallback".
  8. Here's another vote for Pyxel Edit. Runs using the Adobe AIR runtime so it's very cross-platform. I'm a little worried because I don't think it's been updated recently. Another thing to like about it is the file format is really simple. I made an exporter so I can make my sprite atlases from the command line by using the "raw" Pyxel Edit files: https://github.com/drhayes/pyxel-edit-cli
  9. Yeah, quoting from the docs for Phaser.Loader.start: So that's weird. Can you use 2.6.2 instead of 2.5? See if there was a bug there, or something?
  10. I don't know how your AI knows that it's the AI's turn, but you could put a timer on that function instead of calling it directly. Check out Phaser.Timer. There's a pretty good timer available at "game.time.events". You can do something like "game.time.events.add(5000, this.takeAITurn, this);".
  11. You shouldn't need to start the loader manually at all by calling "game.load.start()". Where did you put that that your code started working?
  12. You've got the sprite's constructor wrong. It's not "constructor({game, x, y, key, frame})" it's "constructor(game, x, y, key, frame)". Note the missing curly braces. Your call to super is fine, though.
  13. Don't modify the player's and the rock's positions directly -- change their velocities. If they don't have velocities then they won't overlap/collide correctly.
  14. You're correct -- the main use of modifying a particular function's prototype is to share the memory taken by those functions across a lot of instances of that function's prototype. Not making more than one? Not doing inheritance? Totally a style thing. ( =
×
×
  • Create New...