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

#1 2013-01-23 15:47:35

Zebus
New Scratcher
Registered: 2013-01-21
Posts: 14

Here is a example of movment script.

First time doing the script blocks in a post...

when gf clicked
forever
 if [key [up arrow v] pressed?]
  change y by [5]
 end
end
when gf clicked
forever
 if [key [down arrow v] pressed?]
  change y by [-5]
 end
end
when gf clicked
forever
 if [key [left arrow v] pressed?]
  change x by [-5]
 end
end
when gf clicked
forever
 if [key [right arrow v] pressed?]
  change x by [5]
 end
end
or you could do it like this i guess which seems more orginized

when gf clicked
forever
 if [key [up arrow v] pressed?]
  change y by [5]
 end
 if [key [down arrow v] pressed?]
  change y by [-5]
 end
 if [key [left arrow v] pressed?]
  change y by [-5]
 end
 if [key [right arrow v] pressed?]
  change y by [5]
 end
end
hope that helps with smooth movement if any one else has imput put up some blocks to help people out

hope this post right

Offline

 

#2 2013-01-23 16:08:50

BLU_Spy
Scratcher
Registered: 2012-01-05
Posts: 1000+

Re: Here is a example of movment script.

Zebus wrote:

First time doing the script blocks in a post...

when gf clicked
forever
 if <key [up arrow v] pressed?>
  change y by (5)
 end
end
when gf clicked
forever
 if <key [down arrow v] pressed?>
  change y by (-5)
 end
end
when gf clicked
forever
 if <key [left arrow v] pressed?>
  change x by (-5)
 end
end
when gf clicked
forever
 if <key [right arrow v] pressed?>
  change x by (5)
 end
end
or you could do it like this i guess which seems more orginized

when gf clicked
forever
 if <key [up arrow v] pressed?>
  change y by (5)
 end
 if <key [down arrow v] pressed?>
  change y by (-5)
 end
 if <key [left arrow v] pressed?>
  change x by (-5)
 end
 if <key [right arrow v] pressed?>
  change x by (5)
 end
end
hope that helps with smooth movement if any one else has imput put up some blocks to help people out

hope this post right

Fixed the blocls for you. Also, you put y in all the blocks from the second script...  tongue

Last edited by BLU_Spy (2013-01-23 16:12:20)


I HAVE SWITCHED ACCOUNTS! My new username is NoxSpooth.

Offline

 

Board footer