 # Displays a short informative message to the user.
 displayNotice = (msg) -> $(".nNotification").text(msg)
 
-noughts.Screen = me.ScreenObject.extend
-  onResetEvent: (urlBehavior) ->
-    debugger
+noughts.Screen = Object.extend
+  enterState: ->
     @onEnterState.apply(this, arguments)
 
-noughts.LoadingScreen = me.ScreenObject.extend
-  onResetEvent: ->
+noughts.LoadingScreen = noughts.Screen.extend
+  onEnterState: ->
     $(".nMain").children().hide()
     $(".nScreenLoading").show()
 

SPRITE_Z_INDEX = 2 # The Z-Index to add new sprites at

noughts.state =
  PLAY: me.state.PLAY
  INITIAL_PROMO: me.state.USER + 0 # Initial game description state
  NEW_GAME_MENU: me.state.USER + 1 # Game state for showing new game menu
  FACEBOOK_INVITE: me.state.USER + 2 # Game state for showing new game menu
  LOADING: me.state.USER + 3 # Game loading state

# Changes the current game state to 'newState'. The optional "urlBehavior"
# parameter shoud be a noughts.state.UrlBehavior, and the browser URL will be


# Loads the game with the specified ID
playGame = (gameId) ->
  noughts.state.changeState(noughts.state.PLAY,
      noughts.state.UrlBehavior.PUSH_URL, gameId)

# Pops up an alert to the user saying that an error has occurred. Should be used
# for un-recoverable errors.
