brooke_theperson Posted April 26, 2015 Share Posted April 26, 2015 I was just wondering, how do you make a div, or a character run and when it comes in contact with a coin, it collects the coin? Like if mario were running and he collects a coin. Link to comment Share on other sites More sharing options...
Ingolme Posted April 26, 2015 Share Posted April 26, 2015 You can't do that with jQuery. You need to program that in Javascript. It's called a collision detection algorithm. The simplest ones are either rectangular collision testing or circular collision testing. Looks like MDN even has an article about it: https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection You're entering the realm of game development, I warn you that nothing is easy in game development. 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