Exemplo n.º 1
0
 public Scene(string name)
 {
     _name = name;
     _root = new DrawNode();
     _eventManager = new EventManager();
     //Add the default event;
     _eventManager.AddEventType(new EventController(Constants.TIME_TICKS_EVENT));
 }
Exemplo n.º 2
0
 public World(Vector2 gravity, EventManager eventManager)
     : base(Constants.TIME_TICKS_EVENT)
 {
     _world = new Box2D.XNA.World(gravity, true);
     _world.ContactListener = new ContactListener();
     _timeStep = Variables.TargetFrameMilliseconds/1000.0f;
     _eventManager = eventManager;
 }
Exemplo n.º 3
0
        public DrawUnit(Sprite sprite, Body body, World world)
            : base(body, world)
        {
            _sprite = sprite;
            _eventManager = world.EventManager;

            _listener = new EventListener(Constants.TIME_TICKS_EVENT);
            _listener.Handler = e => Update();
            _eventManager.Register(_listener);
        }