Pages: 1
Topic closed
How do you make a sprite do a specific action only if it's clicked on the first time?
For example, I want a sprite to broadcast a message so another sprite will recieve the broadcast and pop up. But I only want the first sprite to broadcast a message the first time its clicked.
Offline
webinzat100 wrote:
How do you make a sprite do a specific action only if it's clicked on the first time?
For example, I want a sprite to broadcast a message so another sprite will recieve the broadcast and pop up. But I only want the first sprite to broadcast a message the first time its clicked.
I'll tell you. I just have to make the script first. Be back in a sec.
Edit: here.
Last edited by owetre18 (2011-09-01 17:11:17)
Offline
[blocks]<when green flag clicked>
<set{ Clicked? }to( no
<when[ object ]clicked>
<if <( <<{ Clicked? }>= no> )>>
<broadcast[ broadcast
<end>
<set{ Clicked? }to( yes
[/blocks]
Last edited by ImagineIt (2011-09-01 17:08:18)
Offline
laptop97 wrote:
Start
Wait Until <<Touching[mouse-pointer]>and <Mouse down>>
Broadcast[Whatever Broadcast]
Nope: you can hold your mouse down and drag it over the sprite and still activate the script.
Offline
New Script
Start
Forever If<Touching [mouse-pointer]>
Wait Until <mouse down>
If <Touching[mouse-pointer]>
Broadcast[Whatever Broadcast]
Stop Script
Last edited by laptop97 (2011-09-01 21:29:26)
Offline
well if you want the first thing to hide it would be alot easier
Offline
4lover wrote:
well if you want the first thing to hide it would be alot easier
That is not the case here though.
Solution:
When Flag Clicked
forever
if touching mouse pointer and mouse down
broadcast message
stop script
Offline
Topic closed
Pages: 1