{"size": 557, "ext": "js", "max_stars_repo_path": "js/star.js", "max_stars_repo_name": "mahdineer/stars", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "js/star.js", "max_issues_repo_name": "mahdineer/stars", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "js/star.js", "max_forks_repo_name": "mahdineer/stars", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 19.2068965517, "max_line_length": 55, "alphanum_fraction": 0.4326750449}
class Star {
    constructor() {
        this.init()
    }

    init() {
        this.z = random(width)
        this.x = random(-width, width)
        this.y = random(-height, height)
    }

    update() {
        this.z -= 5
        if (this.z < 1) {
            this.init()
        }
    }

    show() {
        fill(255, 140, 46)
        noStroke()

        this.sx = map(this.x / this.z, 0, 1, 0, width)
        this.sy = map(this.y / this.z, 0, 1, 0, height)

        let r = map(this.z, 0, width, 12, 0)
        ellipse(this.sx, this.sy, r, r)
    }
}