Last active
August 29, 2015 14:08
-
-
Save Kolesias123/c9ed897b608477f31d4d to your computer and use it in GitHub Desktop.
Entidad con físicas en Servidor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyEntity extends PhysicsEntity | |
{ | |
int m_iPings = 0; | |
int m_iThinks = 0; | |
// Esta función es llamada cada que se quiera enviar la entidad a los clientes | |
void prepareDatatable() | |
{ | |
myTable.add( "Pings", m_iPings ); | |
super.prepareDatatable(); | |
} | |
void think() | |
{ | |
super.think(); | |
// Agregamos un ping | |
if ( m_iThinks % 100 == 0 ) | |
addPing(); | |
// Imprimos un mensaje en la consola | |
++m_iThinks; | |
Msg("[Servidor] ¡He pensado $m_iThinks veces!"); | |
} | |
void addPing() | |
{ | |
++m_iPings; | |
// TODO | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment