示例#1
0
    void init()
    {
        // Disable gravity for ball
        Physics2D.gravity = Vector2.zero;

        // 2d physics material so the ball bounces on collisions
        PhysicsMaterial2D bouncePhysicsMaterial = new PhysicsMaterial2D();

        bouncePhysicsMaterial.bounciness = 1;
        bouncePhysicsMaterial.friction   = 0;

        // Create all the objects for the game, use the _exposedData to initalise the values
        //_blocks = new Blocks(new Vector2(0, 3), (int)_exposedData.xCount.getValue(), (int)_exposedData.yCount.getValue(), bouncePhysicsMaterial);
        //_ball = new Ball(Vector2.zero, bouncePhysicsMaterial, _exposedData.color.getValue());
        // _paddle = new Paddle(new Vector2(0,-3.0f), bouncePhysicsMaterial);
        Boarders.make(bouncePhysicsMaterial);

        _started = true;
    }
示例#2
0
 public void Update()
 {
     Boarders.Save();
     CurrState();
 }