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"; }
/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (ComatoseGame game = new ComatoseGame()) { game.Run(); } }
public TextBox(ComatoseGame gm) : base(gm) { sprite_font = game.Content.Load <SpriteFont>("art/fonts/segoeprint"); chatter = game.Content.Load <SoundEffect>("sounds/chatter"); layer = "ui"; }
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"; }
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(); } }
public LuaCommand(ComatoseGame gm) { this.game = gm; }
public AI(ComatoseGame gm) : base(gm) { }
public Map(ComatoseGame gm) : base(gm) { body.SetType(BodyType.Static); }
public ContactListener(ComatoseGame game, Lua vm) { this.game = game; this.vm = vm; }
public GameObject(ComatoseGame gm) { game = gm; id = next_id++; game.vm["object_to_bind"] = this; }
public Audio(ComatoseGame gm) : base(gm) { listener = new AudioListener(); emitter = new AudioEmitter(); }
public Input(ComatoseGame game) { this.game = game; }
public Effects(ComatoseGame root) { game = root; }
public Waypoint(ComatoseGame gm) : base(gm) { }
public cDebugDraw(ComatoseGame gm) { game = gm; }