I'm currently making flappy bird and I changed it from just rectangles to my own images and such. I can't seem to figure out how to do it so when the bird (irregular shape) hits the rectangle, it dies. I don't know how to code for a collision when it's a weird shape. Here's an image. I draw the bird like this.
var img = document.getElementById("bird");
brush.drawImage(img, 20, this.y);
Attached is a picture of the game, the bird, and the code.