I've got two sprites: sprite1 and sprite2
The script of sprite2 says:
"when green flag clicked
repeat until touching sprite1
do something"
So sprite2 does this something but when sprite1 touches it then sprite2 simply continues as if nothing had happened. Why!? Shouldn't it exit from the repeat loop at that point??
Thanks a lot!
Offline
Are either of the sprites hidden?
Offline
I'm having the same problem. I've been looking around but i can't seem to find the solution.
Here's a sample of the script (Hoping that I've done it correctly!)
when gf clicked repeat forever glide [1.3] secs to x:[188] y:[-150] wait [0] secs glide [1.3] secs to x:[188] y:[-150] end if [touching [Magic ball]] switch to costume [Dragon hit] say [ARGH!] for [1] secs switch to costume [Dragon norm] end
Offline
I noticed there's a couple of mistakes, mainly the glide paramiters are the same, and that the "Repeat forever" does not encapsulate everything. That's purely a noob mistake, first time poster & user, they are however displayed correctly in Scratch
No edit-post so double post!
Offline
Gravitation wrote:
Are either of the sprites hidden?
I can't check right now but I don't think so ... I surely can see them during the running of the program. But the one sprite simply go above (or under) the other and nothing happens ... although the sprite name selected in the 'touching' drop down is the correct one. It worked though at some point before (but I changed a lot in the program in the mean time) but I don't see what would prevent the 'touch' event from being executed ...
Offline
Daeica wrote:
I'm having the same problem. I've been looking around but i can't seem to find the solution.
Here's a sample of the script (Hoping that I've done it correctly!)when gf clicked forever glide [1.3] secs to x:[188] y:[-150] wait [0] secs glide [1.3] secs to x:[188] y:[-150] if <touching [Magic ball v]> switch to costume [Dragon hit] say [ARGH!] for [1] secs switch to costume [Dragon norm] end end
fixed
Offline
dvd4 wrote:
Daeica wrote:
I'm having the same problem. I've been looking around but i can't seem to find the solution.
Here's a sample of the script (Hoping that I've done it correctly!)when gf clicked forever glide [1.3] secs to x:[188] y:[-150] wait [0] secs glide [1.3] secs to x:[188] y:[-150] if <touching [Magic ball v]> switch to costume [Dragon hit] say [ARGH!] for [1] secs switch to costume [Dragon norm] end endfixed
Right, that yes, but I'm in the same boat as OP. While I have the script set to be "hit", no hitting is detected when the two sprites connect.
I added a double measure for both sprites, so they would trigger the same end-result when connecting, but that hasn't helped.
Offline
Daeica wrote:
I'm having the same problem. I've been looking around but i can't seem to find the solution.
Here's a sample of the script (Hoping that I've done it correctly!)when gf clicked forever glide [1.3] secs to x:[188] y:[-150] wait [0] secs glide [1.3] secs to x:[188] y:[-150] if <touching [Magic ball v]?> switch to costume [Dragon hit v] say [ARGH!] for [1] secs switch to costume [Dragon norm v] stop script end end
Fixed and edited the script. I think you just needed a 'stop script' block in there.
Did that work?
Offline
Willpower wrote:
Xeronimo wrote:
Hm ... still the same problem ... it seems to me like it's only registered as a 'touch' if certain, specific pixels of each sprite come into contact!?
Can you post a link to this project?
First, he needs to upload it.
Offline
I'm having the same problem as well. When I have my Sprite 1 set in a forever loop of "move 2 steps - if on edge, bounce" it will register the touch of my Sprite 3. But if I have it set to "glide" mode (even within the same exact script, with just taking out the move & bounce blocks and replacing them with the glide blocks), it doesn't register the touch. Is this something to do with how the glide script itself works? Maybe the sprite isn't technically touching the pixels between glide points?
Offline