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 / Sprite Collision From Array

Author
Message
Divided
FPSC Reloaded TGC Backer
11
Years of Service
User Offline
Joined: 31st Oct 2013
Location:
Posted: 12th Jun 2015 16:26
Greetings,

How might one, after clicking a sprite to randomly change its position on the screen to check whether it is colliding with another object and if so, randomly change its position on the screen until it's not.





Something like this I presume?



Above is the code used to create the array.

Cheers for any help

DividedV -- YouTube Channel
Divided
FPSC Reloaded TGC Backer
11
Years of Service
User Offline
Joined: 31st Oct 2013
Location:
Posted: 13th Jun 2015 05:38
Bumping this post, Please help.

DividedV -- YouTube Channel
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 15th Jun 2015 12:10
You'd probably need to reposition the sprite in a while loop i.e. while sprite a is colliding with sprite b, reposition.

I'd also drop the SprEi and just add the sprite to the array directly.




Using AppGameKit V2 Tier 1
Divided
FPSC Reloaded TGC Backer
11
Years of Service
User Offline
Joined: 31st Oct 2013
Location:
Posted: 15th Jun 2015 14:50
Thank you very much. you were very helpful.

DividedV -- YouTube Channel

Login to post a reply

Server time is: 2024-11-25 22:21:27
Your offset time is: 2024-11-25 22:21:27