Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs

New function for ct.mouse: ct.mouse.insideType
to verify that the mouse is within some type, this can be useful for interface elements.

You're probably talking about something like ct.mouse.insideCopy, as type-wide checks would better serve for gameplay elements and not UI :) I'll add them in a future release.

For the current and upcoming versions, there are methods ct.u.prect and ct.u.pcircle. You can pass mouse coordinates and a copy to them, like this:

if (ct.u.prect(ct.mouse.x, ct.mouse.y, this)) {
    if (ct.mouse.pressed) {
        alert('Pressed!');
    }
}

When I need to check against all the copies, I make a fake object for ct.place and check for collisions. This is quite a hacky way to do this, though:

var hit = ct.place.occupied({shape: {
    type: 'point'
}}, ct.mouse.x, ct.mouse.y, 'Enemy');
if (hit) {
   // Do something with an enemy under the cursor…
}