Madigan

Members
  • Content Count

    6
  • Joined

  • Last visited

About Madigan

  • Rank
    Newbie

Contact Methods

  • Twitter
    ItalicText
  1. I haven't gotten to menus and such in my game yet, but I noticed that the game state has a "pause" function that you can override (like you do with preload, create, and update). Maybe that's what you're looking for?
  2. Hey guys, I feel kind of dumb for this, but I'm having trouble setting my sprite's position. I'm trying to make the game world "loop" over the screen edges (i.e. things that go off the left side of the screen appear on the right). However, Phaser won't let me set the position. Any idea why? When I run this code, I get the sprite's position, and then the new position (so I know the variable is changing). Then, the second time it runs, its like the position hasn't changed: console.log(player.position.y);player.position.y = game.height;console.log(player.position.y); Outputs something like: -316320-317320-318320I'm using 1.0.7, and I have reproduced the problem on both Chrome and FireFox.
  3. It looks like I spoke too soon... I'm still getting the same problem. I grabbed 1.0.7, and I looked at the changes, but I'm having the same problem. I'll hold down the "D" key, and it'll get stuck at some random angle. I was wondering if my input code was causing any problems, so I simplified it to: function update() { player.angle++;}It gets up to 2.3038346126325204 rads or 132.0000000000003 degrees, then freezes. For the life of me I can't figure out why. Could there be some floating-point magick going on?
  4. Awesome! Will do. Thanks.
  5. Hey folks! I'm trying to make a game of Asteroids, and I want to steer my ship! So I added the following code to change the angle: if(game.input.keyboard.isDown(Phaser.Keyboard.D)) player.angle++;It works at first, but then it gets stuck and the angle won't change. Generally this happens after 360* or so. I'm guessing that this has something to do with the number getting too large (which mathematically shouldn't make a difference, right?). I created a workaround: var rotation = 0;function update() { if(game.input.keyboard.isDown(Phaser.Keyboard.D)) player.angle = rotation++ % 360;}But creating my own rotation variable seems to defeat the purpose of having an angle variable in the first place. Am I doing something wrong? Is there a better way to make use of angle? I've been looking through the source, but I haven't had much luck yet (JavaScript is not my first language). Thanks & Regards.
  6. I've used Netbeans and Komodo Edit in the past, but right now I'm looking at this online IDE called Cloud9. I'm still learning the ins and outs of the interface, but it's kind of a cool concept.