CreateNew
Introduction
Code Example
Enemy newEnemy = EnemyFactory.CreateNew();
newEnemy.X = 4;
newEnemy.Y = 3;
// newEnemy can be used in any other valid Entity codeCode Example: Conditionally Creating Entities
if(InputManager.Keyboard.KeyPused(Keys.Space))
{
var bullet = Factories.BulletFactory.CreateNew();
bullet.X = Player.X;
bullet.Y = Player.Y;
bullet.XVelocity = 100;
}Passing a Layer
Passing a Layer in Screen custom code
Passing a Layer in an Entity
You must first initialize the factory to use it
Last updated
Was this helpful?