Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wanted my character's life to be the same as the other game state. My other game state is different the from my original state. I wanted to link my int to my new game state to make it the same. How do I link an integer?

share|improve this question

closed as not a real question by Jari Komppa, doppelgreener, michael.bartnett, Byte56, Josh Petrie Oct 16 '12 at 16:05

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Code sample? Give us something to work with, it'll help you get the answers you want. – Byte56 Sep 26 '12 at 14:32
It sounds like what you're asking is essentially how to pass data between states. One way to solve this is to create a Player object containing the int that each state has a reference to. – extropic-engine Oct 7 '12 at 20:32

If you're using FX you could try using a SimpleIntegerProperty and then bind that to another one. This will cause any change in one to reflect a change in the other. It works well for counting how many frames have been run in my game. My engine class has an int bound to an int in my ui class and it works well.

Does that sound like what you're trying to achieve?

share|improve this answer

You link to the other game state object, not to the integer directly. Then just return;

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.