Browse Source

Adding NativePluginExample skeleton

JoshEngebretson 10 years ago
parent
commit
9e6e7241db

+ 9 - 0
NativePluginExample/NativePluginExample.atomic

@@ -0,0 +1,9 @@
+{
+   "version": 1,
+   "project": {
+      "version": "1.0.0"
+   },
+   "platforms": [
+      "mac", "windows"
+   ]
+}

+ 16 - 0
NativePluginExample/Resources/Components/Star.js

@@ -0,0 +1,16 @@
+var game = Atomic.game;
+var node = self.node;
+
+function start() {
+
+	var sprite2D = node.createComponent("StaticSprite2D");
+	sprite2D.sprite = game.getSprite2D("Sprites/star.png");
+	sprite2D.blendMode = Atomic.BLEND_ALPHA;
+	
+}
+
+function update(timeStep) {	
+
+	node.roll(timeStep * 100);
+
+}

+ 25 - 0
NativePluginExample/Resources/Scripts/main.js

@@ -0,0 +1,25 @@
+
+// This script is the main entry point of the game
+require("AtomicGame");
+
+Atomic.game.init(start, update);
+
+
+// called at the start of play
+function start() {
+
+	var game = Atomic.game;
+
+	// create a 2D scene
+	game.createScene2D();
+
+    var spaceNode = game.scene.createChild("Star");
+    spaceNode.createJSComponent("Star");
+
+}
+
+// called per frame
+function update(timeStep) {
+
+
+}

BIN
NativePluginExample/Resources/Sprites/star.png