breed

Members
  • Content count

    43
  • Joined

  • Last visited

  1. Define Game Scaling at Boot

    I'm in the same boat. I was going to make a `MobileState` that implements this functionality and extend all my other states from there, but would love to know if there is a singular place in that I can define it. I guess it makes sense that it needs to happen in individual states since any resizing logic would be specific to each state, but for the more generic parts of setting up scale modes, I'd like to put it somewhere a little more singular.
  2. Question about phaser

    No worries! I totally understand getting excited about a project to learn a new library/framework/language/concept/whatever.
  3. Question about phaser

    You're describing exactly the use case of CSS. No need to involve any scripting to accomplish what you want. The CSS hover (https://developer.mozilla.org/en-US/docs/Web/CSS/:hover) pseudo-class is all you need. Pulling in JavaScript to do something that CSS can do is only going to slow down your page's load time, especially when you want to pull in Phaser which is a large library. Plus, if a browser doesn't support canvas or webgl, your page won't work. Literally EVERY browser supports the hover pseudo-class.
  4. world bounds problem on moveToXY method

    What problem are you trying to solve? There isn't really a question in your post.
  5. looped rotation tween or updating the angle?

    If you're using Arcade physics or P2 physics you can use the `angularVelocity` property and not have to worry about it: http://devdocs.io/phaser/phaser.physics.arcade.body#angularVelocity
  6. Enable/disable hitboxes on frame change

    Another option would be to change what hitboxes your are passing in to the 'overlap' function based on the currently displayed frame.
  7. How to rotate arcade object

    I'm pretty sure you can rotate objects using Arcade physics, at least that's how it looks according to the documentation. http://devdocs.io/phaser/phaser.physics.arcade.body There are allowRotation, a bunch of angular* properties, and a rotation property. So things can be rotated, BUT the documentation for the rotation property says that the collision box never rotates. So you'll see the picture of the Sprite rotate, but the collision hit box will not. At least, that's what it seems like.
  8. Random characters

    Okay, so you need a name. First name and last name? One word? Two? Special characters? What kind of stats? What does your game need? Health? Number of fingers? Are the values strings? Arrays? Whole numbers? Fractions? All the properties you're looking for are unique to your game, and the only API for that is one that you build. Define the list of all the properties that you need for each NPC, then start looking for ways to come up with those values.
  9. Object next to each other

    Take a look at http://devdocs.io/phaser/phaser.group#align too. I'm using that to arrange bricks in a breakout clone and it's working very well.
  10. Cannot read property 'collide' of undefined

    samme is right, that property doesn't exist. The 3 properties I see that are available are `Arcade`, `Ninja`, and `P2` - http://devdocs.io/phaser/phaser.physics
  11. Random characters

    dthrasher90, what are you looking for in your random npc? Do you want a random name? Do you want a random sprite? Do you want an npc that will walk around randomly? There are a lot of different factors that define what an "npc" is. What are you trying to do here?
  12. Sorry, I'm not really sure what you're asking. You mention an 'iframe tag in js code', but I don't see any references to iframes in what you posted. Can you add some more detail to your question and include the relevant javascript and html code snippets?
  13. How do world bounds get calculated?

    Ah, I see! So if I call 'getBounds()' on World it will give me back a rectangle covering all its children. But accessing the 'bounds' property of World gives me its "fence" as you called it. Good explanation, thank you! And A+ codepen example!
  14. Hi everyone! I'm playing around with positioning objects using the alignIn method, and am getting confused about how the bounds of the `world` object are being calculated. Take a look at the codepen here: Aligning the text according to `world.bounds`, `world.getBounds()`, and `world.getLocalBounds()` all ends up with different results. Could somebody help me understand why these calls all return different bounds? (Interesting to note that you can see this happening with the `stage` object too between its `getBounds()` and `getLocalBounds()` methods) EDIT: This is all happening in the `create` method of the State. Not sure if that has anything to do with it either.