tobymcfly

Members
  • Content Count

    9
  • Joined

  • Last visited

About tobymcfly

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi. I switched out "This.game.add" with "SpaceChicken.game.add" and now it works. My assets and animations are really bugged tho Don't really know why it worked though?
  2. Hey, i'm making a game where you can pick up a box and free a chicken if u got the right key. The problem is, that my game crashes everytime i try to free any chickens from the boxes: I'm using prototype states. Here is my code:
  3. Im a little confused now. Where do i put the phrase: console.log(window.SpaceChicken === SpaceChicken); ?
  4. Sorry im really, really noob at phaser. Only been working with it for 1 week. How exactly do I know if a variable is global? And if I do add the window.spacechicken, what changes do i have to do in the code, cause it says spacechiken.game undefined.
  5. Well, this it what i would have to replace it with? And then it obviously won't work. It's weird that it says it isnt defined, when i alreadt defined it? But when i take my gaming code out of the state anatomy, it works fine
  6. it seems like the problem is "Game.add.sprite(...) somehow?
  7. oh wow thanks! It worked My other function that doesnt work is this. I cannot do this action where i free a chicken from the cage. it says game is not defined? here is the code!
  8. Hey guys! I'm making a game based on states. This is my Game.js (1st stage) fil starts with this. var SpaceChicken = SpaceChicken || {}; The problem is, everything is working except 2 functions. I have a function where you can pickUp boxes but the game crashes whenever i pick it up telling me this error: "" The code i've used looks like this: i have tried putting player.addChild(this.game.make.sprite(25, -150, 'box')); but then it says same error, just with this.make is not defined Any solutions or ideas to prevent this? Thanks:)
  9. Hey. So im trying to make a game where you can pickup this box with a chicken. This is the code i use to create the box, but it says error: "" What's going on? I've a version where i dont have any states for the game, and it's working fine. But when i try to implement my code inside the game with states code, it comes up with this error. The rest of the code is working fine for (var i = 0; i < 1; i++) { //box var b = boxGroup.create(0, 0, 'box'); b.name = 'box' + i; b.exists = false; b.visible = false; b.checkWorldBounds = true; b.events.onOutOfBounds.add(function(){resetBox, this}; var idle = b.animations.add('idle'); b.animations.play('idle', 10, true); b.body.drag = new Phaser.Point(100, 100); b.body.drag.y = -400; b.anchor.setTo(0.5, 0.5); b.scale.setTo(0.6, 0.6); b.body.setSize(231.6, 226.8, 50); b.body.collideWorldBounds = true; }