Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / SetSpriteGroup - for reference not physics

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Sep 2013 17:09
I have a sprite system which uses groups. A group could be one sprite, or it could be 100. I could have 1 group or I could have 100 groups.

Do you know if I can use the Sprite Physics SetSpriteGroup() to register my own group number without "switching on" physics? It will make my non-physics hit tests so much faster if I can narrow them immediately by group ID. My only concern is that it will switch on physics functionality that I don't want.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 9th Sep 2013 17:15
It's a very simple answer: Yes

The help text for SetSpriteGroup specifically says it is for physics or non-physics.

This allows you to use commands like GetSpriteHitGroup (which doesn't use physics) to see if an x,y point is over a sprite in the group.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Sep 2013 17:51
Assigns this sprite to a group for filtering collisions (physics or non physics)

If I was younger, I think I would be calling this a facepalm. At my age it's simply being a 42 carat plonker.

Thank you



Login to post a reply

Server time is: 2024-05-03 09:14:41
Your offset time is: 2024-05-03 09:14:41