simpleUpdate

I have no idea what exactly how to ask the question. It is like this:

In one class Poker I do different things:

[java] mPokerCards.shuffleCards();

getCards();

mCardsInHand.showCards(mPlayerCards);

changeCards();

[/java]

when it goes to the third function it starts the visual part and shows the cards. Here it goes into a loop ( the simpleUpdate) and I don’t know how to make it pass to the next function( changeCards), and the visual to still remain on the screen.

I don’t know if I made myself clear, I’m really sorry about this.

Thanks

then your showCards is bugged then :

  1. do you use nifty to show them or create nodes for each card?

I create nodes for each card

I have something like this:



[java]public class GUIDisplay extends SimpleApplication implements Display

{

public void holdCards(Vector<Short> cardsHold) {

}

public void showCards(Vector<Card> playerCards) {

start();

}

public void showWin(int result, int totalMoney) {

}

public int gameOver(int totalMoney) {

return 1;

}

[/java]

after this I have the simpleInitApp and the simpleUpdate in which I show the cards. After it show the cards I want it to finish with the showCards and continue but I want it to still be on the screen. I am 100% certain that I do not know something or I am doing something wrong but I don’t know what. Probably I don’t understand it quite ok how everything is working

Thanks in advance

your code is wrong, classic mistake you put your code in “main”.

After SimpleApplication.start(); you cannot call any java command from “main” afterwords. Because jme method “start()” does infitive_loop (and lasts forever).

You have 2 solutions :

  1. put your logic / code in simpleInit();
  2. put your logic / code in simpleUpdate();

ok and how do I put in simpleInit/simpleUpdate about 10 .java files :)) it’s a bit more complex.

I did 2 displays …

  1. the consoleDisplay that implements the interface Display - it’s already done and it works ok
  2. the GUIDisplay and this is the one that I want to implement right now and by doing so I will just modify some small code from my initial program.

    Can you pls give me some ideas?
ok and how do I put in simpleInit/simpleUpdate about 10 .java files

1) You must have only one class than extends SimpleApplication. You can call methods of other classes from this simple Application class.
2) http://hub.jmonkeyengine.org/groups/general-2/forum/topic/loading-spatials-from-an-outside-class/
another person had a similar problem, he didnt know how to call methods from another class. So this may help you.
3) About consoleDisplay / GuiDisplay you did it in nifty ? then fromXml should take care things alone.

What you want to do is use AppStates and Controls instead.

thanks for the answers I will look into it and see what needs to be done :slight_smile: have a lot to learn about it