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

#1 2010-11-23 09:40:09

like2compute
Scratcher
Registered: 2010-10-22
Posts: 11

scratch is awesome

were you talk about scratch problems

Offline

 

#2 2010-11-23 09:47:05

like2compute
Scratcher
Registered: 2010-10-22
Posts: 11

Re: scratch is awesome

<point in direction( script wont work why?
script below.
<when[ right arrow ]key pressed>
<point in direction( 90
<move( 3 )steps>

<when[ left arrow ]key pressed>
<point in direction( -90
<move( 3 )steps>

<when[ up arrow ]key pressed>
<point in direction( 180
<move( 3 )steps>

<when[ down arrow ]key pressed>
<point in direction( 0
<move( 3 )steps>

why not work?

Offline

 

#3 2010-11-23 10:26:31

TheSaint
Scratcher
Registered: 2008-11-04
Posts: 1000+

Re: scratch is awesome

Use this:

<when green flag clicked>
<forever>
<if><key[ Down arrow ]pressed?>
<point in direction( 0
<move( 3 )steps>
<end>
<if><key[ Up arrow ]pressed?>
<point in direction( 180
<move( 3 )steps>
<end>
<if><key[ Right arrow ]pressed?>
<point in direction( 90
<move( 3 )steps>
<end>
<if><key[ Left arrow ]pressed?>
<point in direction( -90
<move( 3 )steps>
<end>

This script should work just fine.  big_smile

Offline

 

#4 2010-11-23 15:59:06

HD123
Scratcher
Registered: 2009-12-05
Posts: 500+

Re: scratch is awesome

TheSaint wrote:

[blocks]
Use this:

<when green flag clicked>
<forever>
<if><key[ Down arrow ]pressed?>
<point in direction( 0
<move( 3 )steps>
<end>
<if><key[ Up arrow ]pressed?>
<point in direction( 180
<move( 3 )steps>
<end>
<if><key[ Right arrow ]pressed?>
<point in direction( 90
<move( 3 )steps>
<end>
<if><key[ Left arrow ]pressed?>
<point in direction( -90
<move( 3 )steps>
<end>
<end>
[/blocks]
This script should work just fine.  big_smile

That will make you go down when you press up, and up when you press down.  Here is the script, it will work.


when green flag clicked {
  forever {
    if (key [down arrow] pressed) {
      point in direction (180)
      move (3) steps
    }
    if (key [up arrow] pressed) {
      point in direction (0)
      move (3) steps
    }
    if (key [right arrow] pressed) {
      point in direction (90)
      move (3) steps
    }
    if (key [left arrow] pressed) {
      point in direction (-90)
      move (3) steps
    }
  }

Last edited by HD123 (2010-11-23 15:59:39)


~~HD123~~
Treat others as you want to be treated. |  big_smile  | http://i.imgur.com/OaNrY.gif | http://blocks.scratchr.org/libstatus.php?user=HD123&amp;online=http://lemonfanatic.webs.com/ONLINE.png&amp;offline=http://lemonfanatic.webs.com/OFFLINE.png

Offline

 

#5 2010-11-23 16:20:25

TheSaint
Scratcher
Registered: 2008-11-04
Posts: 1000+

Re: scratch is awesome

HD123 wrote:

TheSaint wrote:

[blocks]
Use this:

<when green flag clicked>
<forever>
<if><key[ Down arrow ]pressed?>
<point in direction( 0
<move( 3 )steps>
<end>
<if><key[ Up arrow ]pressed?>
<point in direction( 180
<move( 3 )steps>
<end>
<if><key[ Right arrow ]pressed?>
<point in direction( 90
<move( 3 )steps>
<end>
<if><key[ Left arrow ]pressed?>
<point in direction( -90
<move( 3 )steps>
<end>
<end>
[/blocks]
This script should work just fine.  big_smile

That will make you go down when you press up, and up when you press down.  Here is the script, it will work.


when green flag clicked {
  forever {
    if (key [down arrow] pressed) {
      point in direction (180)
      move (3) steps
    }
    if (key [up arrow] pressed) {
      point in direction (0)
      move (3) steps
    }
    if (key [right arrow] pressed) {
      point in direction (90)
      move (3) steps
    }
    if (key [left arrow] pressed) {
      point in direction (-90)
      move (3) steps
    }
  }

Whoops, I assumed that the angles he gave were correct. My bad.  big_smile

Offline

 

#6 2010-11-24 12:46:10

colorfusion
Scratcher
Registered: 2009-10-03
Posts: 500+

Re: scratch is awesome

like2compute wrote:

<point in direction( script wont work why?
script below.
<when[ right arrow ]key pressed>
<point in direction( 90
<move( 3 )steps>

<when[ left arrow ]key pressed>
<point in direction( -90
<move( 3 )steps>

<when[ up arrow ]key pressed>
<point in direction( 180
<move( 3 )steps>

<when[ down arrow ]key pressed>
<point in direction( 0
<move( 3 )steps>

why not work?

Could you explain more about what is not working?
It just looks like you got up and down mixed up but it should still work, just the wrong way around.

Offline

 

Board footer