Ejemplo n.º 1
0
        public LightSource(ComatoseGame gm)
            : base(gm)
        {
            //body.SetActive(false);
            buffer = new VertexBuffer(game.GraphicsDevice, typeof(VertexPositionColor), _max_rays * 3, BufferUsage.None);

            light_shader                    = new BasicEffect(game.GraphicsDevice);
            light_shader.Projection         = Matrix.CreateOrthographicOffCenter(0, 128, 72, 0, 1, -1);
            light_shader.VertexColorEnabled = true;

            //add a dummy physics object to the light, to allow it to do things
            body.SetType(BodyType.Dynamic);

            FixtureDef fdef = new FixtureDef();

            fdef.density  = 0.1f;
            fdef.friction = 0.0f;

            CircleShape circle = new CircleShape();

            circle._p      = new Vector2(0);
            circle._radius = (float)0.1f;
            fdef.shape     = circle;

            fixture = body.CreateFixture(fdef);
            body.ResetMassData();

            layer = "light";
        }
Ejemplo n.º 2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (ComatoseGame game = new ComatoseGame())
     {
         game.Run();
     }
 }
Ejemplo n.º 3
0
 public TextBox(ComatoseGame gm)
     : base(gm)
 {
     sprite_font = game.Content.Load <SpriteFont>("art/fonts/segoeprint");
     chatter     = game.Content.Load <SoundEffect>("sounds/chatter");
     layer       = "ui";
 }
Ejemplo n.º 4
0
        public PhysicsObject(ComatoseGame gm)
            : base(gm)
        {
            BodyDef def = new BodyDef();

            def.type     = BodyType.Dynamic;
            def.position = new Vector2(0.0f);
            body         = game.world.CreateBody(def);

            body.SetUserData(this);
            collision_group = "gameobject";
        }
Ejemplo n.º 5
0
        public ParticleManager(int capacity, Action <Particle> updateParticle, ComatoseGame root)
        {
            this.updateParticle = updateParticle;
            particleList        = new CircularParticleArray(capacity);

            game = root;
            // Populate the list with empty particle objects, for reuse
            for (int i = 0; i < capacity; i++)
            {
                particleList[i] = new Particle();
            }
        }
Ejemplo n.º 6
0
 public LuaCommand(ComatoseGame gm)
 {
     this.game = gm;
 }
Ejemplo n.º 7
0
 public AI(ComatoseGame gm)
     : base(gm)
 {
 }
Ejemplo n.º 8
0
 public Map(ComatoseGame gm) : base(gm)
 {
     body.SetType(BodyType.Static);
 }
Ejemplo n.º 9
0
 public ContactListener(ComatoseGame game, Lua vm)
 {
     this.game = game;
     this.vm   = vm;
 }
Ejemplo n.º 10
0
 public GameObject(ComatoseGame gm)
 {
     game = gm;
     id   = next_id++;
     game.vm["object_to_bind"] = this;
 }
Ejemplo n.º 11
0
 public Audio(ComatoseGame gm)
     : base(gm)
 {
     listener = new AudioListener();
     emitter  = new AudioEmitter();
 }
Ejemplo n.º 12
0
 public Input(ComatoseGame game)
 {
     this.game = game;
 }
Ejemplo n.º 13
0
 public Effects(ComatoseGame root)
 {
     game = root;
 }
Ejemplo n.º 14
0
 public Waypoint(ComatoseGame gm)
     : base(gm)
 {
 }
Ejemplo n.º 15
0
 public cDebugDraw(ComatoseGame gm)
 {
     game = gm;
 }