• Content count

  • Joined

  • Last visited

  1. My object index is undefined?????

    Thanks @rich, I will try this later on today. I'm doing this to link a lever to a bridge. So, I was going to treat their group indexes as lookup lists in a sense.
  2. My object index is undefined?????

    Oh okay, thanks. How do I do it then? @rich
  3. My object index is undefined?????

    Because apparently in the documentation has 5 properties.... (x, y, key, frame, exists, index). @rich
  4. levers = this.physics.add.staticGroup(); levers.create(200, 160, 'lever', frame = 0, true, 0); console.log(lever.index) doesn't work in my overlap function. Apparently, index is undefined. I want to link a lever to a bridge so I was going to set both bridge and lever to have index 0 in their respective groups.
  5. Changing frames in Phaser

    Are you actually joking me? Thanks! xD
  6. Changing frames in Phaser

    Hi guys, I have this code in create() lootCrates = this.physics.add.staticGroup(); lootCrates.create(600, 362, 'crate', frame = 1); this.physics.add.overlap(player, lootCrates, brokenCrate, null, this); I then have this function for when the player touches the crate: function brokenCrate(player, crate) { crate.frame = 0; } I simply want to change the frame to the crate being broken.... However, I get this error: "Cannot read property 'source' of undefined" But earlier I did the exact same thing for a speedPotion where I did speedPotion.disableBody(true, true) and that worked perfectly. Why is changing frame giving me an error? Thanks!
  7. Phaser 3 modular JS

    Hi guys, I've looked at various git examples and I can't get my head around the whole thing. I don't have a very strong JS background so I'm struggling to split it up. Ideally I want my game structure to be: level1.js level2.js level3.js player.js items.js etc.... How do I do this??? Thanks!