Browse Source

Working on SpaceGame

Josh Engebretson 11 years ago
parent
commit
79fa57b34c

+ 15 - 0
SpaceGame/Resources/Components/Player.js

@@ -0,0 +1,15 @@
+var game = Atomic.game;
+var node = self.node;
+
+function start() {
+
+	var spaceSheet = game.getSpriteSheet("Sprites/spacegame_sheet.xml");
+
+    var sprite2D = node.createComponent("StaticSprite2D");
+    sprite2D.sprite = spaceSheet.getSprite("spaceship_mantis");
+    sprite2D.blendMode = Atomic.BLEND_ALPHA;    
+    
+    node.position2D =  [0, 0];
+
+}
+

+ 27 - 0
SpaceGame/Resources/Components/Space.js

@@ -0,0 +1,27 @@
+
+var game = Atomic.game;
+var node = self.node;
+
+node.scale2D = [1.5, 1.5];
+node.position2D = [0, 12];
+
+function start() {
+
+    var spaceSprite = game.cache.getResource("Sprite2D", "Sprites/space_background.png");
+
+    // add a sprite component to our node
+    var sprite2D = node.createComponent("StaticSprite2D");
+    
+    sprite2D.orderInLayer = -200;
+    sprite2D.blendMode = Atomic.BLEND_ADDALPHA;    
+    sprite2D.sprite = spaceSprite;
+
+}
+
+function update(timeStep) {
+
+    var speed = .75;
+	node.translate([0, -timeStep * speed, 0]);
+
+}
+

+ 29 - 0
SpaceGame/Resources/Components/SpaceGame.js

@@ -0,0 +1,29 @@
+
+
+var game = Atomic.game;
+var scene = game.scene;
+
+function spawnSpace() {
+
+    var spaceNode = scene.createChild("Space");
+    spaceNode.createJSComponent("Space");
+}    
+
+function spawnPlayer() {
+
+    self.playerNode = scene.createChild("Player");
+    self.player = self.playerNode.createJSComponent("Player");
+}    
+
+
+function start() {
+
+	spawnSpace();
+	spawnPlayer();
+}
+
+
+function update(timeStep) {
+
+
+}

BIN
SpaceGame/Resources/Music/battle.ogg


+ 22 - 0
SpaceGame/Resources/Script/Main.js

@@ -0,0 +1,22 @@
+
+// This script is the main entry point of the game
+
+// called at the start of play
+function Start() {
+
+	var game = Atomic.game;
+
+	// create a 2D scene
+	game.createScene2D();
+
+	// create the game component
+	var node = game.scene.createChild("SpaceGame");
+	node.createJSComponent("SpaceGame");
+	
+}
+
+// called per frame
+function Update(timeStep) {
+
+
+}

BIN
SpaceGame/Resources/Sounds/boom0.wav


BIN
SpaceGame/Resources/Sounds/boom1.wav


BIN
SpaceGame/Resources/Sounds/laser01.wav


BIN
SpaceGame/Resources/Sounds/laser02.wav


BIN
SpaceGame/Resources/Sprites/blue_beam.png


BIN
SpaceGame/Resources/Sprites/blue_star.png


BIN
SpaceGame/Resources/Sprites/explosions_sheet.png


+ 134 - 0
SpaceGame/Resources/Sprites/explosions_sheet.xml

