Space.add()
Posted: Tue Nov 27, 2012 12:47 pm
Hi, I started using recently DEPU,
i should use the command Space.Add() to add an item to the emulator,
Can I use it with lists in another part of the code? (like Update)
This does not work.. with no errors..
How can i create objects while playing?
i should use the command Space.Add() to add an item to the emulator,
Can I use it with lists in another part of the code? (like Update)
Code: Select all
List<Box> lBoxs = new List<Box>();
int i = 0;
public override void Update(float dt)
{
if (Game.KeyboardInput.IsKeyDown(Keys.Space))
{
lBoxs.Add(new Box(Game.Camera.Position, 1, 1, 1, 1));
lBoxs[i].Position = Game.Camera.Position;
lBoxs[i].LinearVelocity = new Vector3(10, 0, 0);
// ....
Space.Add(lBoxs[i]);
++i;
}
//...
How can i create objects while playing?