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

#1 2013-02-04 16:02:43

agentdtf
New Scratcher
Registered: 2013-02-02
Posts: 1

Maze Science Fair Project

Science Fair Project
Hi, my son and I are new to scratch, however he has grasp the basic programming concepts of scratch. For his science fair projects he would like to guide a sprite through a maze given directions based on the sprite xy coordinates. Is there a block that will provide the sprite current xy coordinates to be used in a variable?
Thanks
Agentdtf and Slicer

Offline

 

#2 2013-02-04 16:14:16

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Maze Science Fair Project

Yep!
I'm assuming you want a robot in the program, not physically, so you can go to the Motion section of blocks for the

(x position)
and
(y position)
blocks.

Last edited by Firedrake969 (2013-02-04 16:15:03)


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#3 2013-02-04 16:15:10

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Maze Science Fair Project

This block

([x position v] of [someSprite v])
(in the sensing tab) will return the current x- or y-position of a selected sprite. 

If your script lives inside the current sprite, you can also just use
(x position) 
(y position)
(in the motion tab).

Last edited by amcerbu (2013-02-04 16:15:27)

Offline

 

Board footer