Game State Help Please
micksolo
Member Posts: 264
Hi everyone, merry xmas and happy holidays to you all!
I'm running into some problems getting states working right.
It should be simple right?
I have an game attribute integer set to 1. press space bar and it should change to 2. Press space bar and it should change back to 1.
However when I run the game, press space bar the integer does not change from 1. I know this because I displayed the game integer on screen.
Here's what I set in the player actor.
http://img692.imageshack.us/img692/8881/gamestateprob.png]
Funny thing is when i change the key for game state 2 to something else, it actually works. So it seems the problem is that it doesn't differentiate between using the same key.
Any help?
Thanks!
I'm running into some problems getting states working right.
It should be simple right?
I have an game attribute integer set to 1. press space bar and it should change to 2. Press space bar and it should change back to 1.
However when I run the game, press space bar the integer does not change from 1. I know this because I displayed the game integer on screen.
Here's what I set in the player actor.
http://img692.imageshack.us/img692/8881/gamestateprob.png]
Funny thing is when i change the key for game state 2 to something else, it actually works. So it seems the problem is that it doesn't differentiate between using the same key.
Any help?
Thanks!
Comments
use one rule to enclose both action
[Rule]
when spacebar is down
--[Rule] when game.Rotation = 2
----change game.Rotation To: 1
--Otherwise:
---[Rule] when game.Rotation = 1
-----change game.Rotation To: 2
that may help...
also if you only have the 2 states you should use a boolean type gameAttribute
unchecked/false for state1 and true for state2
MH
Basically i want this to happen
game starts = state 1
press space bar = state 2
press space bar = state 1
and so forth
right now i have to hold down space for it to stay in state 2.
pix
"state" is boolean
MH
When key 'space' is pressed:
Change Attribute: game.Rotation = game.Rotation%2+1