Page 1 of 1
Tile animations/bumps
Posted: Fri Jun 08, 2012 3:46 pm
by Grey
I'm not too interested in proper framed animations, but I'm curious if the T-Engine can make the tiles do little hops? Like you might have the @ (or a sprite) move up 1/10th of a tile and then drop down again when hit. Or perhaps move towards a certain direction and then back again when attacking, Cardinal Quest style. Is this possible?
Re: Tile animations/bumps
Posted: Fri Jun 08, 2012 11:19 pm
by celane
Would love to see animations being implemented, especially since I'm planning a realtime module

.
Re: Tile animations/bumps
Posted: Mon Jun 11, 2012 12:45 am
by azrael
I actually like this idea. As it stands, I sometimes have trouble telling whether or not I hit an enemy when they are in a large group, and having to repeatedly check their health and determine whether or not it decreased is a little annoying.
Re: Tile animations/bumps
Posted: Tue Sep 11, 2012 8:20 am
by darkgod
Tile animation support is in svn now!
Set the image to an image with all the frames left to right; set an anim property on the entity like that:
anim = {speed=1, loop=-1, max=10}
And voila!
I'll go check bumps

Re: Tile animations/bumps
Posted: Tue Sep 11, 2012 9:40 am
by darkgod
Bumps implemented!
when you do setMoveAnim() in your actor:move code, you can add two new parameters after the blur one:
foo:setMoveAnim(ox, oy, smooth_move, blur, twitch_dir, twitch_force)
twitch_dir is one of 1/2/3/4/6/7/8/9
twitch_force is how much to twitch for (1 == one full tile)
This is easily usable to twitch attacks too; just do a move anim without moving:
self:setMoveAnim(self.x, self.y, 3, nil, util.getDir(x, y, self.x, self.y), 0.2)
Re: Tile animations/bumps
Posted: Tue Sep 11, 2012 11:12 am
by Grey
You are too awesome, DG :D
Re: Tile animations/bumps
Posted: Tue Sep 11, 2012 11:26 am
by darkgod
/bows
Re: Tile animations/bumps
Posted: Sat Sep 15, 2012 7:59 am
by chezzo
Awesome! Can't wait to get anim working. It's gonna take my game to the next level.
So, I made a 640x64 image with a couple different fires that I use as walls in Hellfire.
I changed data/general/grids.lua to reflect:
newEntity{
define_as = "WALL",
name = "wall",
image="terrain/tree1.png",
display = '', color_r=160, color_g=160, color_b=160, back_color=colors.BLACK,
always_remember = true,
does_block_move = true,
can_pass = {pass_wall=1},
block_sight = true,
air_level = -20,
dig = "FLOOR",
anim = {speed=1, loop=-1, max=10},
}
I'm assuming max=10 equals ten frames? Anyways, when I try to load a new game, it never loads. I'm using the nightly build .exe, dlls from 42 and the svn code.
Re: Tile animations/bumps
Posted: Sun Sep 16, 2012 11:38 pm
by chezzo
I didn't have the right code:
https://gitorious.org/te4
The nightly build from here:
http://www.sendspace.com/file/81dlsx
And the dlls from 42a.
Thanks to Darkgod and _Graziel for setting me straight on IRC.
Happy animating!
Re: Tile animations/bumps
Posted: Mon Sep 17, 2012 5:32 pm
by chezzo
After four frames (256px), I couldn't get anything to work until 16 frames (1024px). The frames would be selected off center, so the animation would slide around like looking at someone on a merry-go-round. Sometimes there would even be pieces of words that were not even in the image.
This isn't a request for it to be fixed, just a heads up to future animators. If I can't do it in 4 frames I can totally do it in 16 frames.
I bet math has something to do with why it's not working, though. Those numbers are too pretty to be coincidental.
Re: Tile animations/bumps
Posted: Fri Nov 16, 2012 12:25 am
by Grey
Just got this running in my jam-based action RPG and it looks FANTASTIC! So, next challenge DG, should you choose to accept it: rotating sprites! As in you kill an enemy and it rotates and disappears. Or perhaps just does a twirl in a combat move.
Re: Tile animations/bumps
Posted: Fri Nov 16, 2012 1:11 am
by andar_b
Another use would be to use a single tile of, let's say, grass, and rotate it 90, 180, or 270 for a little more variation. If using a true overhead tileset, walls and doors could use one tile instead of several, as well.
Re: Tile animations/bumps
Posted: Mon Dec 10, 2012 6:23 pm
by tiger_eye
Just wondering... is it possible to select the start frame for animations?
Re: Tile animations/bumps
Posted: Tue Feb 05, 2013 5:10 pm
by chezzo
Yeah, rotation would be pretty cool! I can see a lot of applications for that.
I found some more information on how many frames you can use. You can use 2, 4, 8, 16, 32, and 64 frames. And probably all the other powers of two.