Author Topic: beginner q - how to change states?  (Read 2280 times)

mirzahat

  • New Member
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
beginner q - how to change states?
« on: Mon, Oct 31, 2011 »
HI

so when I init a state with flixel, how do I switch between states in iOs?

Regards,
Mirza

initials

  • Contributor
  • ****
  • Posts: 378
  • Karma: +0/-0
  • Initials
    • View Profile
    • Initials Blog. Code and other things.
Re: beginner q - how to change states?
« Reply #1 on: Mon, Oct 31, 2011 »
Code: [Select]
  FlxG.state = [[[PlayState alloc] init] autorelease];
return;

If you don't return after calling it can cause crashed. Best to do it after [super update];
« Last Edit: Mon, Dec 12, 2011 by initials »
Initials: Super Lemonade Factory, Super Lemonade Factory Part Two, Above The Clouds, Revvolvver, Four Chambers of the Human Heart