Jump to content

A small issue with Phaser - following 'Let's Learn' on Youtube.


tgrvl
 Share

Recommended Posts

Hi all, I'm brand new to Phaser (and game dev in general), I've been trying to get in to it over the last ~10 years, but have always been too busy with school and now working. I finally said to myself I'm going to learn, no matter how little the progress comes and how long it takes.

 

So I looked in to things and found Phaser, which looks great, just what I wanted! I'm following this: http://www.youtube.com/watch?v=0Mu1yAkkEi8

 

I've got to the 12 minute mark where acceleration/velocity are mentioned, it seems that something has changed since this video was made, now the 'fishSprite.velocity.y = 100;' doesn't seem to work. I've gone through the code a few times and double checked/ rewritten my code but my browser throws up the error 'Uncaught TypeError: Cannot set property 'y' of undefined'

 

Now I don't know where to go from here as I don't know enough about the system to make it work on my own right now, just looking for some pointers or advice.

 

 

Thanks :)

Link to comment
Share on other sites

try 'fishSprite.body.velocity.y'. the "physics characteristics" of sprites/objects are (now) contained on the 'body' property. I imagine this changed around v1.0 (?) - Rich or a longer-term Phaser veteran could say for sure.

 

I recommend cloning the git repository and loading index.html from the 'docs' directory in a web browser. the docs there aren't complete, but are still quite helpful.

 

even better, load the phaser source code up in a file browser/text editor. the docs come from comments in the code, so you have both the docs and the actual source at hand to answer any questions you might have.

 

good luck and have fun!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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