Example #1
0
    public Player()
    {
        visual = Resources.Load <Texture2D>("pacman");

        Circle        = new Circle();
        Circle.Radius = visual.width * .5f;

        pixel = new Texture2D(1, 1, TextureFormat.RGBA32, false);
        pixel.SetPixel(0, 0, Color.white);
        pixel.Apply();

        Position = new Vector2(Screen.width * .5f - visual.width * .5f, Screen.height * .5f - visual.height * .5f);

        rigidbody = new Rigidbody {
            mass            = 1.0f,
            force           = 150.0f,
            dragCoefficient = .47f
        };
    }
Example #2
0
    public Player()
    {
        visual = Resources.Load <Texture2D>("pacman");

        Circle        = new DevMath.Circle();
        Circle.Radius = visual.width * .5f;

        pixel = new Texture2D(1, 1, TextureFormat.RGBA32, false);
        pixel.SetPixel(0, 0, Color.white);
        pixel.Apply();

        Position = new DevMath.Vector2(Screen.width * .5f - visual.width * .5f, Screen.height * .5f - visual.height * .5f);

        rigidbody = new DevMath.Rigidbody()
        {
            mass = 1.0f,
            frictionCoefficient = .4f,
            normalForce         = 9.81f
        };
    }