// Copyright (c) 2014 Alex Diener. All rights reserved. #ifndef __GameplayScreen_H__ #define __GameplayScreen_H__ #ifdef __cplusplus extern "C" { #endif typedef struct GameplayScreen GameplayScreen; #include "inputcontroller/InputController.h" #include "screenmanager/Screen.h" #include "utilities/FixedIntervalRunLoop.h" #include "watertowerclassic/GameplayView.h" #include "watertowerclassic/GameSession.h" #include "watertowerclassic/LevelSetModel.h" #include "watertowerclassic/PlayerModel.h" enum GameState { GAME_STATE_STARTING_LEVEL, GAME_STATE_PLAYING, GAME_STATE_DYING, GAME_STATE_FINISHED_LEVEL, GAME_STATE_LEVEL_TRANSITION }; #define GameplayScreen_structContents(self_type) \ Screen_structContents(self_type) \ \ GameplayView * view; \ GameSession * gameSession; \ LevelSetModel * levelSet; \ FixedIntervalRunLoop * runLoop; \ InputController * inputController; \ LevelModel * currentLevel; \ PlayerModel * playerModel; \ unsigned int levelIndex; \ unsigned int timerID; \ double lastDrawTime; \ bool backgrounded; \ bool paused; \ unsigned int menuItemIndex; \ unsigned int frameIndex; \ unsigned int deathFramesRemaining; \ unsigned int levelTransitionFramesRemaining; \ enum GameState gameState; \ GLuint vertexBufferID; \ GLuint indexBufferID; \ GLBitmapFont * bitmapFont; stemobject_struct_definition(GameplayScreen) GameplayScreen * GameplayScreen_create(GameSession * gameSession); bool GameplayScreen_init(GameplayScreen * self, GameSession * gameSession); void GameplayScreen_dispose(GameplayScreen * self); void GameplayScreen_activate(GameplayScreen * self); void GameplayScreen_deactivate(GameplayScreen * self); #ifdef __cplusplus } #endif #endif