Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (748)
Games in Android Showcase (226)
games submitted by our members
Games in WIP (834)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Animation (Java/Swing)  (Read 2786 times)
0 Members and 1 Guest are viewing this topic.
Offline spruzzer

Junior Newbie

« Posted 2012-04-15 15:24:50 »

Hi to all! I'm spruzzer and this is the first time I post on this amazing Forum! Grin

I'm developing a card board game and now I've rescued difficulty in some animation tasks:

I display all my components (Card deck and user card subset) on a Jpanel.
In the class Card I wrote the draw method and animation method, which move a card from deck to user subset (shifted of 25px for each taken card).
I have no problem when I call(from the game board class) the move method from a mouse pressed event: I click on the user subset and i see the card moving to its destination (I have a timer that repaint the whole panel each 20ms). Now I want to write a method initGame() in the game board class that draw 2 cardsfor each users ut don't understand ho I can shw the animation (I'm only able to draw the complete set of 2 cards without the moving animation).

I hope that you have time to tell me the right way to solve this problem.

Offline Fokusas

Senior Devvie

Medals: 3
Projects: 1

« Reply #1 - Posted 2012-04-15 16:35:19 »

I suggest to show draw animation first and then draw complete set
Offline spruzzer

Junior Newbie

« Reply #2 - Posted 2012-04-28 10:27:20 »


I've added a boolean method isMoveFinished that return the moving status of the cards. In the initDeck method the status of all the cards that I want to show/animate is checked if a card is "isMoveFinished -> true" the next one is painted. (The control of the moving status and the moving method are called from the timer listener).
Pages: [1]
  ignore  |  Print  

xxMrPHDxx (316 views)
2017-12-31 17:17:51

xxMrPHDxx (97 views)
2017-12-31 17:15:51

xxMrPHDxx (148 views)
2017-12-28 18:11:33

Ecumene (320 views)
2017-09-30 02:57:34

theagentd (494 views)
2017-09-26 18:23:31

cybrmynd (531 views)
2017-08-02 12:28:51

cybrmynd (471 views)
2017-08-02 12:19:43

cybrmynd (449 views)
2017-08-02 12:18:09

Sralse (408 views)
2017-07-25 17:13:48

Archive (1314 views)
2017-04-27 17:45:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!