Jump to content

logic error preventing sprites from appearing in canvas game I am creating


acosmist
 Share

Recommended Posts

I seem to have gotten in over my head with this project. I spent most of the day just typing out code, without the ability to debug it due to slow browser speed. When I got off work I started correcting my syntax errors, which didn't take very long. Unfortunately, I have spent many hours trying to resolve some sort of logic error in the game which is apparently a very serious one, as it prevents any of my sprites from appearing. The fillRect() function is showing up perfectly, but the drawImage() function is not. I will go ahead and post the whole game code, as it is pretty concise by my own meager standards. I am a noob to javascript and coding in general, and this will probably show. That being said, I really expected this to work, and would certainly appreciate any help which is on offer. Upon previewing my post I noticed that spacing differences rendered my map array unreadable. I have decided to attach a text file (as I am not permitted to upload .js files) instead of pasting. I hope this is acceptable. script.txt

Link to comment
Share on other sites

Well, I put it online, but after reading through the forum rules I am not so sure I should post the address. It is one of those "free domain names". Also, I have resolved the bug in question, having gotten the sprites to display. Remember kids, when making multiple canvas elements for a video game, set your inline style position to 'absolute;left:0;top:0;'

Link to comment
Share on other sites

I seem to have gotten in over my head with this project. I spent most of the day just typing out code, without the ability to debug it due to slow browser speed. When I got off work I started correcting my syntax errors...
This looks pretty complicated. Are you basing this code on some other example?
Link to comment
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
 Share

×
×
  • Create New...