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.

Author
Message
KoolAid Man
15
Years of Service
User Offline
Joined: 25th Nov 2010
Location:
Posted: 2nd Dec 2010 01:52
How would I make it so when you collide into the spheres they delete? Ive tried everything I can't do it.




Wait. What?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Dec 2010 13:33
More ... useful thread subject please.

Anyway, the problem occurs because you check for collision with the stars at the wrong point.

You move your player object, check for collision with all objects including the stars, and if colliding, reset your position. Then when you check for collision with the stars at the top of the loop again, you are no longer colliding.

Remove the existing star collision, and place it after your position your object, but just before you do your general collision check.

In fact, use this piece of code instead of your existing code to check for the star collision:


Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet

Login to post a reply

Server time is: 2026-07-21 18:58:11
Your offset time is: 2026-07-21 18:58:11