I'm making a game like whac-a-mole, and I really need something like "if the sprite is clicked, change custom."
Is there anyway I can do that?
(ps: "when sprite is clicked" doesn't work for me, I really really need the IF statement!!)
Offline
JSO wrote:
Try this:
[blocks]
<if><< <mouse down?> <and> <touching[ mouspointer >>
<end>
[/blocks]
Note that if you use this someone could just keep the mouse held down the whole time, while the when ____ key clicked is a test of one click.
Offline
Zelda123 wrote:
JSO wrote:
Try this:
[blocks]
<if><< <mouse down?> <and> <touching[ mouspointer >>
<end>
[/blocks]Note that if you use this someone could just keep the mouse held down the whole time, while the when ____ key clicked is a test of one click.
A slightly more complex way, taking this into consideration:
[blocks]
<if><< <mouse down?> <and> <touching[ mousepointer > <and> <( MDown <=> 0 )> >
<set{ MDown }to(1
(do whatever)
<end>
<if> <not> <mouse down?> >>
<set{ MDown }to(0
<end>
[/blocks]
Offline
S65 wrote:
Zelda123 wrote:
JSO wrote:
Try this:
[blocks]
<if><< <mouse down?> <and> <touching[ mouspointer >>
<end>
[/blocks]Note that if you use this someone could just keep the mouse held down the whole time, while the when ____ key clicked is a test of one click.
A slightly more complex way, taking this into consideration:
[blocks]
<if><< <mouse down?> <and> <touching[ mousepointer > <and> <( MDown <=> 0 )> >
<set{ MDown }to(1
(do whatever)
<end>
<if> <not> <mouse down?> >>
<set{ MDown }to(0
<end>
[/blocks]
What I do is:
[blocks]
<when green flag clicked>
<forever>
<if><< <mouse down?> and <touching[ mouse-pointer ] >>
<wait until><not><mouse down?>>>
<end>
<end>
Last edited by coolstuff (2008-05-21 20:03:02)
Offline
thank you all ^0^
Offline