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

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...