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 / SetSpriteShapeChain

Author
Message
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 30th Jan 2021 04:46 Edited at: 31st Jan 2021 22:07
I am trying to use the 'SetSpriteShapeChain' function, without success
In the following example the 'spr' variable equals always to 0.0 and no shape is drawn

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 31st Jan 2021 21:55 Edited at: 31st Jan 2021 22:14
I think you need to start with SetSpriteShapeChain() and then use AddSpriteShapeChain()

Look in the Examples provided under Physics/ChainShape

Actually looking at that example it doesn't use AddSpriteShapeChain() at all. It does work though

You are setting the object to be static. I imagine you want it to be dynamic
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 31st Jan 2021 22:12 Edited at: 31st Jan 2021 22:19
at a glance, you keep changing the numPoints parameter when the number shouldn't change.
no, that's not it. looking closer, now.
[My Itch.io Home] [Now Playing]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=AGK] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[Google Forum Search]
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 31st Jan 2021 22:21
Guess what? It tunnels
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 31st Jan 2021 22:30 Edited at: 31st Jan 2021 22:34
and i'd guess its to do with the fact that chains are hollow? probably better to use polygons when trying to "pick" a sprite with mouse coords.
[My Itch.io Home] [Now Playing]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=AGK] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[Google Forum Search]
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 31st Jan 2021 22:40 Edited at: 1st Feb 2021 03:34
Actually it happens with shape chains AND regular polygons. When the last point comes in contact with another object
Check it out (Comment out the chain loop to see the polygon loop)


george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 4th Feb 2021 11:00 Edited at: 4th Feb 2021 11:01
Thank you guys for taking the time to look at it.
Quote: "and i'd guess its to do with the fact that chains are hollow? probably better to use polygons when trying to "pick" a sprite with mouse coords."

I don't think so. Reading from the manual:
Quote: "... Chains are rigid and can be used to create hollow concave polygons, ..."

Correct me if I am wrong, but judging from blink0k's video, we have a bug here.

Login to post a reply

Server time is: 2024-11-24 05:56:23
Your offset time is: 2024-11-24 05:56:23