+ 2

Phaser not loading sprite

How can I load a sprite in Phaser? I've been told to use Dropbox, I did but it won't work. https://code.sololearn.com/WE8r8OpW40oq/?ref=app

9th Jul 2020, 6:23 PM
Clueless Coder
Clueless Coder - avatar
4 Respostas
+ 1
Line 12 in JS tab parameter are out of place should be (x, y, sprite) https://phaser.io/tutorials/making-your-first-phaser-3-game/part1
9th Jul 2020, 8:52 PM
ODLNT
ODLNT - avatar
+ 3
When you use dropbox, you have to change www to dl for it to actually work. Now once you're done with it, you need some more changes in your code. You should you function keyword to create function if you want to access 'this' because arrow function does not bind to the object it is defined in but normal functions do. check this https://code.sololearn.com/Wh5q9133y11g/?ref=app fixed code https://code.sololearn.com/Wq5HdyktEec7/?ref=app
9th Jul 2020, 6:56 PM
Raj Chhatrala
Raj Chhatrala - avatar
+ 3
Clueless Coder Well about that I am completely clueless why it doesn't load on canvas since I never worked with phaser
9th Jul 2020, 7:03 PM
Raj Chhatrala
Raj Chhatrala - avatar
+ 1
🔫 Rick Grimes Thanks for the help. It's still not loading on the canvas though :/
9th Jul 2020, 7:01 PM
Clueless Coder
Clueless Coder - avatar