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 / will objects intercept

Author
Message
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Nov 2016 06:55
Ive got the following code to determine if the angle of object 1 will intercept between objects 1 and 2 to 5



but I believe the problem I'm having is how to make it within a certain range ie the width of a sprite as most of the time it returns zero

fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Nov 2016 07:32
getting some better results with this code


but I think the function should return true more often than it is
fubar
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Nov 2016 07:33
maybe step into the current direction and check with
=GetSpriteInCircle( iSprite, x1, y1, radius ) if there is something in front.
GetWorldXFromSprite
GetWorldYFromSprite
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS Sierra (10.12)
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Nov 2016 07:42
ok fixed the problem some print statements in the code helped
I had to convert the values to integer

fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Nov 2016 07:47
Thanks Marcus had to spend some time away due to family sickness but am back now, so am dam rusty lol
but good to see your still around used to always love your feedback on so many posts
fubar
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Nov 2016 12:55 Edited at: 16th Nov 2016 20:03
ok.

visual version
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS Sierra (10.12)

Login to post a reply

Server time is: 2024-11-24 22:37:23
Your offset time is: 2024-11-24 22:37:23