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

#1 2012-08-22 08:48:15

Jodymoses
Scratcher
Registered: 2012-05-03
Posts: 100+

Object placement

Does anyone know how to place an object in a scroll x and y project then go to the different location at the mouse click e.g. Warcraft 3 or age of empires


http://i46.tinypic.com/2hxwx9s.png
I Have Huge Ideas, But Only If You Listen And Talk To Me...

Offline

 

#2 2012-08-22 09:26:49

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Object placement

Do you mean snap to a grid based on the mouse's x and y coordinates?


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#3 2012-08-23 00:53:51

Jodymoses
Scratcher
Registered: 2012-05-03
Posts: 100+

Re: Object placement

Sorry for the duplicate


http://i46.tinypic.com/2hxwx9s.png
I Have Huge Ideas, But Only If You Listen And Talk To Me...

Offline

 

#4 2012-08-23 01:03:17

Jodymoses
Scratcher
Registered: 2012-05-03
Posts: 100+

Re: Object placement

Bump


http://i46.tinypic.com/2hxwx9s.png
I Have Huge Ideas, But Only If You Listen And Talk To Me...

Offline

 

#5 2012-08-24 08:50:39

Jodymoses
Scratcher
Registered: 2012-05-03
Posts: 100+

Re: Object placement

That script basicly gives you go to mouse x because it is go to (mousex x 3) /3


http://i46.tinypic.com/2hxwx9s.png
I Have Huge Ideas, But Only If You Listen And Talk To Me...

Offline

 

#6 2012-08-24 19:03:02

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Object placement

It rounds after dividing.  This is ultimately the concept behind snapping to a grid.  Basically, numbers within a certain range (the divisor) return the same number.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#7 2012-08-25 22:32:57

Scratcher456
Scratcher
Registered: 2010-12-04
Posts: 58

Re: Object placement

I think I see what you mean. As in, clicking instead of using arrow keys or WASD to move, and the character walks there. Well, what I might do, if we're talking 2D scrolling with a scroll-x and a scroll-y is this: http://scratch.mit.edu/projects/Scratcher456/2747681

Hope that helps!  smile

Last edited by Scratcher456 (2012-08-26 09:10:29)


Mining diamonds, mining diamonds, mining diamonds...

Offline

 

Board footer