This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-09-08 23:09:11

Syprox
New Scratcher
Registered: 2010-09-08
Posts: 2

Can a sprite sense the mouse-pointer if it's gliding?

<if><< <touching[mouse-pointer] <and> <mouse down?> >>

change score by 1


Doesn't seem to be working while the sprite is gliding to a certain position...


Help?

Offline

 

#2 2010-09-08 23:16:12

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Can a sprite sense the mouse-pointer if it's gliding?

That should work fine. All it really senses is If it's touching the mouse pointer - which it is - and if the mouse button is clicked.

Offline

 

#3 2010-09-08 23:22:02

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Can a sprite sense the mouse-pointer if it's gliding?

...Unless the sensing part is in the same script as the gliding part... then there would be a problem.


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#4 2010-09-08 23:24:49

Syprox
New Scratcher
Registered: 2010-09-08
Posts: 2

Re: Can a sprite sense the mouse-pointer if it's gliding?

Thank you!

I separated the scripts and now they work fine. Thanks for the quick response.

Offline

 

#5 2010-09-08 23:29:18

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: Can a sprite sense the mouse-pointer if it's gliding?

It will work but not in the same script block.
To make it work, do a broadcast before the glide in one set of blocks.
Put the If Touching/ Change Score in the separate "When "whatever" Recieved set of blocks.
You will also have to use something (a variable maybe) to tell the "When "whatever"  Recieved" block to stop executing after the glide is finished.


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#6 2010-09-08 23:30:29

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: Can a sprite sense the mouse-pointer if it's gliding?

ninja'd!! (great job Harakou  smile  )


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#7 2010-09-08 23:34:55

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Can a sprite sense the mouse-pointer if it's gliding?

Ah - I can't believe I didn't think of that! Great job, Harakou  smile

Offline

 

Board footer