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

#1 2011-05-13 04:39:49

Matty3414
Scratcher
Registered: 2011-04-09
Posts: 100+

Animation and Keyboard Help!

So i'm making a Game where its like your own world, you can even have a swim! But, I need help Walking animation, i have the animations done and Sprite moving, but when i drag the script (down there) Into my Other script that makes him move.

<if><key[ Right Arrow ]pressed?>
<forever>
<switch to costume[ (lets say 1)
<wait( 0.3 )secsc>
<switch to costume[ 2
<wait( 0.3 )secsc>
<switch to costume[ 3
<wait( 0.3 )secsc>
<end>

--Matty3414--

Please help!


http://i.imgur.com/i87ba.pngDesigner - Photoshop, C4D

Offline

 

#2 2011-05-13 05:16:26

natalie
Scratch Team
Registered: 2007-03-07
Posts: 100+

Re: Animation and Keyboard Help!

The "if" block just checks one time. So, try placing the "if" inside the forever.

(Or you can try the block "when ___ key pressed" block (instead of forever with if).)

I like the idea of taking a swim as part of the game.

Natalie

Offline

 

#3 2011-05-13 11:39:19

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

Re: Animation and Keyboard Help!

Your if block should be inside the forever block instead of the other way around.


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

 

#4 2011-05-13 19:30:24

Matty3414
Scratcher
Registered: 2011-04-09
Posts: 100+

Re: Animation and Keyboard Help!

natalie wrote:

The "if" block just checks one time. So, try placing the "if" inside the forever.

(Or you can try the block "when ___ key pressed" block (instead of forever with if).)

I like the idea of taking a swim as part of the game.

Natalie

Still dosn't work, here my full script up to where i'm stuck which is were the animation wont make 'HERO' Move.

<when green flag clicked>
<forever>
<if><<  <not> <touching[Land  >>
<change y by( 4
<end>
<if><< <key[ Right Arrow ]pressed?> <and> <<  <not> <key[ Left Arrow ]pressed?> >> >>
<change y by( 4
<end>
<if><( Hit_test Of Slope Dec <=> 1 )>
<change y by( 5.3
<end>

Thanks for your help so far

--Matty3414--


http://i.imgur.com/i87ba.pngDesigner - Photoshop, C4D

Offline

 

Board footer