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 / Making something go towards a certain point and then detect collision

User Offline
Joined: 28th Nov 2018
Posted: 28th Nov 2018 01:42
So lets say I want a sprite to go to (100, 1000) and then when it reaches that point, it detects if there is anything there. If there is, then
randomvariable = randomvariable + 1
happens. How exactly would I do this? I like to look at code, and learn what the person did, so it would be nice if someone could write the code, since I am new. Sorry if my english is bad.
Years of Service
User Offline
Joined: 6th Jan 2018
Posted: 28th Nov 2018 11:12
There is a good example of moving sprites using tweens in the gelp files under SetTweenSpriteX() command

To check if two sprites collide, you can use the command GetSpriteCollision()
If you are not checking against another sprite, but some logical location instead, then you could use GetSpriteInBox or GetSpriteInCircle.
DBPro Master
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Nov 2018 16:47

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
Valued Member
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 6th Dec 2018 03:05 Edited at: 6th Dec 2018 03:22
Bit of code to demonstrate:

Coders don't die, they just gosub without return

Login to post a reply

Server time is: 2019-02-20 08:24:16
Your offset time is: 2019-02-20 08:24:16