• Content count

  • Joined

  • Last visited

  1. Another option would be to change what hitboxes your are passing in to the 'overlap' function based on the currently displayed frame.
  2. I'm pretty sure you can rotate objects using Arcade physics, at least that's how it looks according to the documentation. 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.
  3. 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.
  4. Take a look at too. I'm using that to arrange bricks in a breakout clone and it's working very well.
  5. samme is right, that property doesn't exist. The 3 properties I see that are available are `Arcade`, `Ninja`, and `P2` -
  6. 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?
  7. 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?
  8. 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!
  9. 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.
  10. I was looking at the documentation around ArcadePhysics the other day and want to say there's a property you can set that addresses this issue. I think the problem is the Sprite is moving so quickly when it reaches the floor, that the update in its position is going to skip hitting the floor entirely, so there will be no collision. Ah found it. It's the 'tilePadding' property on the 'body' of the Sprite.
  11. I'm no type so sure they are detecting it as much as they are using the full amount of space available to them on the screen - I'm unable to scroll on that page at all on my iPhone. Maybe there'd be a way to detect if the address bar is showing by checking the useragent to find out if the user is on an iPhone, then listening for resize events on the DOM. It's possible those are being fired when the address bar appears/disappears. Im not so sure about how full screen mode works, I'm sorry. Someone else will have to answer that one for you.
  12. I haven't really done much development targeted at iOS, but I'd be very surprised if they exposed any APIs that allowed you to adjust their browser. I don't think you'll be able to find out if their browser is showing the address bar. You might be able to get around this by having your application enter full screen mode. Have you tried that?
  13. So close! when you're using the bracket syntax, you don't put a dot before it. So it should be this['wave'+i].whatever
  14. Sure is! Just use the `addChild` method for the sprite. You can add the hpbar as a child sprite to the enemy.
  15. Sure. I'm assuming your player object is a Phaser.Sprite. In this example the update method accesses the sprite's 'x' and 'y' properties, which represent the sprite's location.