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

#1 2013-01-15 21:42:00

kelpow
Scratcher
Registered: 2012-02-03
Posts: 83

simplifying arrowkey movements

ok, just a little thing i found to simplify move scripts
rather than this:

when gf clicked
forever
if <key [up v] pressed>
change y by (1)
end
if <key [down v] pressed>
change y by (-1)
end
if <key [right v] pressed>
change x by (1)
end
if <key [left v] pressed>
change x by (-1)
end
if you change the properties of the key pressed so boolean = false, then you can make this
when gf clicked
forever
change x by <<key [right v] pressed> - <key [left v] pressed>>
change y by <<key [up v] pressed> - <key [down v] pressed>>

Offline

 

Board footer