Animation Timing offset


(Jason Pickering) #1

Hey, So I am having a little bit of a problem with torch animation. They are all synced when my games loads meaning all their animations are exactly in time with each other. They are just simple looping animaitons. I tried doing this but it did not seem to work

Sprite.play(“Idle”, true, FP.choose( 0, 4, 7));

I was hoping that would offset them. I know a simple work around. Just making a few different idles that have different starting positions, but I thought I would ask about this.


(Sharon Shalom Iluz) #2

Hey i’m new to FP maybe i can help

try this

there is a better way to do this but im new to programming as you can see

public var _torch:Spritemap = new Spritemap(TORCK, 100, 100;

	public function Player()
	{
		_torch.add("flame1", [0, 1, 2, 3, 4, 5], 20, true);
		_torch.add("flame2", [3, 4, 5, 0, 1, 2], 20, true);
                    _torch.add("flame3", [2, 3, 4, 5, 0, 1, 2], 20, true);

		graphic = _torch;
	}

        public var _offset:int = 0;

	override public function update():void
	{
		_offset ++;
		if (_offset == 5)
		{
			_torch.play("flame1", true);
		}
                    if (_offset == 8)
		{
			_torch.play("flame2", true);
		}
                    if (_offset == 10)
		{
			_torch.play("flame3", true);
		}


	}