Card flipping effect

spinnerbox

  • Posts: 166
How would you program a card flipping effect from the front side to the back and vice versa?

For example memory game has this effect with its cards.

Or should I use two actors and scale them by X axis accordingly?
(Top shrinks and bottom widens up and vice versa)

Is there some elegant way?

bonechill

  • *
  • Posts: 271
How would you program a card flipping effect from the front side to the back and vice versa?

For example memory game has this effect with its cards.

Or should I use two actors and scale them by X axis accordingly?
(Top shrinks and bottom widens up and vice versa)

Is there some elegant way?

Use an animation of a card flipping
Play Gold Hunter on Kongregate, Newgrounds, or Stencyl Arcade

The8BitMan

  • Posts: 424
How would you program a card flipping effect from the front side to the back and vice versa?

For example memory game has this effect with its cards.

Or should I use two actors and scale them by X axis accordingly?
(Top shrinks and bottom widens up and vice versa)

Is there some elegant way?

Use an animation of a card flipping

Sounds like a good idea but it would be more efficient using tweens as originally suggested to do this. It depends which way suits you best. If you want the tweening method and want it to look really accurate, just say so and I'll work out the maths for it or you could just make it change it by a constant value.
Need music, graphics, scripts? Just ask!

spinnerbox

  • Posts: 166
Not sure which to choose. I plan to add about 20 flip cards which seems alot in bytes even if I make them in one big spritesheet. I just tested with one card and it has 9 images into the animation to flip from front to back. And I don't know how to stop the animation from the start. I need the card to be clickable so when clicked the card flips like in a memory game.

Even if I go with animations there is lot of work in editing the images. I managed to create spritesheet of my first card and somehow stencyl cuts of the edges of the last frame in the animation. So I had to edit the frame with pencyl


bonechill

  • *
  • Posts: 271
Ok guys got it. I think with animations is better. I will keep track of the file size though
Glad to help
Play Gold Hunter on Kongregate, Newgrounds, or Stencyl Arcade