title: Object collisions HTML5 Canvas
body: <p>I'm making a platformer game with HTML5 Canvas. I don't have a main character yet so i'm using a ball for now. I'm trying to make it so the ball can't go through the grass block. I'm using an list to hold the values of my map, then 2 if statements to turn the list's values into a map, so I don't know how to detect a collision between the ball and the grass ball, considering the grass blocks could be anywhere on the map.</p>
  
  <p>My question is: How can I make a collision between the ball and the grass block without hard coding it, it needs to be fast, and if I need a library, please show an example of how to use it in my situation.</p>
  
  <p>My code is here: <a href="https://drive.google.com/open?id=0B7OJnVpBNrkDTlA0amdzMkdrRnM" rel="nofollow">https://drive.google.com/open?id=0B7OJnVpBNrkDTlA0amdzMkdrRnM</a></p>