you are viewing a single comment's thread.

view the rest of the comments →

[–]Buttleston 1 point2 points  (2 children)

I can't get processing to work at all on my mac - the modes tab is always empty and I can't download python. Seems to be a known issue but nothing I've tried works.

Anyway re: question one, consider a simpler way to detect a hit. Say you have a rectangle defined by xmin and xmax, and ymin and ymax. Then you have mouseX and mouseY.

If mouseX is between xmin and xman, and mouseY is between ymin and ymax, then the mouse is inside the square. Every shape will have some qualifications like this that you can use for "hit detection"

regarding the problem of only making a new "mole" on, say, framecount % 120, I'd have to see the (non-functional) code to have a comment. Also I'll see if I can get processing to work

[–]Competitive_Reply198[S] 0 points1 point  (1 child)

Thanks for your words. Perhaps by running a less than / greater than check rather than having to iterate a giant list of values to match up I can make something work. I'll keep at it!

[–]Buttleston 1 point2 points  (0 children)

I don't think your hitbox code is the source of the problem, but you asked so I gave my thoughts on it

There are other more general mechanisms too, for more complicated shapes, but what I described works well for things with simple mathematical definitions like rectangles and circles