Jump to content

TypeError


SirTuffy
 Share

Recommended Posts

Hello,

I am pretty new to Phaser and also to JavaScript and while coding a game I keep on getting this error "

TypeError: Argument 1 of CanvasRenderingContext2D.drawImage could not be converted to any of: HTMLImageElement, HTMLCanvasElement, HTMLVideoElement, ImageBitmap."

I have been stuck on it for a day or so and I would like to see if someone could help me find where the problem is. I have been following a few tutorials i find on the web on how to work with Phaser and js

 

here is a pastebin of the code.

http://pastebin.com/2CScJnH6

 

Link to comment
Share on other sites

Just noticed that the player variable is commented , any reason for that? You're then trying to apply physics to it and stuff..so maybe that's causing the errors 

/// player = game.add.sprite(7 * 63, 13 * 64, 'character'); 

If that's not the issue, can you upload your assets somewhere so I can test it properly? 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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