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

#1 2010-10-23 05:05:11

dsitharthan
New Scratcher
Registered: 2010-10-08
Posts: 4

How to stop sprite costumes from continuing to cycle

Hi I am currently making my own platform game using Archmage's scrolling game template here http://scratch.mit.edu/projects/archmage/635312

The engine uses the variable stance to discern between different sprite animations. so my problem is after i have replaced the default character costumes and change the context so that it cycles through the walk animation each time left or right is pushed it continues to cycle through all the costumes until it reaches the end. It I know my explanation is bad but once you look at the game scripts mainly the if right or left arrow key pressed set stance to 2 (this initiates the  costume cycle). Thank you

Offline

 

#2 2010-10-23 05:35:58

dsitharthan
New Scratcher
Registered: 2010-10-08
Posts: 4

Re: How to stop sprite costumes from continuing to cycle

Anyone? Please help I really need it

Offline

 

#3 2010-10-23 06:47:20

dsitharthan
New Scratcher
Registered: 2010-10-08
Posts: 4

Re: How to stop sprite costumes from continuing to cycle

I would like to make that as soon as I release a button or press a button a new animation starts for example When no button is pushed the player sprite is in its idle animation and if i jump or move left or right i must wait until the animation cycles once fully through for the next one to start. I would ideally like it so that as soon as I jump it goes to the jump animation etc. Any help at all would be appreciated.

Offline

 

#4 2010-10-23 09:28:11

demosthenes
Retired Community Moderator
Registered: 2008-02-19
Posts: 1000+

Re: How to stop sprite costumes from continuing to cycle

Okay I know the problem you are facing as I have had to deal with it many times.

Here is the solution I have had the most luck with, although it would help if I had your project to see exactly how you did it:

http://img706.imageshack.us/img706/4879/stancefix.gif


You will notice that there are several portions of this script you must fill in yourself. If you have any questions about it, just ask and I'll try and make it more clear.

If you try it and it doesn't work, please upload your project and I'll take a a look at it.


I've taken a long hiatus, but I still visit sometimes. Give me some time to answer any messages you post on my projects!

Offline

 

#5 2010-10-23 20:55:57

dsitharthan
New Scratcher
Registered: 2010-10-08
Posts: 4

Re: How to stop sprite costumes from continuing to cycle

Thank you so much this script is perfect. This is the greatest forum ever the response was so quick

Offline

 

Board footer