acosmist Posted June 11, 2013 Share Posted June 11, 2013 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 More sharing options...
acosmist Posted June 11, 2013 Author Share Posted June 11, 2013 I just corrected a small bug, but it didn't solve the problem. On lines 48 and 49 I typed "img.x" and "img.y" instead of "imgX" and "imgY". I had also defined sprites[0].img as an object. Link to comment Share on other sites More sharing options...
justsomeguy Posted June 11, 2013 Share Posted June 11, 2013 Do you have this online anywhere to look at? Have you been checking your browser's error console for messages? Link to comment Share on other sites More sharing options...
acosmist Posted June 11, 2013 Author Share Posted June 11, 2013 I will put it online sometime today for you. The reason I am assuming it is a logical error and not a syntax error is because I am not receiving any error messages at this time in firebug or the google chrome javascript console. Link to comment Share on other sites More sharing options...
acosmist Posted June 11, 2013 Author Share Posted June 11, 2013 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 More sharing options...
davej Posted June 12, 2013 Share Posted June 12, 2013 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now