Page 1 of 1

Animations

Posted: Fri Jan 24, 2020 11:47
by Kulche
I rewrote the tutorial to make it clearer and easier for others to learn :)


Definition

First, you have to define the animation so you can use it later. Here's how to do so:

Code: Select all

[
	{
	"id":"$tutorial_animation00", //unique id of your animation
	"type":"animation",
	"frames":[{"bmp":"tutorial.png"}, {"bmp":"tutorial2.png"}],
	"speed":2.5 //speed at which will the frames change, 1 is default, the higher the value, the slower it goes
}
]
tutorial.png
tutorial.png (75 Bytes) Viewed 661 times
tutorial2.png
tutorial2.png (76 Bytes) Viewed 661 times

Usage

Now, you need to add the actual animation to a building:

Code: Select all

[
	{
	... //rest of the building's code goes here ^
	"animation":[
		{"id":"$tutorial_animation00", //defines which animation will it use
		"x":14, //position of animation on horizontal axis, x:0 is at the leftmost edge, will show the anim close to the center
		"y":-3 //position on vertical axis, x:0 is on the middle of the tile, will show the anim slightly above the center
		}]
}
]
And, that's the result:
yes_you_have_to.png
You have to believe it actualy moves, here's the file if you don't:
KulcheAnimations.zip
(13.76 KiB) Downloaded 7 times
Hope I didn't mess up with anything, if I did, notify me down there \/ :)

Re: Animations

Posted: Fri Jan 24, 2020 13:28
by ├ślsken
Nice tutorial :)

Re: Animations

Posted: Fri Jan 24, 2020 14:14
by yusuf8a684
I kinda understand now but not sure :D

Re: Animations

Posted: Sun Jan 26, 2020 8:04
by RayXP
Same...