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

#1 2013-04-30 06:14:45

dinosaur1995
New Scratcher
Registered: 2013-04-18
Posts: 8

script help......! Aligning with mouse-pointer

When making a connect-4 game, how do you make the ball disks align and fit each respective column? Thank you!

Offline

 

#2 2013-04-30 20:15:31

Smozzick
Scratcher
Registered: 2011-10-23
Posts: 100+

Re: script help......! Aligning with mouse-pointer

Use a lot if elses to ensure that when your mouse is between specific location the disc only goes to the correct area and doesnt specifically trail the mouse...

This might help:

xy tile selection

It's the type of concept you're talking about, I think.


http://i50.tinypic.com/ded8m.png

Offline

 

#3 2013-05-01 05:31:33

dinosaur1995
New Scratcher
Registered: 2013-04-18
Posts: 8

Re: script help......! Aligning with mouse-pointer

Do you mind walking me through the steps?

Offline

 

#4 2013-05-01 21:38:53

dracae
New Scratcher
Registered: 2013-04-05
Posts: 42

Re: script help......! Aligning with mouse-pointer

@smozzick: You don't necessarily need a lot of if-elses...
@dinosaur: So, if it only moves through the x-axis, try:

when gf clicked
forever
set x to <<round <(mouse x) / (16)>> * (16)>

Offline

 

Board footer