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 / Strange results from GetSpriteContactWorldX( )

Author
Message
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 20th Jul 2012 20:24
I was thinking that using the GetSpriteContactWorld commands would be nice to reposition my player sprite with but the results I'm getting makes no sense. I am getting different result from different sprites. Take a look at the attached screenshot.



Some of the contacts I get new results as the player moves through the sprites. The others get me strange coordinates that makes no sense. Origo is in the bottom left corner of the player screen (inside black frame). Resolution is 200x120 and the leftmost contact point is at 32 pixels. If I place the player so he just touches those blocks I get 37.09 and 33.32. Earlier I got different numbers but quit and ran it again.

Player sprite is dynamic as sensor. The level tiles are static.

Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Jul 2012 20:43
Perhaps you should look at ray casting?


this.mess = abs(sin(times#))
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 20th Jul 2012 20:54
Yeah, that could be a good option for this.

Still, this seems very bugged out to me.

Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 20th Jul 2012 20:56
But then, rays are lines. They could easily miss the tiles. Trying to do it manually though, but no luck since GetContactSpriteID doesn't return the sprite numbers of the tiles. See my other thread on this.

Login to post a reply

Server time is: 2024-05-05 15:35:52
Your offset time is: 2024-05-05 15:35:52