Appstate

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
myraneal
Posts: 26
Joined: Tue Apr 08, 2008 8:00 pm

Appstate

Post by myraneal »

Hi there,
I only recently started using ZGameEditor and I have to say it's impressive. I went through all the tutorials, made some changes to the game made in Tut3 to learn a bit more. At one point I found out that I needed to check which Appstate the game was in and couldn't find the variable which would tell me that. I eventually had each state set a variable onLoad so that I could check later, but I'm wondering, is there any way to reach a native variable which would tell me what state the application is in?

Thanks,
Yilmaz
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Hi and welcome to these forums, Yilmaz!

You are correct there is no variable that can be tested for which appstate is currently active. This is a limitation to the expression system which only deals with numerical variables. The workaround is to set a variable in each appstate.onStart as you already found out. Also try to keep state-specific logic in that appstates onUpdate for minimizing the need for checking which state is active in other code.

Regards,

Ville
Post Reply