Package de.coreengine.system
Class PlayerGameObject
- java.lang.Object
-
- de.coreengine.system.GameObject
-
- de.coreengine.system.PlayerGameObject
-
public abstract class PlayerGameObject extends GameObject
Gameobject that can be spawned by a client- Author:
- Darius Dinger
-
-
Field Summary
-
Fields inherited from class de.coreengine.system.GameObject
parent
-
-
Constructor Summary
Constructors Constructor Description PlayerGameObject()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getPlayerName()
Getting the name of this player on the server.protected boolean
isControlled()
void
onDisconnect()
Getting called when player disconnectsvoid
onJoin()
Getting called, when player joinesvoid
setup(String playerName, boolean controlled)
Setup player controlled game object-
Methods inherited from class de.coreengine.system.GameObject
addActionToPhysicWorld, addChild, addRigidBodyToWorld, getScene, onAdd, onInit, onLoad, onPauseUpdate, onRemove, onRender, onSave, onSyncronize, onUpdate, removeChild, setShouldRender, setShouldSyncronize, setShouldUpdate
-
-
-
-
Method Detail
-
setup
public void setup(String playerName, boolean controlled)
Setup player controlled game object- Parameters:
playerName
- Name of the player who controls this objectcontrolled
- Is the game object controlled from this player
-
getPlayerName
protected String getPlayerName()
Getting the name of this player on the server. Use this as prefix for all syncronized objects and events in this gameobject!- Returns:
- Name of this player
-
onDisconnect
public void onDisconnect()
Getting called when player disconnects
-
onJoin
public void onJoin()
Getting called, when player joines
-
isControlled
protected boolean isControlled()
- Returns:
- Is the game object controlled by this player
-
-