I need to write an if statement that checks the position of an element once it reaches the center of the canvas, I will add physics to that element. I have:
if red.position == 250 {console.log("this is it")}
but I get an error saying:
unexpected identifier (it doesnt like the red.position I think)
Thanks in advance!
First - learn javascript. Read Flanagan book
if (red.position.x == 250) {console.log("this is it")}
Ha! That easy
UPD.
http://shop.oreilly.com/product/9780596805531.do 6th or 7th edition. Don't read all that "learn in 7 days" stuff, only hardcore!
Thanks. Just a little rusty and not used to pixi. :p
It's worth bookmarking http://pixijs.download/v4.2.3/docs/index.html for pixi docs
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.