Created
February 26, 2023 21:11
-
-
Save OMAR-3OOV/76bdb90f364cf93eba0b96d15d64cf3a to your computer and use it in GitHub Desktop.
Draw a heart under player but it won't rotate
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
fun drawHeart(player: Player) { | |
val loc = player.location.add(0.0, -1.0, 0.0) | |
val radius = 0.1 | |
val particleType = Particle.REDSTONE | |
val step = Math.PI / 32 | |
for (i in 0..63) { | |
val theta = i * step | |
val x = radius * (16 * sin(theta).pow(3)) | |
val z = radius * (13 * cos(theta) - 5 * cos(2 * theta) - 2 * cos(3 * theta) - cos(4 * theta)) | |
loc.add(x, 0.0, z) | |
player.spawnParticle(particleType, loc, 0, Particle.DustOptions(Color.RED, 1f)) | |
loc.subtract(x, 0.0, z) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment