Browse Source

Started with breakout examples

rsredsq 10 years ago
parent
commit
9c3bfe637c

+ 0 - 0
Breakout/Breakout.atomic


+ 23 - 0
Breakout/Resources/Components/Background.js

@@ -0,0 +1,23 @@
+"atomic component";
+
+function random(min, max) {
+    return (Math.random() * (max - min + 1)) + min;
+}
+
+exports.component = function(self) {
+    self.start = function() {
+        var zone = Atomic.renderer.getDefaultZone();
+        zone.setFogColor([0.282, 0.361, 0.557]);
+        for(var i = 0; i < 100; i++) {
+            var starNode = self.node.createChild("Star");
+            starNode.position2D = [random(-Atomic.graphics.width/2, Atomic.graphics.width/2)*Atomic.PIXEL_SIZE, random(-Atomic.graphics.height/2, Atomic.graphics.height/2)*Atomic.PIXEL_SIZE];
+            var star = starNode.createComponent("StaticSprite2D");
+            star.layer = -100;
+            star.sprite = Atomic.cache.getResource("Sprite2D", "Sprites/star.png");
+        }
+    }
+
+    self.update = function() {
+
+    }
+}

+ 36 - 0
Breakout/Resources/Components/Ball.js

@@ -0,0 +1,36 @@
+"atomic component";
+
+//A ball component
+exports.component = function(self) {
+    var brickDestroySound = self.scene.getChild("BrickSound").getComponent("SoundSource");
+    function playBrickDestroySound() {
+        brickDestroySound.play(brickDestroySound.sound);
+    }
+    self.start = function() {
+        //define node name
+        self.node.name = "Ball";
+        self.rigidBody = self.getComponent("RigidBody2D");
+        self.subscribeToEvent("PhysicsBeginContact2D", function(data){
+            //get a brick
+            var brick = (data.nodeA == self.node) ? data.nodeB : data.nodeA;
+            //in that case we are on 100% sure, that we could have only ball collided with brick, so we don't really need any checks
+            if (brick.name.indexOf("Brick") >= 0) {
+                playBrickDestroySound();
+                brick.remove();
+            }
+        });
+    }
+
+    self.update = function(delta) {
+        if (self.node.position2D[1] <= -4) {
+            self.rigidBody.remove();
+            self.gameOver = true;
+        }
+        if (self.gameOver) {
+            if(Atomic.input.getMouseButtonPress(Atomic.MOUSEB_LEFT)) {
+                self.gameOver = false;
+                Atomic.player.loadScene("Scenes/Scene.scene");
+            }
+        }
+    }
+}

+ 23 - 0
Breakout/Resources/Components/Paddle.js

@@ -0,0 +1,23 @@
+"atomic component";
+
+//A paddle component
+exports.component = function(self) {
+    self.start = function() {
+        self.node.name = "Paddle";
+        self.startBall = self.scene.createChildPrefab("Ball", "Prefabs/Ball.prefab");
+    }
+
+    self.update = function(delta) {
+        if(!self.started) {
+            if(Atomic.input.getMouseButtonPress(Atomic.MOUSEB_LEFT)) {
+                self.started = true;
+                var body = self.startBall.getComponent("RigidBody2D");
+                body.applyForceToCenter([20 + Math.random(), 20 + Math.random()], true);
+            }
+            self.startBall.position2D = [self.node.position2D[0], self.node.position2D[1]+64*Atomic.PIXEL_SIZE];
+        }
+        var pos = Atomic.renderer.getViewport(0).screenToWorldPoint(Atomic.input.getMousePosition()[0], 0, 0);
+        pos[1] = -3;
+        self.node.position2D = pos;
+    }
+}

+ 19 - 0
Breakout/Resources/Components/Wall.js

@@ -0,0 +1,19 @@
+"atomic component";
+
+//A paddle component
+exports.component = function(self) {
+    self.start = function() {
+        self.rigidBody = self.node.getComponent("RigidBody2D");
+
+        var chain = new Atomic.CollisionChain2D();
+        chain.loop = false;
+        chain.setVertexCount(4);
+        var halfWidth = Atomic.graphics.width / 2 * Atomic.PIXEL_SIZE;
+        var halfHeight = Atomic.graphics.height / 2 * Atomic.PIXEL_SIZE;
+        chain.setVertex(0, [-halfWidth, -halfHeight]);
+        chain.setVertex(1, [-halfWidth, halfHeight]);
+        chain.setVertex(2, [halfWidth, halfHeight]);
+        chain.setVertex(3, [halfWidth, -halfHeight]);
+        self.node.addComponent(chain, 0, Atomic.LOCAL);
+    }
+}

