card.cpp 449 B

123456789101112131415161718192021222324252627
  1. #include "card.h"
  2. #include <stdio.h>
  3. #include <GL/glut.h>
  4. //Init card to null
  5. Card *Card::card = NULL;
  6. //Constructor
  7. Card::Card():anim(20)
  8. {
  9. //Start animation from MAX to 0
  10. anim.startFromEnd();
  11. }
  12. //Drawing
  13. void Card::draw()
  14. {
  15. //Animation is running
  16. if (anim.isRunning())
  17. {
  18. //Move card based on animation
  19. float offset = anim.interpolate(150.0f);
  20. //glTranslatef(-offset, offset, -offset *2.5f);
  21. glTranslatef(0.0f, 0.0f, -offset);
  22. }
  23. }