mspraggs / potentia

Southampton Game Jam 2015
0 stars 0 forks source link

Spritesheeting Change #23

Closed DivFord closed 9 years ago

DivFord commented 9 years ago

Can we set up sprite sheets so that instead of passing an x and a y coordinate, we pass a base vector and an offset? So Rock would have a base of of (0,0) and could be offset horizontally and vertically.

That would allow me to use space more efficiently in my textures, reducing file size, and would help with implementing internal corners.

Fyll commented 9 years ago

Hmm. The way it's currenbtly set up, the sprite is based on an Vector for the top left point on the sheet, a Vector for the dimensions fo the sprite, and a number of frames to animate around. Consequently, there's nothing wrong with you putting two different sprite sets on the same line (although PropList will have to change a little).

DivFord commented 9 years ago

What about putting one sprite set across multiple lines?

Fyll commented 9 years ago

Fair enough, that wouldn't work. Still, a lot's getting re-done, so I'll bear it in mind when I get to that bit.

DivFord commented 9 years ago

When you do get to that, would it be worth adding an animation class to bind animation names to offsets? So you could call Anim(PLAYER_WALK_1) rather than manually specifying the offset.

Fyll commented 9 years ago

An enum? I don't see why not. I tend not to when the values are used only in one function, but could see my way to doing it if it'll help.

DivFord commented 9 years ago

Maybe. Though it might work better as a constant definition for a vector. Depends how we decide to organise sprites.

Fyll commented 9 years ago

Update: Everything should now be using SpritesheetMaps. The two upsides that I see to this are that anything can be animated now (passively, or when moving between states), and that everything uses the one system.

I'm going to optimistically close this. crosses fingers