Trying to make a smaller hitbox

Trying to make a smaller hitbox

Postby Hissing Cockroach » Thu Nov 21, 2013 3:06 pm

I have made a game(viewtopic.php?f=11&t=8651), except
you never have to swat the roach exactly, because of the bulky, square rect around it. I
was wondering, if I could have a free form shape as a hitbox,all around the flyswatter, so
I couldn't just swat the roach from practically from across the screen. Does anyone know
how I would do this?
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: Trying to make a smaller hitbox

Postby Mekire » Thu Nov 21, 2013 3:48 pm

Yes, you can do pixel perfect collision by using masks. I think you will find this a bit challenging at this point though. It would pretty much require you to use classes to be reasonable. If you can code up a very basic flyswatter sprite class, and bug sprite class I will help you further. If not... well, you have some homework. You can't avoid functions and classes forever.

-Mek
User avatar
Mekire
 
Posts: 987
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan


Return to Game Development

Who is online

Users browsing this forum: No registered users and 2 guests