简体   繁体   中英

Using spritecollide in Pygame - with rotated surfaces

I have created a surface that is intended to be used as a 'wall' for an rpg style game, however I rotated this surface so it takes the form of a diamond since this is how the game design looks. My question is when using spritecollide it only works in rect arguments (rectangles). How can I make a 'wall' surface that has been rotated and essentially gives a rotated rect argument for a diamond? Thanks for the help!!

You can use collision masks for anything more complex than a rectangle or circle. http://www.pygame.org/docs/ref/sprite.html#pygame.sprite.collide_mask

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM