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 / [SOLVED] Orbit, set and get angle

Author
Message
Rocco Sette
7
Years of Service
User Offline
Joined: 2nd Aug 2017
Location:
Posted: 10th Sep 2017 18:27 Edited at: 10th Sep 2017 19:00
Triple Post, deleted

The author of this post has marked a post as an answer.

Go to answer

Rocco Sette
7
Years of Service
User Offline
Joined: 2nd Aug 2017
Location:
Posted: 10th Sep 2017 18:28 Edited at: 10th Sep 2017 19:00
Triple Post, deleted
Rocco Sette
7
Years of Service
User Offline
Joined: 2nd Aug 2017
Location:
Posted: 10th Sep 2017 18:38
Good morning,

I'm trying to set and get an angle, here is code :



But angle# is not "10" at end.
planet_sprite_x and y is defined for get angle, and when i switch angle by planet_angle i get "0", as expected.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 10th Sep 2017 18:42
i guess here "GetSpriteX(button_sprite)" you are using the left top edge from sprite comparted to a center sprite position.
definition of distance & distanceTotal should be float, not see a # here but maybe u using as float?
instead of message try a do loop with print() values direct at screen.


GetSpriteXByOffset
is equal
GetSpriteX(planet_sprite) + GetSpriteWidth(planet_sprite)/2



AGK (Steam) V2017.08.16 : Windows 10 Pro 64 Bit : AMD (17.7.2) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Rocco Sette
7
Years of Service
User Offline
Joined: 2nd Aug 2017
Location:
Posted: 10th Sep 2017 18:48
(Sorry for 3 post, i don't see my message oO)

I use GetSpriteX(planet_sprite) + GetSpriteWidth(planet_sprite)/2 for set the center of planet.
I want compare position X & Y of button to planet_x and planet_y (are just new coor for compare angle)
I use distance to integer because i get an difference like 0.0000015 for distanceTotal
Rocco Sette
7
Years of Service
User Offline
Joined: 2nd Aug 2017
Location:
Posted: 11th Sep 2017 11:45
I testing that code (take on other thread, and modify).

I do not get same angle, if you know why...

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 11th Sep 2017 12:05
maybe this help you
AGK (Steam) V2017.08.16 : Windows 10 Pro 64 Bit : AMD (17.7.2) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Rocco Sette
7
Years of Service
User Offline
Joined: 2nd Aug 2017
Location:
Posted: 11th Sep 2017 12:10
I think yes, i will try that tonight or tomorrow, if i need i come back.

Thank's a lot Markus
Rocco Sette
7
Years of Service
User Offline
Joined: 2nd Aug 2017
Location:
Posted: 11th Sep 2017 12:56
This post has been marked by the post author as the answer.


Test it, he draw an ellipse, not a circle, if you know why...
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 11th Sep 2017 15:48 Edited at: 11th Sep 2017 15:49
SetVirtualResolution(100,100) is missing, it do some initial things
AGK (Steam) V2017.08.16 : Windows 10 Pro 64 Bit : AMD (17.7.2) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Rocco Sette
7
Years of Service
User Offline
Joined: 2nd Aug 2017
Location:
Posted: 11th Sep 2017 15:52
I testing with that before, and it works in facts. Thank's

Login to post a reply

Server time is: 2024-11-24 08:03:20
Your offset time is: 2024-11-24 08:03:20