Created
January 4, 2014 08:15
-
-
Save Kolesias123/8252982 to your computer and use it in GitHub Desktop.
Ejemplo de creación de entidades en InixEngine.
This file contains hidden or 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
// Creamos una entidad con físicas en las coordenadas 0,0 | |
PhysicsEntity pBox = new PhysicsEntity( 0.0, 0.0 ); | |
pBox.Spawn(); // Spawn! | |
pBox.SetSprite("assets/entities/box.png"); // Imagen | |
pBox.SetSize( 50.0, 50.0 ); // Tamaño | |
pBox.MyPhysics.SetDensity( 0.05 ); // Densidad | |
pBox.MyPhysics.SetRestitution( 0.5 ); // Restitución | |
// Resultado en el cliente: | |
// Una caja con la imagen "assets/entities/box.png" cayendo hasta el suelo (definido en otra parte). | |
// Dependiendo de la masa, densidad, etc... la caja podría rebotar al caer al suelo. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment