TopDown Engine v4.5
Loading...
Searching...
No Matches
MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager Class Reference

An example class of how you can extend the MultiplayerLevelManager to implement your own specific rules. This one's rules are as follows : More...

Inheritance diagram for MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager:
MoreMountains.TopDownEngine.MultiplayerLevelManager MoreMountains.Tools.MMEventListener< T > MoreMountains.TopDownEngine.LevelManager MoreMountains.Tools.MMEventListenerBase MoreMountains.Tools.MMSingleton< T > MoreMountains.Tools.MMEventListener< T > MoreMountains.Tools.MMEventListenerBase

Classes

struct  GrasslandPoints
 A struct used to store points for each player. More...

Public Member Functions

virtual void Update ()
 On update, we update our countdowns and check for input if we're in game over state.
virtual void OnMMEvent (PickableItemEvent pickEvent)
 When a coin gets picked, we increase the amount of points of the character who picked it.
Public Member Functions inherited from MoreMountains.TopDownEngine.MultiplayerLevelManager
override void PlayerDead (Character playerCharacter)
 Kills the specified player.
Public Member Functions inherited from MoreMountains.TopDownEngine.LevelManager
virtual void GotoLevel (string levelName)
 Gets the player to the specified level.
virtual void TriggerEndLevelEvents ()
 Triggers end of level events.
virtual void ToggleCharacterPause ()
 Toggles Character Pause.
virtual void FreezeCharacters ()
 Freezes the character(s)
virtual void UnFreezeCharacters ()
 Unfreezes the character(s)
virtual void SetCurrentCheckpoint (CheckPoint newCheckPoint)
 Sets the current checkpoint with the one set in parameter. This checkpoint will be saved and used should the player die.
virtual void OnMMEvent (TopDownEngineEvent engineEvent)
 Catches TopDownEngineEvents and acts on them, playing the corresponding sounds.
Public Member Functions inherited from MoreMountains.Tools.MMEventListener< T >
void OnMMEvent (T eventType)

Public Attributes

GrasslandPoints[] Points
 An array to store each player's points.
List< MMCountdown > Countdowns
 the list of countdowns we need to update
int GameDuration = 99
 the duration of the game, in seconds
Public Attributes inherited from MoreMountains.TopDownEngine.MultiplayerLevelManager
List< CheckPointSpawnPoints
 the list of checkpoints (in order) to use to spawn characters
CameraModes CameraMode = CameraModes.Split
 the selected camera mode (either group, all targets in one screen, or split screen)
GameObject GroupCameraRig
 the group camera rig
GameObject SplitCameraRig
 the split camera rig
MultiplayerGUIManager MPGUIManager
 the multiplayer GUI Manager
Public Attributes inherited from MoreMountains.TopDownEngine.LevelManager
bool AutoAttributePlayerIDs = true
 the prefab you want for your player
Character[] PlayerPrefabs
 the list of player prefabs to instantiate
List< CharacterSceneCharacters
 a list of Characters already present in the scene before runtime. If this list is filled, PlayerPrefabs will be ignored
CheckPoint InitialSpawnPoint
 the checkpoint to use as initial spawn point if no point of entry is specified
CheckPoint CurrentCheckpoint
 the currently active checkpoint (the last checkpoint passed by the player)
Transform[] PointsOfEntry
 A list of this level's points of entry, which can be used from other levels as initial targets.
float IntroFadeDuration =1f
 duration of the initial fade in (in seconds)
float SpawnDelay = 0f
float OutroFadeDuration =1f
 duration of the fade to black at the end of the level (in seconds)
int FaderID = 0
 the ID to use when triggering the event (should match the ID on the fader you want to use)
MMTweenType FadeCurve = new MMTweenType(MMTween.MMTweenCurve.EaseInOutCubic)
 the curve to use for in and out fades
float RespawnDelay = 2f
 duration between a death of the main character and its respawn
float DelayBeforeDeathScreen = 1f
 the delay, in seconds, before displaying the death screen once the player is dead
bool UseLevelBounds = true
 if this is true, this level will use the level bounds defined on this LevelManager. Set it to false when using the Rooms system.
MMLoadScene.LoadingSceneModes LoadingSceneMode = MMLoadScene.LoadingSceneModes.MMSceneLoadingManager
 the method to use to load the destination level
string LoadingSceneName = "LoadingScreen"
 the name of the MMSceneLoadingManager scene you want to use
MMAdditiveSceneLoadingManagerSettings AdditiveLoadingSettings
 the settings to use when loading the scene in additive mode
bool SetPlayerAsFeedbackRangeCenter = false
 if this is true, an event will be triggered on player instantiation to set the range target of all feedbacks to it

Protected Member Functions

override void Initialization ()
 On init, we initialize our points and countdowns.
override void OnPlayerDeath (Character playerCharacter)
 Whenever a player dies, we check if we only have one left alive, in which case we trigger our game over routine.
virtual IEnumerator GameOver ()
 On game over, freezes time and displays the game over screen.
virtual void UpdateCountdown ()
 For each countdown, updates the remaining time.
virtual void CheckForGameOver ()
 If we're in game over state, checks for input and restarts the game if needed.
override void OnEnable ()
 Starts listening for pickable item events.
override void OnDisable ()
 Stops listening for pickable item events.
Protected Member Functions inherited from MoreMountains.TopDownEngine.MultiplayerLevelManager
override void Awake ()
 On awake we handle our different camera modes.
virtual void HandleCameraModes ()
 Sets up the scene to match the selected camera mode.