+ 29 - 0
Breakout/Resources/Prefabs/Ball.prefab

@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<node id="443">
+	<attribute name="Is Enabled" value="true" />
+	<attribute name="Name" value="Ball" />
+	<attribute name="Position" value="0 0 0" />
+	<attribute name="Rotation" value="1 0 0 0" />
+	<attribute name="Scale" value="1 1 1" />
+	<attribute name="Variables" />
+	<component type="StaticSprite2D" id="2120">
+		<attribute name="Sprite" value="Sprite2D;Sprites/ball.png" />
+	</component>
+	<component type="RigidBody2D" id="2121">
+		<attribute name="Body Type" value="Dynamic" />
+		<attribute name="Mass" value="0.0314159" />
+		<attribute name="Inertia" value="0.00015708" />
+		<attribute name="Bullet" value="true" />
+	</component>
+	<component type="CollisionCircle2D" id="2122">
+		<attribute name="Radius" value="0.1" />
+		<attribute name="Category Bits" value="1" />
+		<attribute name="Mask Bits" value="65535" />
+		<attribute name="Density" value="1" />
+		<attribute name="Friction" value="0" />
+		<attribute name="Restitution" value="1" />
+	</component>
+	<component type="JSComponent" id="2123">
+		<attribute name="ComponentFile" value="JSComponentFile;Components/Ball.js" />
+	</component>
+</node>

+ 18 - 0
Breakout/Resources/Prefabs/BrickBlue.prefab

@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<node id="429">
+	<attribute name="Is Enabled" value="true" />
+	<attribute name="Name" value="BrickBlue" />
+	<attribute name="Position" value="-0 0 0" />
+	<attribute name="Rotation" value="1 0 0 0" />
+	<attribute name="Scale" value="1 1 1" />
+	<attribute name="Variables" />
+	<component type="StaticSprite2D" id="2397">
+		<attribute name="Sprite" value="Sprite2D;Sprites/block_blue.png" />
+	</component>
+	<component type="RigidBody2D" id="2398" />
+	<component type="CollisionBox2D" id="2399">
+		<attribute name="Size" value="0.6 0.3" />
+		<attribute name="Category Bits" value="1" />
+		<attribute name="Mask Bits" value="65535" />
+	</component>
+</node>

+ 18 - 0
Breakout/Resources/Prefabs/BrickGreen.prefab

@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<node id="414">
+	<attribute name="Is Enabled" value="true" />
+	<attribute name="Name" value="BrickGreen" />
+	<attribute name="Position" value="0 0 -0" />
+	<attribute name="Rotation" value="1 0 0 0" />
+	<attribute name="Scale" value="1 1 1" />
+	<attribute name="Variables" />
+	<component type="StaticSprite2D" id="2232">
+		<attribute name="Sprite" value="Sprite2D;Sprites/block_green.png" />
+	</component>
+	<component type="RigidBody2D" id="2233" />
+	<component type="CollisionBox2D" id="2234">
+		<attribute name="Size" value="0.6 0.3" />
+		<attribute name="Category Bits" value="1" />
+		<attribute name="Mask Bits" value="65535" />
+	</component>
+</node>

+ 18 - 0
Breakout/Resources/Prefabs/BrickPurple.prefab

@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<node id="397">
+	<attribute name="Is Enabled" value="true" />
+	<attribute name="Name" value="BrickPurple" />
+	<attribute name="Position" value="-6 2 0" />
+	<attribute name="Rotation" value="1 0 0 0" />
+	<attribute name="Scale" value="1 1 1" />
+	<attribute name="Variables" />
+	<component type="StaticSprite2D" id="2127">
+		<attribute name="Sprite" value="Sprite2D;Sprites/block_purple.png" />
+	</component>
+	<component type="RigidBody2D" id="2128" />
+	<component type="CollisionBox2D" id="2129">
+		<attribute name="Size" value="0.6 0.3" />
+		<attribute name="Category Bits" value="1" />
+		<attribute name="Mask Bits" value="65535" />
+	</component>
+</node>

+ 18 - 0
Breakout/Resources/Prefabs/BrickRed.prefab

