public Atom(Symbol symbol, Vector2 position, GameContent gameContent, World world) { this.gameContent = gameContent; this.world = world; if (symbol == Symbol.Ra) eye = EyeState.Angry; this.symbol = symbol; this.symbolStr = symbol.ToString(); symbolCenter = gameContent.symbolFont.MeasureString(this.symbolStr); symbolCenter.X *= 0.5f; symbolCenter.Y *= 0.92f; bondsLeft = (int)symbol; BodyDef bd = new BodyDef(); bd.type = BodyType.Dynamic; bd.position = this.position = position / gameContent.b2Scale; bd.bullet = true; body = world.CreateBody(bd); body.SetUserData(this); CircleShape cs = new CircleShape(); cs._radius = gameContent.atomRadius / gameContent.b2Scale; FixtureDef fd = new FixtureDef(); fd.shape = cs; fd.restitution = 0.2f; fd.friction = 0.5f; fixture = body.CreateFixture(fd); electroShockAnimation = new Animation(gameContent.electroShock, 3, 0.1f, true, new Vector2(0.5f, 0.5f)); radiationSmoke = new RadiationSmoke(gameContent, this); // Collide only with Ground but not with itself and bonded Filter mouseFilter = new Filter(); mouseFilter.categoryBits = 0x0002; mouseFilter.maskBits = 0x0001; mouseFilter.groupIndex = -2; // Collide with every thing atomFilter = new Filter(); atomFilter.categoryBits = 0x0001; atomFilter.maskBits = 0x0001; atomFilter.groupIndex = 1; fixture.SetFilterData(ref atomFilter); SetMode(false, false); }