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.

Newcomers AppGameKit Corner / [SOLVED] Sprites disappears when when it's offset is touched

Author
Message
Zandy
2
Years of Service
User Offline
Joined: 26th Nov 2021
Playing:
Posted: 2nd Dec 2021 15:23
When using an otherwise functional code for moving a Sprite to x and y with getpointer functions, if the Sprite is touched at it's topleft corner the Sprite disappears

Without the code (using agkmobile hence no copyandpaste) can anyone provide some reasons this might be happening?

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

Go to answer

Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Dec 2021 04:58
This post has been marked by the post author as the answer.
Reasoning? Sure, your code is wrong. Without seeing your code there's not much else anyone can tell you. If I had to guess, you're doing something with the difference in values of the sprite's location and where you click. You could be getting 0 as an offset value and using that in some calculation that throws everything off.

Print out the sprites location on screen. When it disappears look to see what those values are. If it's a crazy number then your sprite is simply off-screen, which is most likely what's happening.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Zandy
2
Years of Service
User Offline
Joined: 26th Nov 2021
Playing:
Posted: 4th Dec 2021 00:35
Lol duh my codes wrong. I already did the snooping to find my Sprite and yeah it's at the max coordinates of 2417000000 or something. I'm gonna try to get my toddlers soggy trash covered vanilla wafer of a code up here for any cruel yet invaluable observations you might bless me with. Meanwhile, I'm curious to know why my wayward Sprite over at -24179968996689 doesn't come trudging back to my screen when I tap again. Do sprites or other off screen elements typically ignore input from other quadrants?
Zandy
2
Years of Service
User Offline
Joined: 26th Nov 2021
Playing:
Posted: 4th Dec 2021 01:08
I added some sloppy workaround for comedic effect

here's the main.agc unless it isn't here

Login to post a reply

Server time is: 2024-03-29 12:13:45
Your offset time is: 2024-03-29 12:13:45