@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<node id="373">
+	<attribute name="Is Enabled" value="true" />
+	<attribute name="Name" value="BrickRed" />
+	<attribute name="Position" value="-6 3 0" />
+	<attribute name="Rotation" value="1 0 0 0" />
+	<attribute name="Scale" value="1 1 1" />
+	<attribute name="Variables" />
+	<component type="StaticSprite2D" id="2005">
+		<attribute name="Sprite" value="Sprite2D;Sprites/block_red.png" />
+	</component>
+	<component type="RigidBody2D" id="2006" />
+	<component type="CollisionBox2D" id="2007">
+		<attribute name="Size" value="0.6 0.3" />
+		<attribute name="Category Bits" value="1" />
+		<attribute name="Mask Bits" value="65535" />
+	</component>
+</node>

+ 18 - 0
Breakout/Resources/Prefabs/BrickYellow.prefab

@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<node id="444">
+	<attribute name="Is Enabled" value="true" />
+	<attribute name="Name" value="BrickYellow" />
+	<attribute name="Position" value="-0 0 0" />
+	<attribute name="Rotation" value="1 0 0 0" />
+	<attribute name="Scale" value="1 1 1" />
+	<attribute name="Variables" />
+	<component type="StaticSprite2D" id="2453">
+		<attribute name="Sprite" value="Sprite2D;Sprites/block_yellow.png" />
+	</component>
+	<component type="RigidBody2D" id="2454" />
+	<component type="CollisionBox2D" id="2455">
+		<attribute name="Size" value="0.6 0.3" />
+		<attribute name="Category Bits" value="1" />
+		<attribute name="Mask Bits" value="65535" />
+	</component>
+</node>

+ 832 - 0
Breakout/Resources/Scenes/Scene.scene

