I'm trying to get my sprite to go back and forth.
I've tried to do:
When Green Flag clicked
Forever
Glide 15 sec to x, y
Go to x,y
Point in direction -90
Glide 15 sec to x, y
Go to x, y
Point in direction 90
This worked on my first maze game, but now my sprite gets stuck on the edge of the screen. I've tried: When Green Flag clicked
forever
move 10 steps
point in direction -90
move -10 steps
That didn't go to well. My sprite got stuck at the point it was supposed to turn around, and started to shake.
Offline
Sturm_Programing wrote:
I'm trying to get my sprite to go back and forth.
I've tried to do:When gf clicked Forever Glide (15) secs to x: (x) y: (y) Go to x: (x) y: (y) Point in direction [-90 v] Glide (15) secs to x: (x) y: (y) Go to x: (x) y: (y) Point in direction [90 v]
This worked on my first maze game, but now my sprite gets stuck on the edge of the screen. I've tried:When gf clicked forever move (10) steps point in direction [-90 v] move (-10) steps
That didn't go to well. My sprite got stuck at the point it was supposed to turn around, and started to shake.
So is that the only script that your sprite has? I doubt that, though if it is true, then your sprite's going to shake because there's no delay and things are happening very rapidly. You'll probably want to use a glide block, or a repeat loop instead. That, or you could add in a delay. As for getting stuck, I'm not sure what'd cause that in your script. :/
Anyway, hello Sturm_Programing and welcome to Scratch! I hope tat you'll have a great time here!
With regards,
ErnieParke
Last edited by ErnieParke (2013-04-22 21:07:06)
Offline
do this:
forever if <key [left arrow v] pressed?> change x by [-5]and
forever if <key [right arrow v] pressed?> change x by [5]on this way it runs more smooth
Last edited by kattenelvis (2013-04-25 09:59:46)
Offline
here's something like what ernie suggested (using both repeat and wait blocks):
when gf clicked forever point in direction [90] repeat [10] move [10] steps end wait [1] secs point in direction [-90] repeat [10] move [10] steps end wait [1] secs
Offline
forever if <key [left arrow v] pressed?> change x by [-5] wait (0.75) secsand
forever if <key [right arrow v] pressed?> change x by [5] wait (0.75) secson this way it runs more smooth
Offline