I am making a game with a top down perspective. I have a ball moving along a pathway which you control with the arrow keys. I want the ball to fall off (i.e. it will shrink and reset back to the start) when more than half the ball is off the pathway. I cannot use (when not touching path) since this only works when the sprite is completely off the pathway.
Any ideas?
Thank you
Offline
This sounds quite difficult mate, but if you make two halves of the ball as sprite and have one go forever go to X x position of sprite 1+10 or something and Y y position of sprite 1. This means that it will look like a whole ball and if the whole of one half leaves the track (one sprite) than the whole thing could have a repeat 100 change size by -1 wait 0.001 seconds. Remember when using the size things that at the start you need to use the set size to something block.
Sorry if that was a bit long can someone correct me if this is wrong?
Offline
Thanks emboar30
I think I understand, but it would depend on how I cut the ball. If I have two sprites together and the cut was vertical then it works when moving left and right but not when moving top to bottom.
Offline
victini125 wrote:
Thanks emboar30
I think I understand, but it would depend on how I cut the ball. If I have two sprites together and the cut was vertical then it works when moving left and right but not when moving top to bottom.
Thanks for correcting me
Offline
Make a 1x1 pixel sprite that forever [ go to Ball. if not touches Path [ "you die" ] ].
It also not always "half of the ball out of path" (but is it nearly impossible to achieve), but is nearer to it, without hassle of right splitting.
Offline
Thanks Deerel
That was the first thing I tried
The problem is that the single pixel sprite is always surrounded by the ball sprite, so it never touches the path. As soon as the game starts [not touches path] returns true even if the ball is on the path.
Offline
Go with the one-pixel dot idea, but make it a costume for the ball sprite instead of a separate sprite. Make it rapidly switch between costumes and do the sensing when it is on the dot costume, like this:
Now the ball won't be there to disrupt the sensing. Also, when run in presentation mode or online, you will not see the dot costume. That will only happen offline in normal stage size (which is designed to show all graphical changes).
Last edited by Kileymeister (2011-06-04 10:07:33)
Offline
Thanks Kileymeister, that's a great idea! I'll give that a go today.
I don't fully understand the differences between presentation mode and normal stage mode. I'll have to look into that.
Offline