@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Created with TexturePacker http://www.codeandweb.com/texturepacker-->
+<!-- $TexturePacker:SmartUpdate:1a17c841c2e0285d52a986d357f78c54:1/1$ -->
+<TextureAtlas imagePath="explosions_sheet.png">
+    <SubTexture name="0_0" x="0" y="0" width="64" height="64"/>
+    <SubTexture name="0_1" x="64" y="0" width="64" height="64"/>
+    <SubTexture name="0_2" x="128" y="0" width="64" height="64"/>
+    <SubTexture name="0_3" x="192" y="0" width="64" height="64"/>
+    <SubTexture name="0_4" x="256" y="0" width="64" height="64"/>
+    <SubTexture name="0_5" x="320" y="0" width="64" height="64"/>
+    <SubTexture name="0_6" x="384" y="0" width="64" height="64"/>
+    <SubTexture name="0_7" x="448" y="0" width="64" height="64"/>
+    <SubTexture name="0_8" x="512" y="0" width="64" height="64"/>
+    <SubTexture name="0_9" x="576" y="0" width="64" height="64"/>
+    <SubTexture name="0_10" x="640" y="0" width="64" height="64"/>
+    <SubTexture name="0_11" x="704" y="0" width="64" height="64"/>
+    <SubTexture name="0_12" x="768" y="0" width="64" height="64"/>
+    <SubTexture name="0_13" x="832" y="0" width="64" height="64"/>
+    <SubTexture name="0_14" x="896" y="0" width="64" height="64"/>
+    <SubTexture name="0_15" x="960" y="0" width="64" height="64"/>
+    <SubTexture name="1_0" x="0" y="64" width="64" height="64"/>
+    <SubTexture name="1_1" x="64" y="64" width="64" height="64"/>
+    <SubTexture name="1_2" x="128" y="64" width="64" height="64"/>
+    <SubTexture name="1_3" x="192" y="64" width="64" height="64"/>
+    <SubTexture name="1_4" x="256" y="64" width="64" height="64"/>
+    <SubTexture name="1_5" x="320" y="64" width="64" height="64"/>
+    <SubTexture name="1_6" x="384" y="64" width="64" height="64"/>
+    <SubTexture name="1_7" x="448" y="64" width="64" height="64"/>
+    <SubTexture name="1_8" x="512" y="64" width="64" height="64"/>
+    <SubTexture name="1_9" x="576" y="64" width="64" height="64"/>
+    <SubTexture name="1_10" x="640" y="64" width="64" height="64"/>
+    <SubTexture name="1_11" x="704" y="64" width="64" height="64"/>
+    <SubTexture name="1_12" x="768" y="64" width="64" height="64"/>
+    <SubTexture name="1_13" x="832" y="64" width="64" height="64"/>
+    <SubTexture name="1_14" x="896" y="64" width="64" height="64"/>
+    <SubTexture name="1_15" x="960" y="64" width="64" height="64"/>
+    <SubTexture name="2_0" x="0" y="128" width="64" height="64"/>
+    <SubTexture name="2_1" x="64" y="128" width="64" height="64"/>
+    <SubTexture name="2_2" x="128" y="128" width="64" height="64"/>
+    <SubTexture name="2_3" x="192" y="128" width="64" height="64"/>
+    <SubTexture name="2_4" x="256" y="128" width="64" height="64"/>
+    <SubTexture name="2_5" x="320" y="128" width="64" height="64"/>
+    <SubTexture name="2_6" x="384" y="128" width="64" height="64"/>
+    <SubTexture name="2_7" x="448" y="128" width="64" height="64"/>
+    <SubTexture name="2_8" x="512" y="128" width="64" height="64"/>
+    <SubTexture name="2_9" x="576" y="128" width="64" height="64"/>
+    <SubTexture name="2_10" x="640" y="128" width="64" height="64"/>
+    <SubTexture name="2_11" x="704" y="128" width="64" height="64"/>
+    <SubTexture name="2_12" x="768" y="128" width="64" height="64"/>
+    <SubTexture name="2_13" x="832" y="128" width="64" height="64"/>
+    <SubTexture name="2_14" x="896" y="128" width="64" height="64"/>
+    <SubTexture name="2_15" x="960" y="128" width="64" height="64"/>
+    <SubTexture name="3_0" x="0" y="192" width="64" height="64"/>
+    <SubTexture name="3_1" x="64" y="192" width="64" height="64"/>
+    <SubTexture name="3_2" x="128" y="192" width="64" height="64"/>
+    <SubTexture name="3_3" x="192" y="192" width="64" height="64"/>
+    <SubTexture name="3_4" x="256" y="192" width="64" height="64"/>
+    <SubTexture name="3_5" x="320" y="192" width="64" height="64"/>
+    <SubTexture name="3_6" x="384" y="192" width="64" height="64"/>
+    <SubTexture name="3_7" x="448" y="192" width="64" height="64"/>
+    <SubTexture name="3_8" x="512" y="192" width="64" height="64"/>
+    <SubTexture name="3_9" x="576" y="192" width="64" height="64"/>
+    <SubTexture name="3_10" x="640" y="192" width="64" height="64"/>
+    <SubTexture name="3_11" x="704" y="192" width="64" height="64"/>
+    <SubTexture name="3_12" x="768" y="192" width="64" height="64"/>
+    <SubTexture name="3_13" x="832" y="192" width="64" height="64"/>
+    <SubTexture name="3_14" x="896" y="192" width="64" height="64"/>
+    <SubTexture name="3_15" x="960" y="192" width="64" height="64"/>
+    <SubTexture name="4_0" x="0" y="256" width="64" height="64"/>
+    <SubTexture name="4_1" x="64" y="256" width="64" height="64"/>
+    <SubTexture name="4_2" x="128" y="256" width="64" height="64"/>
+    <SubTexture name="4_3" x="192" y="256" width="64" height="64"/>
+    <SubTexture name="4_4" x="256" y="256" width="64" height="64"/>
+    <SubTexture name="4_5" x="320" y="256" width="64" height="64"/>
+    <SubTexture name="4_6" x="384" y="256" width="64" height="64"/>
+    <SubTexture name="4_7" x="448" y="256" width="64" height="64"/>
+    <SubTexture name="4_8" x="512" y="256" width="64" height="64"/>
+    <SubTexture name="4_9" x="576" y="256" width="64" height="64"/>
+    <SubTexture name="4_10" x="640" y="256" width="64" height="64"/>
+    <SubTexture name="4_11" x="704" y="256" width="64" height="64"/>
+    <SubTexture name="4_12" x="768" y="256" width="64" height="64"/>
+    <SubTexture name="4_13" x="832" y="256" width="64" height="64"/>
+    <SubTexture name="4_14" x="896" y="256" width="64" height="64"/>
+    <SubTexture name="4_15" x="960" y="256" width="64" height="64"/>
+    <SubTexture name="5_0" x="0" y="320" width="64" height="64"/>
+    <SubTexture name="5_1" x="64" y="320" width="64" height="64"/>
+    <SubTexture name="5_2" x="128" y="320" width="64" height="64"/>
+    <SubTexture name="5_3" x="192" y="320" width="64" height="64"/>
+    <SubTexture name="5_4" x="256" y="320" width="64" height="64"/>
+    <SubTexture name="5_5" x="320" y="320" width="64" height="64"/>
+    <SubTexture name="5_6" x="384" y="320" width="64" height="64"/>
+    <SubTexture name="5_7" x="448" y="320" width="64" height="64"/>
+    <SubTexture name="5_8" x="512" y="320" width="64" height="64"/>
+    <SubTexture name="5_9" x="576" y="320" width="64" height="64"/>
+    <SubTexture name="5_10" x="640" y="320" width="64" height="64"/>
+    <SubTexture name="5_11" x="704" y="320" width="64" height="64"/>
+    <SubTexture name="5_12" x="768" y="320" width="64" height="64"/>
+    <SubTexture name="5_13" x="832" y="320" width="64" height="64"/>
+    <SubTexture name="5_14" x="896" y="320" width="64" height="64"/>
+    <SubTexture name="5_15" x="960" y="320" width="64" height="64"/>
+    <SubTexture name="6_0" x="0" y="384" width="64" height="64"/>
+    <SubTexture name="6_1" x="64" y="384" width="64" height="64"/>
+    <SubTexture name="6_2" x="128" y="384" width="64" height="64"/>
+    <SubTexture name="6_3" x="192" y="384" width="64" height="64"/>
+    <SubTexture name="6_4" x="256" y="384" width="64" height="64"/>
+    <SubTexture name="6_5" x="320" y="384" width="64" height="64"/>
+    <SubTexture name="6_6" x="384" y="384" width="64" height="64"/>
+    <SubTexture name="6_7" x="448" y="384" width="64" height="64"/>
+    <SubTexture name="6_8" x="512" y="384" width="64" height="64"/>
+    <SubTexture name="6_9" x="576" y="384" width="64" height="64"/>
+    <SubTexture name="6_10" x="640" y="384" width="64" height="64"/>
+    <SubTexture name="6_11" x="704" y="384" width="64" height="64"/>
+    <SubTexture name="6_12" x="768" y="384" width="64" height="64"/>
+    <SubTexture name="6_13" x="832" y="384" width="64" height="64"/>
+    <SubTexture name="6_14" x="896" y="384" width="64" height="64"/>
+    <SubTexture name="6_15" x="960" y="384" width="64" height="64"/>
+    <SubTexture name="7_0" x="0" y="448" width="64" height="64"/>
+    <SubTexture name="7_1" x="64" y="448" width="64" height="64"/>
+    <SubTexture name="7_2" x="128" y="448" width="64" height="64"/>
+    <SubTexture name="7_3" x="192" y="448" width="64" height="64"/>
+    <SubTexture name="7_4" x="256" y="448" width="64" height="64"/>
+    <SubTexture name="7_5" x="320" y="448" width="64" height="64"/>
+    <SubTexture name="7_6" x="384" y="448" width="64" height="64"/>
+    <SubTexture name="7_7" x="448" y="448" width="64" height="64"/>
+    <SubTexture name="7_8" x="512" y="448" width="64" height="64"/>
+    <SubTexture name="7_9" x="576" y="448" width="64" height="64"/>
+    <SubTexture name="7_10" x="640" y="448" width="64" height="64"/>
+    <SubTexture name="7_11" x="704" y="448" width="64" height="64"/>
+    <SubTexture name="7_12" x="768" y="448" width="64" height="64"/>
+    <SubTexture name="7_13" x="832" y="448" width="64" height="64"/>
+    <SubTexture name="7_14" x="896" y="448" width="64" height="64"/>
+    <SubTexture name="7_15" x="960" y="448" width="64" height="64"/>
+
+</TextureAtlas>