@@ -0,0 +1,832 @@
+<?xml version="1.0"?>
+<scene id="1">
+	<attribute name="Name" value="" />
+	<attribute name="Time Scale" value="1" />
+	<attribute name="Smoothing Constant" value="50" />
+	<attribute name="Snap Threshold" value="5" />
+	<attribute name="Elapsed Time" value="0" />
+	<attribute name="Next Replicated Node ID" value="470" />
+	<attribute name="Next Replicated Component ID" value="4350" />
+	<attribute name="Next Local Node ID" value="16778496" />
+	<attribute name="Next Local Component ID" value="16777216" />
+	<attribute name="Variables" />
+	<attribute name="Variable Names" value="" />
+	<component type="Octree" id="2" />
+	<component type="DebugRenderer" id="3" />
+	<component type="Renderer2D" id="1976" />
+	<component type="PhysicsWorld2D" id="1981">
+		<attribute name="Draw Shape" value="true" />
+		<attribute name="Draw Aabb" value="true" />
+		<attribute name="Allow Sleeping" value="true" />
+		<attribute name="Warm Starting" value="true" />
+		<attribute name="Gravity" value="0 0" />
+		<attribute name="Auto Clear Forces" value="true" />
+	</component>
+	<node id="361">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Camera" />
+		<attribute name="Position" value="0 0 -5" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Camera" id="1973">
+			<attribute name="Near Clip" value="0" />
+			<attribute name="Orthographic" value="true" />
+			<attribute name="Orthographic Size" value="5" />
+		</component>
+	</node>
+	<node id="363">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Paddle" />
+		<attribute name="Position" value="0 -3 0" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="StaticSprite2D" id="1975">
+			<attribute name="Sprite" value="Sprite2D;Sprites/paddle.png" />
+		</component>
+		<component type="RigidBody2D" id="1982">
+			<attribute name="Body Type" value="Kinematic" />
+		</component>
+		<component type="CollisionBox2D" id="1984">
+			<attribute name="Size" value="1 0.25" />
+			<attribute name="Category Bits" value="1" />
+			<attribute name="Mask Bits" value="65535" />
+			<attribute name="Density" value="10" />
+			<attribute name="Friction" value="0" />
+			<attribute name="Restitution" value="0.1" />
+		</component>
+		<component type="JSComponent" id="1986">
+			<attribute name="ComponentFile" value="JSComponentFile;Components/Paddle.js" />
+		</component>
+	</node>
+	<node id="369">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Wall" />
+		<attribute name="Position" value="0 0 0" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="JSComponent" id="2000">
+			<attribute name="ComponentFile" value="JSComponentFile;Components/Wall.js" />
+		</component>
+		<component type="RigidBody2D" id="2001" />
+	</node>
+	<node id="379">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Level" />
+		<attribute name="Position" value="0 0 0" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<node id="377">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickRed" />
+			<attribute name="Position" value="-6 3 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2014">
+				<attribute name="PrefabGUID" value="caf863e07b1d8a78f19a9ee9326391f4" />
+			</component>
+		</node>
+		<node id="376">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickRed" />
+			<attribute name="Position" value="-5 3 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2010">
+				<attribute name="PrefabGUID" value="caf863e07b1d8a78f19a9ee9326391f4" />
+			</component>
+		</node>
+		<node id="384">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickRed" />
+			<attribute name="Position" value="-1 3 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2035">
+				<attribute name="PrefabGUID" value="caf863e07b1d8a78f19a9ee9326391f4" />
+			</component>
+		</node>
+		<node id="383">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickRed" />
+			<attribute name="Position" value="-2 3 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2031">
+				<attribute name="PrefabGUID" value="caf863e07b1d8a78f19a9ee9326391f4" />
+			</component>
+		</node>
+		<node id="382">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickRed" />
+			<attribute name="Position" value="-3 3 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2027">
+				<attribute name="PrefabGUID" value="caf863e07b1d8a78f19a9ee9326391f4" />
+			</component>
+		</node>
+		<node id="381">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickRed" />
+			<attribute name="Position" value="-4 3 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2023">
+				<attribute name="PrefabGUID" value="caf863e07b1d8a78f19a9ee9326391f4" />
+			</component>
+		</node>
+		<node id="392">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickRed" />
+			<attribute name="Position" value="6 3 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2079">
+				<attribute name="PrefabGUID" value="caf863e07b1d8a78f19a9ee9326391f4" />
+			</component>
+		</node>
+		<node id="391">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickRed" />
+			<attribute name="Position" value="5 3 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2075">
+				<attribute name="PrefabGUID" value="caf863e07b1d8a78f19a9ee9326391f4" />
+			</component>
+		</node>
+		<node id="390">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickRed" />
+			<attribute name="Position" value="4 3 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2071">
+				<attribute name="PrefabGUID" value="caf863e07b1d8a78f19a9ee9326391f4" />
+			</component>
+		</node>
+		<node id="389">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickRed" />
+			<attribute name="Position" value="3 3 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2067">
+				<attribute name="PrefabGUID" value="caf863e07b1d8a78f19a9ee9326391f4" />
+			</component>
+		</node>
+		<node id="388">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickRed" />
+			<attribute name="Position" value="2 3 -0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2063">
+				<attribute name="PrefabGUID" value="caf863e07b1d8a78f19a9ee9326391f4" />
+			</component>
+		</node>
+		<node id="387">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickRed" />
+			<attribute name="Position" value="1 3 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2059">
+				<attribute name="PrefabGUID" value="caf863e07b1d8a78f19a9ee9326391f4" />
+			</component>
+		</node>
+		<node id="386">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickRed" />
+			<attribute name="Position" value="0 3 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2055">
+				<attribute name="PrefabGUID" value="caf863e07b1d8a78f19a9ee9326391f4" />
+			</component>
+		</node>
+		<node id="409">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickPurple" />
+			<attribute name="Position" value="2 2 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2211">
+				<attribute name="PrefabGUID" value="ea17102aece9c6362cc6c47f6e4bfc02" />
+			</component>
+		</node>
+		<node id="408">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickPurple" />
+			<attribute name="Position" value="1 2 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2207">
+				<attribute name="PrefabGUID" value="ea17102aece9c6362cc6c47f6e4bfc02" />
+			</component>
+		</node>
+		<node id="407">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickPurple" />
+			<attribute name="Position" value="0 2 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2203">
+				<attribute name="PrefabGUID" value="ea17102aece9c6362cc6c47f6e4bfc02" />
+			</component>
+		</node>
+		<node id="405">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickPurple" />
+			<attribute name="Position" value="0 2 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2195">
+				<attribute name="PrefabGUID" value="ea17102aece9c6362cc6c47f6e4bfc02" />
+			</component>
+		</node>
+		<node id="404">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickPurple" />
+			<attribute name="Position" value="-1 2 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2191">
+				<attribute name="PrefabGUID" value="ea17102aece9c6362cc6c47f6e4bfc02" />
+			</component>
+		</node>
+		<node id="403">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickPurple" />
+			<attribute name="Position" value="-2 2 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2187">
+				<attribute name="PrefabGUID" value="ea17102aece9c6362cc6c47f6e4bfc02" />
+			</component>
+		</node>
+		<node id="402">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickPurple" />
+			<attribute name="Position" value="-3 2 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2183">
+				<attribute name="PrefabGUID" value="ea17102aece9c6362cc6c47f6e4bfc02" />
+			</component>
+		</node>
+		<node id="401">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickPurple" />
+			<attribute name="Position" value="-4 2 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2179">
+				<attribute name="PrefabGUID" value="ea17102aece9c6362cc6c47f6e4bfc02" />
+			</component>
+		</node>
+		<node id="400">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickPurple" />
+			<attribute name="Position" value="-5 2 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2175">
+				<attribute name="PrefabGUID" value="ea17102aece9c6362cc6c47f6e4bfc02" />
+			</component>
+		</node>
+		<node id="397">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickPurple" />
+			<attribute name="Position" value="-6 2 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2163">
+				<attribute name="PrefabGUID" value="ea17102aece9c6362cc6c47f6e4bfc02" />
+			</component>
+		</node>
+		<node id="413">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickPurple" />
+			<attribute name="Position" value="6 2 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2227">
+				<attribute name="PrefabGUID" value="ea17102aece9c6362cc6c47f6e4bfc02" />
+			</component>
+		</node>
+		<node id="412">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickPurple" />
+			<attribute name="Position" value="5 2 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2223">
+				<attribute name="PrefabGUID" value="ea17102aece9c6362cc6c47f6e4bfc02" />
+			</component>
+		</node>
+		<node id="411">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickPurple" />
+			<attribute name="Position" value="4 2 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2219">
+				<attribute name="PrefabGUID" value="ea17102aece9c6362cc6c47f6e4bfc02" />
+			</component>
+		</node>
+		<node id="410">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickPurple" />
+			<attribute name="Position" value="3 2 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2215">
+				<attribute name="PrefabGUID" value="ea17102aece9c6362cc6c47f6e4bfc02" />
+			</component>
+		</node>
+		<node id="427">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickGreen" />
+			<attribute name="Position" value="6 1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2280">
+				<attribute name="PrefabGUID" value="413ab8b672ec3db8d80412dd67cab815" />
+			</component>
+		</node>
+		<node id="426">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickGreen" />
+			<attribute name="Position" value="5 1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2276">
+				<attribute name="PrefabGUID" value="413ab8b672ec3db8d80412dd67cab815" />
+			</component>
+		</node>
+		<node id="425">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickGreen" />
+			<attribute name="Position" value="4 1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2272">
+				<attribute name="PrefabGUID" value="413ab8b672ec3db8d80412dd67cab815" />
+			</component>
+		</node>
+		<node id="424">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickGreen" />
+			<attribute name="Position" value="3 1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2268">
+				<attribute name="PrefabGUID" value="413ab8b672ec3db8d80412dd67cab815" />
+			</component>
+		</node>
+		<node id="423">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickGreen" />
+			<attribute name="Position" value="2 1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2264">
+				<attribute name="PrefabGUID" value="413ab8b672ec3db8d80412dd67cab815" />
+			</component>
+		</node>
+		<node id="422">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickGreen" />
+			<attribute name="Position" value="1 1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2260">
+				<attribute name="PrefabGUID" value="413ab8b672ec3db8d80412dd67cab815" />
+			</component>
+		</node>
+		<node id="421">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickGreen" />
+			<attribute name="Position" value="0 1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2256">
+				<attribute name="PrefabGUID" value="413ab8b672ec3db8d80412dd67cab815" />
+			</component>
+		</node>
+		<node id="420">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickGreen" />
+			<attribute name="Position" value="-1 1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2252">
+				<attribute name="PrefabGUID" value="413ab8b672ec3db8d80412dd67cab815" />
+			</component>
+		</node>
+		<node id="419">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickGreen" />
+			<attribute name="Position" value="-2 1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2248">
+				<attribute name="PrefabGUID" value="413ab8b672ec3db8d80412dd67cab815" />
+			</component>
+		</node>
+		<node id="418">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickGreen" />
+			<attribute name="Position" value="-3 1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2244">
+				<attribute name="PrefabGUID" value="413ab8b672ec3db8d80412dd67cab815" />
+			</component>
+		</node>
+		<node id="417">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickGreen" />
+			<attribute name="Position" value="-4 1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2240">
+				<attribute name="PrefabGUID" value="413ab8b672ec3db8d80412dd67cab815" />
+			</component>
+		</node>
+		<node id="416">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickGreen" />
+			<attribute name="Position" value="-5 1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2236">
+				<attribute name="PrefabGUID" value="413ab8b672ec3db8d80412dd67cab815" />
+			</component>
+		</node>
+		<node id="415">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickGreen" />
+			<attribute name="Position" value="-6 1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2235">
+				<attribute name="PrefabGUID" value="413ab8b672ec3db8d80412dd67cab815" />
+			</component>
+		</node>
+		<node id="441">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickBlue" />
+			<attribute name="Position" value="2 0 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2444">
+				<attribute name="PrefabGUID" value="66b8b3aac5abc1e85b860662e47bbb95" />
+			</component>
+		</node>
+		<node id="440">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickBlue" />
+			<attribute name="Position" value="6 0 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2440">
+				<attribute name="PrefabGUID" value="66b8b3aac5abc1e85b860662e47bbb95" />
+			</component>
+		</node>
+		<node id="439">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickBlue" />
+			<attribute name="Position" value="5 0 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2436">
+				<attribute name="PrefabGUID" value="66b8b3aac5abc1e85b860662e47bbb95" />
+			</component>
+		</node>
+		<node id="438">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickBlue" />
+			<attribute name="Position" value="3 0 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2432">
+				<attribute name="PrefabGUID" value="66b8b3aac5abc1e85b860662e47bbb95" />
+			</component>
+		</node>
+		<node id="437">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickBlue" />
+			<attribute name="Position" value="4 0 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2428">
+				<attribute name="PrefabGUID" value="66b8b3aac5abc1e85b860662e47bbb95" />
+			</component>
+		</node>
+		<node id="436">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickBlue" />
+			<attribute name="Position" value="1 0 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2424">
+				<attribute name="PrefabGUID" value="66b8b3aac5abc1e85b860662e47bbb95" />
+			</component>
+		</node>
+		<node id="435">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickBlue" />
+			<attribute name="Position" value="-5 0 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2420">
+				<attribute name="PrefabGUID" value="66b8b3aac5abc1e85b860662e47bbb95" />
+			</component>
+		</node>
+		<node id="434">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickBlue" />
+			<attribute name="Position" value="-4 0 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2416">
+				<attribute name="PrefabGUID" value="66b8b3aac5abc1e85b860662e47bbb95" />
+			</component>
+		</node>
+		<node id="433">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickBlue" />
+			<attribute name="Position" value="-3 0 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2412">
+				<attribute name="PrefabGUID" value="66b8b3aac5abc1e85b860662e47bbb95" />
+			</component>
+		</node>
+		<node id="432">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickBlue" />
+			<attribute name="Position" value="-2 0 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2408">
+				<attribute name="PrefabGUID" value="66b8b3aac5abc1e85b860662e47bbb95" />
+			</component>
+		</node>
+		<node id="431">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickBlue" />
+			<attribute name="Position" value="-1 0 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2404">
+				<attribute name="PrefabGUID" value="66b8b3aac5abc1e85b860662e47bbb95" />
+			</component>
+		</node>
+		<node id="430">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickBlue" />
+			<attribute name="Position" value="-0 0 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2400">
+				<attribute name="PrefabGUID" value="66b8b3aac5abc1e85b860662e47bbb95" />
+			</component>
+		</node>
+		<node id="429">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickBlue" />
+			<attribute name="Position" value="-6 0 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2396">
+				<attribute name="PrefabGUID" value="66b8b3aac5abc1e85b860662e47bbb95" />
+			</component>
+		</node>
+		<node id="457">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickYellow" />
+			<attribute name="Position" value="-6 -1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2501">
+				<attribute name="PrefabGUID" value="1c92cb268079dda214677877767a7e74" />
+			</component>
+		</node>
+		<node id="456">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickYellow" />
+			<attribute name="Position" value="5 -1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2497">
+				<attribute name="PrefabGUID" value="1c92cb268079dda214677877767a7e74" />
+			</component>
+		</node>
+		<node id="455">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickYellow" />
+			<attribute name="Position" value="6 -1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2493">
+				<attribute name="PrefabGUID" value="1c92cb268079dda214677877767a7e74" />
+			</component>
+		</node>
+		<node id="454">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickYellow" />
+			<attribute name="Position" value="-5 -1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2489">
+				<attribute name="PrefabGUID" value="1c92cb268079dda214677877767a7e74" />
+			</component>
+		</node>
+		<node id="453">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickYellow" />
+			<attribute name="Position" value="-4 -1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2485">
+				<attribute name="PrefabGUID" value="1c92cb268079dda214677877767a7e74" />
+			</component>
+		</node>
+		<node id="452">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickYellow" />
+			<attribute name="Position" value="-3 -1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2481">
+				<attribute name="PrefabGUID" value="1c92cb268079dda214677877767a7e74" />
+			</component>
+		</node>
+		<node id="451">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickYellow" />
+			<attribute name="Position" value="-2 -1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2477">
+				<attribute name="PrefabGUID" value="1c92cb268079dda214677877767a7e74" />
+			</component>
+		</node>
+		<node id="450">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickYellow" />
+			<attribute name="Position" value="-1 -1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2473">
+				<attribute name="PrefabGUID" value="1c92cb268079dda214677877767a7e74" />
+			</component>
+		</node>
+		<node id="449">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickYellow" />
+			<attribute name="Position" value="-0 -1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2469">
+				<attribute name="PrefabGUID" value="1c92cb268079dda214677877767a7e74" />
+			</component>
+		</node>
+		<node id="448">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickYellow" />
+			<attribute name="Position" value="1 -1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2465">
+				<attribute name="PrefabGUID" value="1c92cb268079dda214677877767a7e74" />
+			</component>
+		</node>
+		<node id="447">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickYellow" />
+			<attribute name="Position" value="2 -1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2461">
+				<attribute name="PrefabGUID" value="1c92cb268079dda214677877767a7e74" />
+			</component>
+		</node>
+		<node id="446">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickYellow" />
+			<attribute name="Position" value="3 -1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2457">
+				<attribute name="PrefabGUID" value="1c92cb268079dda214677877767a7e74" />
+			</component>
+		</node>
+		<node id="445">
+			<attribute name="Is Enabled" value="true" />
+			<attribute name="Name" value="BrickYellow" />
+			<attribute name="Position" value="4 -1 0" />
+			<attribute name="Rotation" value="1 0 0 0" />
+			<attribute name="Scale" value="1 1 1" />
+			<attribute name="Variables" />
+			<component type="PrefabComponent" id="2456">
+				<attribute name="PrefabGUID" value="1c92cb268079dda214677877767a7e74" />
+			</component>
+		</node>
+	</node>
+	<node id="468">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="BrickSound" />
+		<attribute name="Position" value="0 0 0" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="SoundSource" id="4347">
+			<attribute name="Sound" value="Sound;Sounds/brick.wav" />
+			<attribute name="Type" value="Brick" />
+		</component>
+	</node>
+	<node id="469">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Background" />
+		<attribute name="Position" value="0 0 0" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="JSComponent" id="4349">
+			<attribute name="ComponentFile" value="JSComponentFile;Components/Background.js" />
+		</component>
+	</node>
+</scene>

+ 5 - 0
Breakout/Resources/Scripts/main.js

@@ -0,0 +1,5 @@
+Atomic.renderer.textureFilterMode = Atomic.FILTER_NEAREST;
+var scene = Atomic.player.loadScene("Scenes/Scene.scene");
+var camera = scene.getMainCamera();
+camera.setOrthographic(true);
+camera.setOrthoSize(Atomic.graphics.height * Atomic.PIXEL_SIZE);

BIN
Breakout/Resources/Sounds/brick.wav


BIN
Breakout/Resources/Sprites/ball.png


BIN
Breakout/Resources/Sprites/block_blue.png


BIN
Breakout/Resources/Sprites/block_green.png


BIN
Breakout/Resources/Sprites/block_purple.png


BIN
Breakout/Resources/Sprites/block_red.png


BIN
Breakout/Resources/Sprites/block_yellow.png


BIN
Breakout/Resources/Sprites/paddle.png


BIN
Breakout/Resources/Sprites/star.png