User prompt
If I tap the screen make nearby squares bounce away and then rubber band back again
User prompt
Try blend mode 3
User prompt
Set blend mode to 2 instead
User prompt
Set square blend mode to 1
User prompt
Make it 2000 squares
User prompt
Add 400 more square and make them have random sizes
User prompt
Tint the squares with a random color
User prompt
Add 100 more squares
Initial prompt
Test game
var SpinningSquare = Container.expand(function () { var self = Container.call(this); var squareGraphics = self.createAsset('square', 'Spinning Square', Math.random(), Math.random()); squareGraphics.tint = Math.random() * 0xFFFFFF; squareGraphics.blendMode = 1; self.rotationSpeed = 0.01; self.rotate = function () { self.rotation += self.rotationSpeed; }; }); var Game = Container.expand(function () { var self = Container.call(this); var spinningSquares = []; for (var i = 0; i < 2000; i++) { var spinningSquare = self.addChild(new SpinningSquare()); spinningSquare.x = Math.random() * 2048; spinningSquare.y = Math.random() * 2732; spinningSquares.push(spinningSquare); } LK.on('tick', function () { for (var i = 0; i < spinningSquares.length; i++) { spinningSquares[i].rotate(); } }); });
===================================================================
--- original.js
+++ change.js
@@ -1,8 +1,9 @@
var SpinningSquare = Container.expand(function () {
var self = Container.call(this);
var squareGraphics = self.createAsset('square', 'Spinning Square', Math.random(), Math.random());
squareGraphics.tint = Math.random() * 0xFFFFFF;
+ squareGraphics.blendMode = 1;
self.rotationSpeed = 0.01;
self.rotate = function () {
self.rotation += self.rotationSpeed;
};