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

#1 2011-07-07 21:13:46

CarolineandGir
Scratcher
Registered: 2009-07-31
Posts: 5

How to make wings flap slower?

I have a bat who needs to flap his wings slower. His script is like this:

[blocks]<when[ right arrow ]key pressed>
<forever if>[/blocks] right arrow pressed?
[blocks]<next costume>
<move(3)steps>
<switch to costume[1][/blocks]

This, however, makes the wings flap rapidly. How do I make them flap slower?

Last edited by CarolineandGir (2011-07-07 21:15:34)

Offline

 

#2 2011-07-07 21:25:46

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: How to make wings flap slower?

You could as one option add more costumes in the flap animation, that way there are more frames to flip through. I'm assuming you're using a default bat sprite though, so you could also add a delay to each costume change, like this:

http://i.imgur.com/46ZAr.gif


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#3 2011-07-08 20:21:46

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: How to make wings flap slower?

Harakou wrote:

You could as one option add more costumes in the flap animation, that way there are more frames to flip through. I'm assuming you're using a default bat sprite though, so you could also add a delay to each costume change, like this:

http://i.imgur.com/46ZAr.gif

Why do you feel the need to overcomplicate things?


_______________________________
[when key [left arrow V] pressed]_________
repeat (insert number of costumes here)]
[ ]
[next costume]
[ ][wait (0.1) secs]________________________
[_______________________________________]


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#4 2011-07-08 20:42:27

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: How to make wings flap slower?

henley wrote:

Harakou wrote:

You could as one option add more costumes in the flap animation, that way there are more frames to flip through. I'm assuming you're using a default bat sprite though, so you could also add a delay to each costume change, like this:

http://i.imgur.com/46ZAr.gif

Why do you feel the need to overcomplicate things?


_______________________________
[when key [left arrow V] pressed]_________
repeat (insert number of costumes here)]
[ ]
[next costume]
[ ][wait (0.1) secs]________________________
[_______________________________________]

But that makes the movement jerky.  Harakou's is smoother.  Of course, you could always split it into two scripts and use your script and CoralineandGir's script minus the costume changes.


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#5 2011-07-08 21:15:56

a1130
Scratcher
Registered: 2009-08-27
Posts: 500+

Re: How to make wings flap slower?

You could add a [wait ( ) secs] block... but make sure the wait time is a small decimal so the animation doesn't get TOO choppy, e.g. 0.125 or 0.25. If 0.125 or 0.25 is already too choppy, experiment with different numbers until you get what you want.

Highlight  smile ----->Actually, Harakou's is better.

Last edited by a1130 (2011-07-08 21:17:59)

Offline

 

#6 2011-07-08 21:32:44

Thescratch3
Scratcher
Registered: 2011-06-14
Posts: 1000+

Re: How to make wings flap slower?

I think I got it. Okay, KEEP your script. Only add one thing. Add a wait block after the move 3 steps or whatever steps WAIT (maybe 3-5 seconds) then switch back to costume 1. You should put a forever there  wink . Also, you shouldn't use when key pressed. I am pretty sure movements are jerky. So just do a when flag clicked forever if key right arrow pressed your script (including my addition) minus the when something key pressed. Of course, do the same thing for the left arrow key (but make sure to have costumes facing the other way!). Hope this helped  wink . Good luck on your game!  big_smile


View my projects. Or face The scratch curse! (Get it?)
http://i56.tinypic.com/2cdk8hy.png

Offline

 

#7 2011-07-08 21:36:07

Thescratch3
Scratcher
Registered: 2011-06-14
Posts: 1000+

Re: How to make wings flap slower?

a1130 wrote:

You could add a [wait ( ) secs] block... but make sure the wait time is a small decimal so the animation doesn't get TOO choppy, e.g. 0.125 or 0.25. If 0.125 or 0.25 is already too choppy, experiment with different numbers until you get what you want.

Highlight  smile ----->Actually, Harakou's is better.

Woops didn't see your post.


View my projects. Or face The scratch curse! (Get it?)
http://i56.tinypic.com/2cdk8hy.png

Offline

 

#8 2011-07-09 00:50:36

LordSydney
Scratcher
Registered: 2011-04-20
Posts: 100+

Re: How to make wings flap slower?

For the "when key [] pressed" problem simply add a "repeat until < not < key [] pressed > >"

Last edited by LordSydney (2011-07-09 00:51:10)


Need help with BBCode?
http://i.imgur.com/IfWrL.gifAlso check this out!http://i.imgur.com/YgF2v.gif

Offline

 

#9 2011-07-09 08:04:48

scratchisthebest
Scratcher
Registered: 2009-02-08
Posts: 500+

Re: How to make wings flap slower?

You could try adding more costumes. Copy the first costume 5 times, then copy the second costume 5 times, so there are 5 copies of the first costume, then 5 copies of the second, and so on.


bye 1.4, we all loved you. but we all outgrew the site. 2.0 is a welcome change.
http://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.png

Offline

 

#10 2011-07-10 02:28:38

emboar30
Scratcher
Registered: 2011-05-03
Posts: 100+

Re: How to make wings flap slower?

CarolineandGir wrote:

I have a bat who needs to flap his wings slower. His script is like this:

[blocks]<when[ right arrow ]key pressed>
<forever if>[/blocks] right arrow pressed?
[blocks]<next costume>
<move(3)steps>
<switch to costume[1][/blocks]

This, however, makes the wings flap rapidly. How do I make them flap slower?

One way to solve this is to make the bat fly all the time with a script that says:
when green flag clicked forever switch costume wait one second switch costume. If that wasn't clear it's because I fail at using the scratch blocks on here  smile

Last edited by emboar30 (2011-07-10 02:31:03)


http://scratch.mit.edu/static/icons/buddy/788987_med.png?t=2011-05-02+15%3A14%3A41
I is epiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiic!     See my stuff here!!!!!

Offline

 

#11 2011-07-10 16:45:21

estorken
Scratcher
Registered: 2010-04-01
Posts: 41

Re: How to make wings flap slower?

i like to have as few scripts running at once as possible so i don't like the multiple script suggestions. i have to agree with harakou. however i would make one change.

instead of forever if, i would put all movement code in the same forever with a bunch of if statements.

i don't like having a lot of global variables either, but this one can be local so idc.

i can't use these block things effectively in the forums so i will stick with text


http://i56.tinypic.com/esqpma.gif

Offline

 

#12 2011-07-10 17:27:58

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: How to make wings flap slower?

estorken wrote:

i like to have as few scripts running at once as possible so i don't like the multiple script suggestions. i have to agree with harakou. however i would make one change.

instead of forever if, i would put all movement code in the same forever with a bunch of if statements.

i don't like having a lot of global variables either, but this one can be local so idc.

i can't use these block things effectively in the forums so i will stick with text

Oh, I just used forever if because I was being lazy.  tongue  I usually use an if inside of a forever block too.


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#13 2011-07-11 19:59:38

a1130
Scratcher
Registered: 2009-08-27
Posts: 500+

Re: How to make wings flap slower?

Thescratch3 wrote:

a1130 wrote:

You could add a [wait ( ) secs] block... but make sure the wait time is a small decimal so the animation doesn't get TOO choppy, e.g. 0.125 or 0.25. If 0.125 or 0.25 is already too choppy, experiment with different numbers until you get what you want.

Highlight  smile ----->Actually, Harakou's is better.

Woops didn't see your post.

It's OK. Sometimes people agree on the same thing, sometimes they each have different opinios.

Offline

 

Board footer