I am make a jquery game and I have a level as a background and instead of just having for each level lots of lines of code checking where it is, is there a way to check if two colors are touching. So the background and the character.
I would prefer to not use a plugin.
jquery for checking if it is touching one line:
if(level === 1) {
if(c.css('left') === '90px') {
c.css({'left': '115px', 'bottom': '94px'});
}
}