AppController class
The AppController is the main controller of the app. It contains all the listeners for the buttons, can make the views switch and can call the load method of the LevelController for starting a level.
Constructors
Properties
- gyroAvailable ↔ bool
-
Is the gyro sensor retrieval available
read / write
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
getHighscore(
int level) → int - Returns the level specific highscore.
-
getReachedLevel(
) → int -
Returns the
_reachedLevel
-
listenAllLevelButtons(
int reachedLevel) → void -
Listens for all the 'level buttons' click events,
sets the new
_activeLevel
accordingly and shows the 'levelOverview'. -
listenChooseLevelButton(
) → void - Listens to the 'choose level button' click events and shows the 'chooseLevelsView'
-
listenCreditsButton(
) → void - Listens for the 'credits button' click events and shows the credits view
-
listenDonateButton(
) → void - Listens to the 'donate button' click events and opens a new window directing to paypal
-
listenGoToMenuButton(
) → void - Listens to the 'Go To Menu Button' which directs the user to the main menu page 'Level Overview'
-
listenGoToMenuButtonAndRequestFullscreen(
) → void - Listens to the 'Go To Menu Button' which directs the user to the main page and requests the fullscreen on the mobile device. Will be called only if the 'messageWelcomeScreenOnMobile' was called before.
-
listenNextLevelButton(
) → void -
Listens to the 'next level button' click events, increases the
_activeLevel
and redirects the user to the 'levelOverview' if the new level is available. -
listenPreviousLevelButton(
) → void -
Listens to the 'go to previous level button' click events and decreases the
_activeLevel
. This method will only be called when the 'messageNoSuchLevel' was shown. -
listenStartLevelButton(
) → void -
Listens to the 'start level button' click events and starts the next level
according to
_activeLevel
-
setActiveLevel(
int activeLevel) → void -
Sets the
_activeLevel
to the passed integer value. If this value is bigger than the_reachedLevel
then the reached level will be increased accordingly. -
setReachedLevel(
int reachedLevel) → void -
Sets the
_reachedLevel
member variable and the according value in the local storage. -
showChooseLevelsView(
int nrAvailableLevels, int reachedLevel) → void - Shows the 'ChooseLevelsView' and activates the button click listener for listenGoToMenuButton listenAllLevelButtons
-
showCreditsView(
) → void - Shows the 'CreditsView' and activates the button click listener for listenGoToMenuButton listenDonateButton
-
showLevelOverview(
) → void - Shows the 'levelOverview' and activates the button click listener for listenStartLevelButton listenChooseLevelButton listenCreditsButton
-
showMessageLoose(
bool timeout) → void - Shows the 'MessageLoose' and activates the button click listener for listenGoToMenuButton
-
showMessageNoSupportForGyro(
) → void - Shows the 'MessageNoSupportForGyro' on desktop devices and activates the button click listener for listenGoToMenuButton
-
showMessageWin(
int score, bool newHighscore, int tries) → void - Shows the 'MessageWin' and activates the button click listener for listenNextLevelButton
-
showNoSuchLevel(
int level) → void - Shows the 'NoSuchLevelView' and activates the button click listener for listenPreviousLevelButton
-
showWelcomeScreenOnMobileDevices(
) → void - Shows the 'WelcomeScreenOnMobileDevices' and activates the button click listener for listenGoToMenuButtonAndRequestFullscreen
-
startNextLevel(
) → void -
Starts the
_activeLevel
-
startup(
) → void - This method initialises the app at startup
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited
Constants
- framerate → const int
-
The Target Framerate of the application in hz
40
- highscoreLevelKey → const String
-
The 'highscore for level x' key for the local storage.
Using this key alone is not sufficient.
You have to append a String with the level number.
"highscore_level_"
- triesLevelKey → const String
-
The 'number of tries for level x' key for the local storage.
Using this key alone is not sufficient.
You have to append a String with the level number.
"tries_level_"