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

 

Share this post


Link to post
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? 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.