Choeeey

Members
  • Content count

    44
  • Joined

  • Last visited

  1. It actually randomly started working again the next day after I posted this, thank you anyway
  2. So normally I have no problems with adding a sprite, and then killing it a later time. I manage to kill the sprite named goalSprite later on with no problems. I use the exact same code to kill the addWaitSprite and it just won't kill for some reason. The only difference I see is how the name of the addwaitSprite is in green? I can't get it to not be green :S Any ideas? The above screen shot is just to show the difference in variable colors (I know some of the code is cut off on the top line)
  3. I just solved this problem by killing the sprite and re-adding it.
  4. Hi everyone, having a slight problem. Basically I have a sprite with drag enabled. If the sprite hits a wall then the sprite will be put back to its original position. What is happening though is, as long as you let go of the sprite (by unclicking the mouse or releasing your finger from the touch screen) it works. However if the mouse remains clicked/ finger remains on the sprite while dragging the sprite it will not collide. You can just drag it over all the walls no problem. So if I have a space, then a wall and a space - You can just drag the sprite through the wall to the next space. But if you let go of the mouse when you are on the wall it will be handled/ Any ideas? EDIT: SOLVED MYSELF
  5. Whoops! Thank you
  6. this.score=this.game.time.totalElapsedSeconds().toFixed(0); this.score = this.score+5; say the first this.score = 5. I want the next this.score to equal 10. But instead, I get 55. I looked up the API, and it says this.score should be a number so I cannot understand why this is happening?
  7. I have never actually created or used a phaser button before. I want to to add in a button to my game, and when the user clicks on the button a function will be called. I have been going through for the forums and cant find an answer. Could someone explain to me how phaser buttons work, and how do you make them? Thanks!
  8. Doesn't phaser have inbuilt functions to deal with scaling, rather than using CSS? I am using an iphone for testing.
  9. Hi everyone, I was playing about with scaling my game yesterdaye. I managed to get it to scale when the phone is portrait. However, when the device is tilted so that it is landscape the game should stretch a bit bigger in width but does not do so. Does anyone have any scaling tips to help me to achieve this?
  10. It is the width and height I want to scale though? not the x and y axis
  11. Hi there, Basically I have a group: this.walls = game.add.group(); And I add a LOT of walls, but each time I do I need to scale them like so: this.wall1 = this.add.sprite(positionx,positiony, 'wall', 0, this.walls); this.wall2 = this.add.sprite(x,y, 'wall', 0, this.walls); this.wall3 = this.add.sprite(x,y, 'wall', 0, this.walls); this.wall4 = this.add.sprite(x,y, 'wall', 0, this.walls); this.wall1.width = this.wall1.width*scale; this.wall1.height = this.wall1.height*scale; this.wall2.width = this.wall2.width*scale; this.wall2.height = this.wall2.height*scale; this.wall3.width = this.wall3.width*scale; this.wall3.height = this.wall3.height*scale; this.wall4.width = this.wall4.width*scale; this.wall4.height = this.wall4.height*scale; Is there a way I can scale the whole group in one?
  12. My apologies for the misplaced forum post. I didn't mean to put it under the wrong section. Please also do not think that I done no research of my own before posting. I appreciate it everyone's help, however found an alternative way without having to use ajax.
  13. could you tell me how to access this is php please?
  14. Thanks that solved that issue, however in the php file it says the json is empty when I echo: echo $jsonReceiveData; I get '[]'
  15. Okay so I put the code in a function and it doesnt like it ' Uncaught ReferenceError: $ is not defined'