Jump to content

Angular Velocity in Phaser 2.3


mrBobDobalina
 Share

Recommended Posts

Running the new Phaser 2.3 and I've been trying all day to make a simple asteroids-type game going off the examples and the problem I'm having is--
 
game.physics.Arcade.velocityFromAngle(sprite.angle, 300, sprite.body.velocity);
 
this line of code seems to be crashing my program.

I copied it directly from phasers examples   http://phaser.io/examples/v2/arcade-physics/angular-velocity

 

Heres a copy of my code as proof I'm not just making mistakes elsewhere

play.html

 

There doesn't seem (to me) to be another way to get the ship accelerating forward based on its current direction

 

I'm running Linux (mint) if that matters at all

 

 

for example:

 

//this code works with something simple like  sprite.body.velocity.y = 200;  but when i enter the above line it freezes the game as soon as I press the up //key is pressed.

//using the other ways to say button isdown returned a black screen

 

 if (game.input.keyboard.isDown(Phaser.Keyboard.UP))
    {
            
    }

Link to comment
Share on other sites

Thanks for saying that! I didn't think about that, suppose I gave up too quickly

 

Yeah I'm getting this error:

 

TypeError: game.physics.startSystem is not a function
 
and when i press the UP button this error pops up
 

Strange, I'll try re-installing phaser to see if my download was messed up or something

Link to comment
Share on other sites

Alright so I got frusterated and deleted everything that has anything to do with phaser off my computer and did everything new and now it works.

Did everything the same way, even copy pasting my previous code from above and now it wants to work. I don't understand why but I'll keep going with it...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...