BIN
SpaceGame/Resources/Sprites/green_beam.png


BIN
SpaceGame/Resources/Sprites/space_background.png


BIN
SpaceGame/Resources/Sprites/spacegame_sheet.png


+ 11 - 0
SpaceGame/Resources/Sprites/spacegame_sheet.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Created with TexturePacker http://www.codeandweb.com/texturepacker-->
+<!-- $TexturePacker:SmartUpdate:1a17c841c2e0285d52a986d357f78c54:1/1$ -->
+<TextureAtlas imagePath="spacegame_sheet.png">
+    <SubTexture name="spaceship_cricket" x="2" y="170" width="127" height="184" frameX="-1" frameY="0" frameWidth="129" frameHeight="184"/>
+    <SubTexture name="spaceship_flea" x="186" y="50" width="48" height="41"/>
+    <SubTexture name="spaceship_locust" x="2" y="2" width="182" height="166"/>
+    <SubTexture name="spaceship_louse" x="186" y="2" width="60" height="46"/>
+    <SubTexture name="spaceship_mantis" x="131" y="274" width="87" height="104"/>
+    <SubTexture name="spaceship_scarab" x="131" y="170" width="105" height="102"/>
+</TextureAtlas>

BIN
SpaceGame/Resources/Sprites/spaceship_cricket.png


BIN
SpaceGame/Resources/Sprites/spaceship_flea.png


BIN
SpaceGame/Resources/Sprites/spaceship_locust.png


BIN
SpaceGame/Resources/Sprites/spaceship_louse.png


BIN
SpaceGame/Resources/Sprites/spaceship_mantis.png


BIN
SpaceGame/Resources/Sprites/spaceship_scarab.png


+ 1 - 0
SpaceGame/SpaceGame.atomic

@@ -0,0 +1 @@
+Hello!