Hi
I am trying to write a game where 2 balls bounce around the screen and you move a player ball to avoid touching the other 2 balls. (I can add more balls later)
http://scratch.mit.edu/projects/zleap/3028345
each time the user yellow ball touches a black ball the lives (or life variable) should decrement by 1
What actually happens is that this goes down 2 or 3 each time,
Just wondering what the best way round this was.
The options seem to be mainly "touching" so if sprite 3 is touching sprite 1 or 2 then live -1 or if colour is touching colour.
clearly as they are touching for longer the lives goes down quicker
II need something like
if spirit3 touches sprite3 then life -1
then carry on with the sprite moving around rather then running the above several times. It happens even if I move sprite 3 across the plane of sprite 1 or 2, 2 is a clone of 1.
I run a programming club so one of the young people made it so it uses a yellow ball rather than the mouse cursor.,
Offline
The problem is that as long as you are touching the black ball you lose points like a leech. One cheap fast solution is to give the user a lets say 1 sec invincibility when you are hit to "recover".
wait (1) secsSo put this after you lose one point. I recommend this, because there would be nothing stopping the user from following the black ball once the user is hit and not lose any more points from that sprite (if you had your dream code). Then again I haven't tested the theory that the black is too fast for the user to actually follow.
Offline
It might be better to use the following script:
when gf clicked forever if <<touching [Ball1 v]?> or <touching [Ball2 v]?>> change [Lives v] by (-1) wait until <not<<touching[Ball1 v]?> or <touching [Ball2 v]?>>> end end
Last edited by amcerbu (2013-01-10 19:41:20)
Offline
Why is two posts asking the same thing about this post that posts, and I put a post on about that, that my post, was your post which is the same post but a little bit less information in my post, which my post has less informantion but I figured it out on that post but there is more posts with more information on what this post is all about posts which is better than my post, than your post, so this this is your post, and my post, which got the same posts that post on your post and my post.
Nothing else.
Offline
fetchydog567 wrote:
Why is two posts asking the same thing about this post that posts, and I put a post on about that, that my post, was your post which is the same post but a little bit less information in my post, which my post has less informantion but I figured it out on that post but there is more posts with more information on what this post is all about posts which is better than my post, than your post, so this this is your post, and my post, which got the same posts that post on your post and my post.
Nothing else.
... o_o
Offline