Pages: 1
My questions;
How do I program a 'Idle' Animation? (And multiple ones, at that)
Suppose you have a sprite. It has four different Idle animations, one for each direction and each of them has 2 frames. When you tap the left key, the Sprite (Let's call it 'Sprite A') should turn to the left and start doing a left Idle animation. Same goes for all the different directions. However, when you hold down the key, it should go to it's walking animation.
Does anyone know how to code this? If not, a <If <insert key here> Tapped> should be implemented (Only if it's possible, oh lovely Scratch Team!) :>
And how do you program a sidescrolling screen? :s
Also, collision. Lovely collision. Sprite A needs to collide with a tree because it's not a ghost. (Though that would be a lovely excuse not to have to code collision)
Thank you to anyone and everyone who helps/answers. :3
Offline
(To answer your first question)
For my example, just say you want the sprite to turn left, and the costumes for it facing left are the first and second costumes.
when [left arrow key v] pressed? forever if <<not>(costume#) = [1]> switch to costume [left1 v] else switch to costume [left2 v] change x by [-10]Please correct me if the script is wrong, or that's not what you meant!
Offline
Thank you, Zangooser. However, I don't want it to go on forever. If it did that it wouldn't be able to switch between various animations. x)
I think I vaguely figured it out...
when gf clicked repeat until < Left arrow key pressed > or <Right arrow key pressed> or <Up arrow key pressed> or <Down Arrow Key pressed> switch to costume Idle Front 1 wait 0.5 seconds switch to costume Idle front 2 wait 0.5 secondsThat's the script that tells it to do the the Idle animation from the front view when you start.
when right arrow pressed repeat until <key up arrow pressed?> or <key down arrow pressed> or <key left arrow pressed> switch to costume Left Idle 1 wait 0.5 seconds switch to costume Left Idle 2 wait 0.5 secondsNow, when ever I click on another key, it starts glitching between the two animations.
Offline
SusannaElisabeth wrote:
Thank you, Zangooser. However, I don't want it to go on forever. If it did that it wouldn't be able to switch between various animations. x)
I think I vaguely figured it out...when gf clicked repeat until < Left arrow key pressed > or <Right arrow key pressed> or <Up arrow key pressed> or <Down Arrow Key pressed> switch to costume Idle Front 1 wait 0.5 seconds switch to costume Idle front 2 wait 0.5 secondsThat's the script that tells it to do the the Idle animation from the front view when you start.when right arrow pressed repeat until <key up arrow pressed?> or <key down arrow pressed> or <key left arrow pressed> switch to costume Left Idle 1 wait 0.5 seconds switch to costume Left Idle 2 wait 0.5 secondsNow, when ever I click on another key, it starts glitching between the two animations.
(Say I pressed the up arrow then the left arrow; it starts glitching between both of those idle animations.)
Easy fix for this problem,
put this in your animation scripts (or around it):
if <key [All animation keys v] pressed?> stop script
Last edited by daniel_j (2012-08-11 11:48:32)
Offline
Man, I failed at writing that. ._.
Offline
Oops, I didn't see your reply, Daniel. I'm testing it out right now.
...
It's still doing it.
Offline
Pages: 1