Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7863213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:24:42+00:00 2026-06-02T23:24:42+00:00

Having scoured the documentation and various tutorial sites, I still can’t get my head

  • 0

Having scoured the documentation and various tutorial sites, I still can’t get my head around the way you modify the sprite.collide method with anything other than rectangular bounding-box collision detection.

I have a program which needs to detect collision between a sprite “Hook” and any one of a number of fish, stored in a sprite group called “fishies”

I can use:

for hit in pygame.sprite.spritecollide(self, self.fishies)

to return a list of colliding sprites using the bounding rectangles, but I want to use circles or masks.

The documentation says I can use:

pygame.sprite.spritecollide(self, self.fishies, False, collided = None)

where “collided” is a callback function. But I can’t work out what that means. Simply writing:

 pygame.sprite.spritecollide(sprite, group, dokill, pygame.sprite.collide_circle())

produces an error.

Can anyone help, or have I misunderstood how it is supposed to work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T23:24:44+00:00Added an answer on June 2, 2026 at 11:24 pm

    I think you almost have it — the problem is you’re calling collide_circle instead of passing the function itself. Try something like this:

    pygame.sprite.spritecollide(hook, fish, False, pygame.sprite.collide_circle)
    

    The only difference in syntax is leaving off the parentheses. What pygame requires for the collided parameter is a function that takes two sprites and returns a boolean indicating whether or not they collided, so you can pass any function that collides two sprites, even a custom one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having some issues getting my head around the differences between UTF-8, UTF-16, ASCII and
I have scoured the internet looking for a good tutorial or posting about having
Having studied the switch documentation and discovering it can only switch on integral types
I would really appreciate any help I can get with this. I am having
Having an assembly which I cannot modify (vendor-supplied) which have a method returning an
I'm a big fan of having people that can check work no matter what
Having (presumably) understood the motivation behind Nuget, I want to know, whether we still
I'm having a problem with my autocompletetextview. I'm trying to get the autocomplete get
I've scoured Google and Stackoverflow and can't seem to come up with a definitive
Having recently had reason to peruse the Nullable documentation, I noticed that the definition

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.