override void SpawnMultipleCharacters ()
 Spawns all characters at the specified spawn points.
Protected Member Functions inherited from MoreMountains.TopDownEngine.LevelManager
virtual void Start ()
 On Start we grab our dependencies and initialize spawn.
virtual IEnumerator InitializationCoroutine ()
virtual void InstantiatePlayableCharacters ()
 Instantiate playable characters based on the ones specified in the PlayerPrefabs list in the LevelManager's inspector.
virtual void CheckpointAssignment ()
 Assigns all respawnable objects in the scene to their checkpoint.
virtual void SpawnSingleCharacter ()
 Spawns a playable character into the scene.
virtual IEnumerator GotoLevelCo (string levelName)
 Waits for a short time and then loads the specified level.
virtual IEnumerator PlayerDeadCo ()
 Triggers the death screen display after a short delay.
virtual void Respawn ()
 Initiates the respawn.
virtual IEnumerator SoloModeRestart ()
 Coroutine that kills the player, stops the camera, resets the points.
Protected Member Functions inherited from MoreMountains.Tools.MMSingleton< T >
virtual void InitializeSingleton ()
 Initializes the singleton.

Protected Attributes

string _playerID
bool _gameOver = false
Protected Attributes inherited from MoreMountains.TopDownEngine.LevelManager
DateTime _started
int _savedPoints
Collider _collider
Collider2D _collider2D
Vector3 _initialSpawnPointPosition

Properties

virtual string WinnerID [get, set]
 the ID of the winner
Properties inherited from MoreMountains.TopDownEngine.LevelManager
virtual Bounds LevelBounds [get]
 the level limits, camera and player won't go beyond this point.
virtual Collider BoundsCollider [get, protected set]
virtual Collider2D BoundsCollider2D [get, protected set]
virtual TimeSpan RunningTime [get]
 the elapsed time since the start of the level
virtual List< CheckPointCheckpoints [get, protected set]
virtual List< CharacterPlayers [get, protected set]
Properties inherited from MoreMountains.Tools.MMSingleton< T >
static bool HasInstance [get]
static T Current [get]
static T Instance [get]
 Singleton design pattern.

Additional Inherited Members

Public Types inherited from MoreMountains.TopDownEngine.MultiplayerLevelManager
enum  CameraModes { Split , Group }
 the types of cameras to choose from More...
Static Public Member Functions inherited from MoreMountains.Tools.MMSingleton< T >
static T TryGetInstance ()
Static Protected Member Functions inherited from MoreMountains.TopDownEngine.LevelManager
static void InitializeStatics ()
 Statics initialization to support enter play modes.
Static Protected Attributes inherited from MoreMountains.Tools.MMSingleton< T >
static T _instance

Detailed Description

An example class of how you can extend the MultiplayerLevelManager to implement your own specific rules. This one's rules are as follows :

  • player can grab coins, one coin = one point
  • after X seconds, the game stops and whoever got the most coins wins
  • if all players (but one) are dead, the game stops and whoever got the most coins wins
  • at the end of the game, a Winner screen is displayed and tapping Jump anywhere restarts the game

Member Function Documentation

◆ CheckForGameOver()

virtual void MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager.CheckForGameOver ( )
protectedvirtual

If we're in game over state, checks for input and restarts the game if needed.

◆ GameOver()

virtual IEnumerator MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager.GameOver ( )
protectedvirtual

On game over, freezes time and displays the game over screen.

Returns

◆ Initialization()

override void MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager.Initialization ( )
protectedvirtual

On init, we initialize our points and countdowns.

Reimplemented from MoreMountains.TopDownEngine.LevelManager.

◆ OnDisable()

override void MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager.OnDisable ( )
protectedvirtual

Stops listening for pickable item events.

Reimplemented from MoreMountains.TopDownEngine.LevelManager.

◆ OnEnable()

override void MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager.OnEnable ( )
protectedvirtual

Starts listening for pickable item events.

Reimplemented from MoreMountains.TopDownEngine.LevelManager.

◆ OnMMEvent()

virtual void MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager.OnMMEvent ( PickableItemEvent pickEvent)
virtual

When a coin gets picked, we increase the amount of points of the character who picked it.

Parameters
pickEvent

◆ OnPlayerDeath()

override void MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager.OnPlayerDeath ( Character playerCharacter)
protectedvirtual

Whenever a player dies, we check if we only have one left alive, in which case we trigger our game over routine.

Parameters
playerCharacter

Reimplemented from MoreMountains.TopDownEngine.MultiplayerLevelManager.

◆ Update()

virtual void MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager.Update ( )
virtual

On update, we update our countdowns and check for input if we're in game over state.

◆ UpdateCountdown()

virtual void MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager.UpdateCountdown ( )
protectedvirtual

For each countdown, updates the remaining time.

Member Data Documentation

◆ _gameOver

bool MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager._gameOver = false
protected

◆ _playerID

string MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager._playerID
protected

◆ Countdowns

List<MMCountdown> MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager.Countdowns

the list of countdowns we need to update

◆ GameDuration

int MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager.GameDuration = 99

the duration of the game, in seconds

◆ Points

GrasslandPoints [] MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager.Points

An array to store each player's points.

Property Documentation

◆ WinnerID

virtual string MoreMountains.TopDownEngine.GrasslandsMultiplayerLevelManager.WinnerID
getset

the ID of the winner


The documentation for this class was generated from the following file: