Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

You've pretty much just described it. I have a function called Map() which basically lerps a value from one range (max velocity, min velocity) to the sprites in a list (0, sprites.count). Velocity goes in, animation frame index comes out.

The Map function code looks like this

public float Map(float value, float istart, float istop, float ostart, float ostop) {
     return ostart + (ostop - ostart) * ((value - istart) / (istop - istart)); 
}

Ah, I see! Since asking the question I had found a video of yours where you explain that function, and I’m quite grateful that you do, but the reason I’m asking here, with this game specifically, is because it’s made in Godot. 

You see, I’ve been trying to replicate that in a way that is clean and unmessy, but the only way I could get close was mapping the velocity to a seek time in the animation player. 

If it’s not too much trouble, could you tell me which method you’ve used to make the sprite list? Furthermore, how do you control which one is being shown at the mapped velocity(which node is actually doing the showing of the frames)?


I see I’ve written quite the reply, I thank you for your time and patience in advance.