Working with sprites

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
randomNick
Prole
Posts: 6
Joined: Fri Aug 07, 2015 10:38 pm

Working with sprites

Post by randomNick »

Heya guys, for the first time i want to try and develope a 2D platform fight game.

For the code im using the AnAL library for the animation, but the issue im having is with the sprites.

For instance this animation Image

The width isnt the same for all the frames, so i was wondering how do people usually deal with this. Do u use any programs or do you work manually and create a new sprite sheet?
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Working with sprites

Post by Jasoco »

Well, either make the areas for each of the sprites the same size and move each image into the correct position, or add some x and y offset to the animation metadata to offset it correctly. It really depends on the game and the maximum size of the sprite overall when all frames are stacked on top of each other.

I don't know if AnAL allows for the offset so you might need to just make each quad the same size.
User avatar
Ulydev
Party member
Posts: 445
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: Working with sprites

Post by Ulydev »

I +1 this, That would be so awesome if we could actually specify each frame's dimensions :awesome:
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Working with sprites

Post by zorg »

Ulydev wrote:I +1 this, That would be so awesome if we could actually specify each frame's dimensions :awesome:
If you write your own solution, you can though. And if space is tight, you need all the "compression" you can get, ie. not waste pixels on empty space just for equal frame sizes. But if it isn't, then you might as well make them the same size.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Working with sprites

Post by Ref »

Not really what you want but just screwing around waiting for a fix for my messed up computer - a result of upgrading to Windows 10 (drivers overwritten).
Attachments
testSprite.love
(6.64 KiB) Downloaded 73 times
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Working with sprites

Post by davisdude »

*cough self-advertisement cough*
You could try out my animation library, which allows you to use different sized images, among other things. It's not really tested yet, so you might be better off with Kikito's anim8.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Working with sprites

Post by T-Bone »

If no existing library suits your needs, don't feel afraid to implement your own. It doesn't have to be difficult, and you get precisely the behaviour you want.
Post Reply

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot] and 1 guest