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

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.

New Users, Read This
  • Use code tags when posting code.
  • Include any errors with your post (in code tags).
  • Describe your problem; not your chosen solution.
  • Make examples the minimum length to demonstrate your issue.
User avatar
Posts: 1711
Joined: Thu Feb 07, 2013 11:33 pm
Location: Tucson, Arizona

Return to Game Development

Who is online

Users browsing this forum: Bing [Bot] and 3 guests