Created
December 1, 2016 12:54
-
-
Save AlexBezuska/67c96b6b89f64823ab1395c9f8b32777 to your computer and use it in GitHub Desktop.
prefab scattering system for SuperPowers-html5
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
class ScatterStars extends Sup.Behavior { | |
trees = []; | |
treeCount = 20; | |
start() { | |
for (var i = 0; i < this.treeCount; i++){ | |
Sup.appendScene("Plants")[0] | |
.arcadeBody2D.warpPosition(Sup.Math.Random.float(-5, 5),Sup.Math.Random.float(-5, 5)); | |
} | |
} | |
update() { | |
} | |
} | |
Sup.registerBehavior(ScatterStars); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment