-
-
Save AbhinavChauhan97/82699af18b932f3aa3f3c9d00ac19b6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun initPlanePath() { | |
planePath.reset() | |
var startX = randomX() | |
var startY = randomY() | |
repeat(3) { | |
planePath.moveTo(startX, startY) | |
val controlX = randomX() | |
val controlY = randomY() | |
val endX = randomX() | |
val endY = randomY() | |
planePath.quadTo(controlX, controlY, endX, endY) | |
startX = endX | |
startY = endY | |
} | |
} | |
//generate a random number between 0 and view width | |
private fun randomX() = random.nextInt(0, width).toFloat() | |
//generate a random number between 0 and view height | |
private fun randomY() = random.nextInt(0, height).toFloat() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment