Lump Apps and My Assets
@Socks if you [dump] the floor functions, double check it on the device. I have made the experience, that my iOS devices will calculate more accurate than the GS Viewer.
@Socks Great find and very well described (as per usual). Also, I second what @slowcut wrote.
Cool Socks! I made something like this before. Here it the framerate depends on the speed the character has.
I also addressed this in my original post . . .► If your sequence isn't just numerals, but instead has an actual name (so basically an image sequence going Filename_0, Filename_1, Filename_2, Filename_3, Filename_4, Filename_5 . . . etc) then simply add it in like this:
Defining which frame the animation starts on is simple enough using an offset:(floor(( self.Time *30)+19)%25)This runs at 30 fps, it starts on frame 19 and the sequence/loop is 25 frames long.
I was just adding some bonus logic tips to yours from what I did with Battle Legend Infinity, Too Fat To Fly and some other games.
For example, if your character(actor) is running through the game, then gets hit by an ice ball . . . .
. . . you could animate him to get encased in ice. But if you don't know when that will happen, just using self.Time or game.Time will give you undesired results.
Also, please use mod(x,y) instead of %. % doesn't work everywhere and got replaced with mod, which does. Thanks.
@CodeMonkeyI see you say use Mod(x,y) a lot but I don't really understand how to use it . . . .
@CodeMonkey(floor(( self.Time *30)+19)%25)add Mod(x,y) version here..
@socks you are absolutely right, my mistake
took me a minute but this is what I got to work..floor(mod(( self.Time *30),145)+1).."-Untitled.png""145 frames and no Zero".
@SocksI tried it without floor and it want run, only works when I have floor in the math.
. . . .Timer(Every 1/self.FPS) --Change Attribute: self.Image = self.baseImage..self.Counter --Change Attribute: self.Counter = mod(self.Counter+self.MaxFrames+self.animationDirection,self.MaxFrames). . . .
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
@BBEnkYep, it seems to be because you have your numeral before the file name . . .SoUntitled-1Untitled-2Untitled-3Untitled-4. . . etc, doesn't need 'floor', whereas . . .1-Untitled2-Untitled3-Untitled4-Untitled. . . etc, does need floor.
@SocksUsing this method how to I get it to stop looping my animation?Constrain Image"Filename_"..floor( game.Time *60)%21
@SocksI removed the '%21' but then it displays a white box when the animation ends.