コード例 #1
0
    void pickLocation()
    {
        int cols = P5JSExtension.floor(P5JSExtension.width / scl);
        int rows = P5JSExtension.floor(P5JSExtension.height / scl);

        food = new Vector2(P5JSExtension.random(0, cols), P5JSExtension.random(0, rows));
        food.Scale(new Vector2(scl, scl));
    }