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

#1 2012-07-22 06:42:31

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

How do i make my ship move in the direction im pointing at (keys)

I'm new to this lol but i've made my ship- rotating left right but i want it to move forwards in the same direction that my ship is pointing and move backwards away from where my ship is pointing at... anyone have the scratch blocks?

Offline

 

#2 2012-07-22 06:43:54

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: How do i make my ship move in the direction im pointing at (keys)

when gf clicked
forever
 if <key [left arrow v] pressed?>
  turn ccw (1) degrees
 end
 if <key [right arrow v] pressed?>
  turn cw (1) degrees
 end
 move (2) steps
end


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&amp;display=small

Offline

 

#3 2012-07-22 07:08:17

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: How do i make my ship move in the direction im pointing at (keys)

ty  smile )

Offline

 

#4 2012-07-29 19:50:49

maxamillion321
Scratcher
Registered: 2011-06-17
Posts: 500+

Re: How do i make my ship move in the direction im pointing at (keys)

when gf clicked
go to [mouse-pointer v]

Last edited by maxamillion321 (2012-07-29 19:51:44)

Offline

 

#5 2012-07-29 20:16:51

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: How do i make my ship move in the direction im pointing at (keys)

SciTecCf wrote:

when gf clicked
forever
 if <key [left arrow v] pressed?>
  turn ccw (1) degrees
 end
 if <key [right arrow v] pressed?>
  turn cw (1) degrees
 end
 move (2) steps
end

Nice, but the ship needs to move forwards and backwards without turning. Here is what I thought of:

When gf clicked
forever
 if <key [left arrow v] pressed?>
  turn ccw (1) degrees
 end
 if <key [right arrow v] pressed?>
  turn cw (1) degrees
 end
 if <key [up arrow v] pressed?>
  move (2) steps
 end
 if <key [down arrow v] pressed?>
  move (-2) steps
 end


http://i46.tinypic.com/35ismmc.png

Offline

 

#6 2012-08-13 00:26:55

Blaze_X
Scratcher
Registered: 2012-08-12
Posts: 43

Re: How do i make my ship move in the direction im pointing at (keys)

Make you ship turn with the post above (not mine). Then, on the laser sprite, put if space key pressed, go to ship, point in direction (direction of ship), repeat until touching object: move 5 steps, and your done!


http://tinypic.com/view.php?pic=rh5wl0&amp;s=6

Offline

 

#7 2012-08-13 08:45:53

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

Re: How do i make my ship move in the direction im pointing at (keys)

This is a visualization of what Blaze_X is talking about:

when key [space v] pressed
go to [space ship v]
point in direction ([direction v] of [space ship v])
repeat until <touching [edge v]?>
move (5) steps
end


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

Offline

 

#8 2012-12-04 18:54:30

nitromian
Scratcher
Registered: 2012-09-02
Posts: 9

Re: How do i make my ship move in the direction im pointing at (keys)

move (1) steps

move (-1) steps

Offline

 

#9 2012-12-05 07:39:17

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: How do i make my ship move in the direction im pointing at (keys)

nitromian wrote:

move (1) steps

move (-1) steps

That script isn't going to be of any help... It would just move 1 pixel forward then another backward.

maxamillion321 wrote:

when gf clicked
go to [mouse-pointer v]

That script would just make the sprite go to the mouse pointer once and end. The topic owner wants to use the arrow keys and not the mouse, too.


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

Board footer