Sprite animations and static frames

SGDK only sub forum

Moderator: Stef

Post Reply
matteus
Very interested
Posts: 330
Joined: Mon Feb 04, 2008 1:41 pm

Sprite animations and static frames

Post by matteus » Sun Sep 24, 2017 10:25 am

How do I keep a sprite fixed on a single frame in an animation sequence? I've a 9 frame acceleration gage and I want frames 0, 5 and 9 to act as stop points.

I currently do things like this:

Animation 1 - 1 frame bottom gage point
Animation 2 - 3 frames braking
Animation 3 - 1 frame middle gage point
Animation 4 - 3 frames accelerating
Animation 5 - 1 frame top gage point

User avatar
Staffan
Very interested
Posts: 57
Joined: Wed Jun 14, 2017 2:33 pm

Re: Sprite animations and static frames

Post by Staffan » Thu Sep 28, 2017 7:12 am

I dont know if there is a certain way of doing this in sgdk, but in my game I set the frames manually and have a counter when its time to change them.
For an example I change from first to second frame when counter reach 20, but from second to third when the counter reach 60 and so on.

Thats how I do it :)

User avatar
Stef
Very interested
Posts: 2627
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Sprite animations and static frames

Post by Stef » Thu Sep 28, 2017 9:04 am

Exactly, you have to handle the sprite animation by yourself then, using 0 as timer value in the resource declaration :)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests