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 / How to find the top of a sprite using GetSpriteX(..)?

Author
Message
Subbir
11
Years of Service
User Offline
Joined: 20th Jun 2012
Location:
Posted: 18th Oct 2012 08:46
I have this sprite attached with this post. I have to rotate this sprite from the bottom as well as increase the size of this sprite randomly. Thats y I have to set the sprite offset at the bottom by using this function



But the problem is I cant get the top position of this sprite. After rotation I need the top position of this sprite where I could see that on which box its pointing to. But if I try using GetSpriteX() or GetSpriteY() then it shows only the bottom position of this sprite.

Is it possible to get the sprite Top position after setting up the SpriteOffset? Its kindaa killing me. Please help

Subbir Rahman

Attachments

Login to view attachments
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 18th Oct 2012 10:00
off the top of my head

The last bit might be -90, sorry away from my code.
Subbir
11
Years of Service
User Offline
Joined: 20th Jun 2012
Location:
Posted: 18th Oct 2012 10:49 Edited at: 18th Oct 2012 10:57
I am afraid this is not working. I have tried this method earlier. The problem is If I scroll my pointer to the left side, It doesnt show the right path or co-ordinate. I have attached the screenshoot. Just take a look of it. The Xnew# and Ynew# isnt showing the right co-ordinate on the screen. I am giving u my code how I have done this.



Subbir Rahman

Attachments

Login to view attachments
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 18th Oct 2012 20:28 Edited at: 18th Oct 2012 20:30
Have a look at this, it shows the method I would use.

I've used very obvious variable names to try to keep the method as clear as possible.

No Media needed.

It changes angle and size a random amount and displays the values to as well as the pointer position ( so the values can be checked )
Subbir
11
Years of Service
User Offline
Joined: 20th Jun 2012
Location:
Posted: 19th Oct 2012 08:58
Thank u so much Marl. This is what I was looking for...

Subbir Rahman
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 19th Oct 2012 21:49
I posted a sprite to world function set in the useful community functions project. They seem to work pretty well...


this.mess = abs(sin(times#))

Login to post a reply

Server time is: 2024-05-04 17:07:27
Your offset time is: 2024-05-04 17:07:27