Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (767)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (854)
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 2954 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  

EgonOlsen (1259 views)
2018-06-10 19:43:48

EgonOlsen (1128 views)
2018-06-10 19:43:44

EgonOlsen (864 views)
2018-06-10 19:43:20

DesertCoockie (1273 views)
2018-05-13 18:23:11

nelsongames (1105 views)
2018-04-24 18:15:36

nelsongames (1336 views)
2018-04-24 18:14:32

ivj94 (2076 views)
2018-03-24 14:47:39

ivj94 (1229 views)
2018-03-24 14:46:31

ivj94 (2171 views)
2018-03-24 14:43:53

Solater (795 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 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!