Exemplo n.º 1
0
 public void ShootEvent(string slot)
 {
     if (Root.Instance.IsAuthoritive)
     {
         Cube c = new Cube();
         Root.Instance.Scene.Spawn(c);
         c.Position = Position;
         c.Orientation = Orientation;
         c.Physics.Speed = Direction * 100;
     }
 }
Exemplo n.º 2
0
        public override void Start()
        {
            base.Start();

            for (int i = 0; i < 10; ++i)
            {
                Cube c = new Cube();
                Root.Instance.Scene.Spawn(c);
                c.Position = new Vector3(0, 10 + i * 2, 0);
                cubes.Add(c);
            }
            Root.Instance.Scene.Spawn(new Floor());

            Root.Instance.Scene.Spawn(light = new Light());
            light.Position = new Vector3(1, 1, 1);
            light.directional = true;
            light.diffuse = new Color4f(0.5f, 0.5f, 0.5f);
            Root.Instance.Scene.Spawn(light = new Light());
            light.Position = new Vector3(-20, 20, 20);
            light.diffuse = new Color4f(0.6f, 0, 0);
            Root.Instance.Scene.Spawn(light = new Light());
            light.Position = new Vector3(20, 20, -20);
            light.diffuse = new Color4f(0, 0.6f, 0);
            Root.Instance.Scene.Spawn(light = new Light());
            light.Position = new Vector3(-20, 20, -20);
            light.diffuse = new Color4f(0, 0, 0.6f);
        }