3
Next: http://youtu.be/8QKaxOMGxAM
Source Version: http://lifeofadreamer.com/html5-game-framework-part-2-rectangles-and-collision/
Showing collision and contains and drawing the rectangle to the canvas.
Twitter ► http://brentfarris.com/twitter
Website ► http://brentfarris.com
GitHub ► http://brentfarris.com/github
source
15 comments
Thank you for the tutorial. The problem is there is although i get no error, and I don't see the rectangle. Also, how come the rectangle is black if you didn't add any color in the rect.Draw function?
how do I make my character move I did ctx.drawimage(guy,10,10); what do I do to get the x and y of it
Why on earth would you put a DRAW method inside the rectangle? Create another class that will do the drawing for all figures. Make your game a little bit more OOP 😉
nice tutorials, but would you mind getting your mic out of your mouth?
Very nice tutorial! This intersects function is really important! It made effects like gravity, bounce-effects and much more possible for me. Thanks!
Hi im having the same problem as arjun malhotra and ph33lz had, can I get the code for this somewhere? I could not find it on your website, I couldn't get this to work and i can't understand why, it seem to make logical sense……please help !
could it be the Rectangle function should be (x, y, width, height) and not
(x, y, w, h)
I see that the other comment was witheld by author, did you solve it?
🙂 if you don't mind dropping the framework code that you have onto the pastebin website and sending the url over to me I could check it out there and see what the issue might be.
hey….ty soo much for ur tutrials……. but i have been stuck at the same thing as ph33lz since past week it is getting very frustrating….. i have seen the video 3 and 4 numeric times now but just cant find the error . The console shows no error but the chrome just doesnt show any rectangle(s)……
😀 woot! It's always great when bugs are smaller things haha. Yeah working in a language without auto-complete like JavaScript sometimes presents the same problems for me too 😛
🙂 Thanks for the support! I do have a new series to expand on this one planned out and have almost finished the prototype. Hopefully I can start tutorializing it this weekend.
I'm not sure how I missed it but that was it. Thanks for the feedback and for posting these great lessons.
Did you finish video #4 in the playlist named "HTML5 Game 2 – Part 2: Rectangles Intersection (REDO)"
This is the video that goes over how to setup the intersects function… on that note you said I just noticed that you said "Intersect". The function we setup should have been "Intersects". 🙂 Hopefully its as easy as fixing that, if not let me know and I'd be happy to help out!
I'm getting an Uncaught TypeError: Object [object Object] has no method 'Intersect' did I miss something from earlier?
It still works for me because I misspelled it in the declaration as well. I will send you a link to the finished code in a message. Look at the rectangle section to compare your code.
Comments are closed.