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

#1 2012-02-06 21:39:55

trekkie2000
Scratcher
Registered: 2009-02-15
Posts: 100+

Laser glitch

So Im making this laser tag game, and its looking pretty good. Then I get to the part where you actually shoot the lasers. The script looks like this:

Go to (Player)
Pen down
Glide .01 seconds to (Position of player crossheir)
Pen up
Wait .1 seconds
Clear

Makes sense, right? Get this: Nothing happens. So I take the script apart, run through each piece, clicking individually. Works fine. Put them together again. I'm thinking it might be the wait block. Maybe .01 seconds is just to short. I set it to 2 full seconds as an experiment. it doesn't work. Then, just to see what happens, I take the wait block out entirely. It works fine (But of course I can't keep the wait block out, then when you run in turbo you couldn't see your bullets.) WHAT IS HAPPENING?! I've had scratch glitch a few times, but only once has it ever done something like this.
Edit: So now I've run into another perplexing problem. I have no idea why, but switching the Pen Up and the wait fixed the glitch. Now Im stuck with the problem of shooting through walls.

Last edited by trekkie2000 (2012-02-06 21:48:07)


"If life gives you lemons, sell lemonade for $.25...
...Sell antidote to poison in lemonade for $250" -Me

Offline

 

#2 2012-02-06 22:43:52

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: Laser glitch

Change the 'glide .01 seconds' to 'glide .02 seconds' and it works perfectly.


http://trinary.tk/images/signature_.php

Offline

 

#3 2012-02-07 16:30:07

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Laser glitch

Why use a glide at all if you want it to move that fast?  Maybe just use Goto (position of player crosshair)?  I do agree that Glide should blend into Goto as the glide time decreases though.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer