Pages: 1
  Print  
Author Topic: Animation Speed  (Read 975 times)
Offline (Unknown gender) Mr. Meeseeks
Posted on: June 10, 2016, 10:46:48 AM
Member
Joined: Jun 2016
Posts: 3

View Profile
As new User a hello to everyone here on the forum :)

Now to my problem:

In the sprite editor you can set the animation speed (30 by standard). I made a simple walking Animation of 8 frames, as normal gif the animation looks fine (outside Enigma).
However in Enigma (with animation speed 30) it looks ridiculous fast, setting down the animation speed to 11 in the sprite editor gives me what i wish but it doesn't save that speed.
When i start up the game, i have again my sprite "walking" with super speed :/

I tired it with sprite sheet as well as with a *.gif.

(Using Ubuntu)

thanks, Mr. Meeseeks
Logged
Offline (Male) rcobra
Reply #1 Posted on: June 10, 2016, 01:05:15 PM
Member
Joined: Nov 2015
Posts: 67

View Profile WWW
create event in object player add code
Code: [Select]
image_speed = 0.16
Logged
ps.sorry for my english
Offline (Unknown gender) Mr. Meeseeks
Reply #2 Posted on: June 10, 2016, 01:53:52 PM
Member
Joined: Jun 2016
Posts: 3

View Profile
Ahh thank you =)
Logged
Offline (Male) Goombert
Reply #3 Posted on: June 10, 2016, 04:30:48 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
Yeah that has been there since the beginning of LateralGM. The reason why is we can't really predict what the room speed is going to be and such. However I believe that the timer used by the sprite frame makes it so if you set the speed to 30, it plays it back at 30fps.
https://github.com/IsmAvatar/LateralGM/blob/7a167463ec972edbb2c5dc9f811d22c30a09ba87/org/lateralgm/subframes/SpriteFrame.java#L1113

The problem is that image_speed works differently. So that is actually 1/30 or 1/8 (just make it 1 divided by whatever # of frames per second you put in the sprite frame).
« Last Edit: June 10, 2016, 04:32:48 PM by BlitzBert » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) Mr. Meeseeks
Reply #4 Posted on: June 12, 2016, 05:23:03 AM
Member
Joined: Jun 2016
Posts: 3

View Profile
I simply made me a test room where i can mess around with different image_speeds.
At the end of the day it is only important that the animation looks good  :)
Logged
Offline (Male) Goombert
Reply #5 Posted on: June 12, 2016, 06:31:32 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
Awesome! Yeah it's an old GameMaker thing. It probably would have been better in retrospect if image_speed was the fps of the animation, it would be less confusing I think. But for compatibility reasons it's better if we just let well enough alone.

Generally image_speed = room_speed / sprite_get_number(sprite_index); will make the sprite frame always the same as it plays back in the game.
« Last Edit: June 12, 2016, 06:34:32 PM by BlitzBert » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Pages: 1
  Print