Browse Source

Adding RoboMan

Josh Engebretson 11 years ago
parent
commit
082c7c4aaf

+ 31 - 0
RoboMan/Resources/Components/RoboMan.js

@@ -0,0 +1,31 @@
+
+var game = Atomic.game;
+var node = self.node;
+
+RoboMan = self;
+
+
+function start() {
+
+    var cache = game.cache;
+
+    var model = node.createComponent("AnimatedModel");
+    model.setModel(cache.getResource("Model", "Models/RoboMan.mdl"));
+    model.setMaterial(cache.getResource("Material", "Materials/Robot_01_Diffuse.xml"));
+    
+    var animCtrl = node.createComponent("AnimationController");
+    animCtrl.playExclusive("Models/RoboMan_Normal_Run.ani", 0, true, 0.0);
+
+    game.cameraNode.position = [0, 2, -10];
+    
+    node.yaw(180);
+
+
+}
+
+// we need an update or it doesn't run the start, fix in JSVM
+function update(timeStep) {
+
+    node.yaw(timeStep * 100);
+
+}

+ 25 - 0
RoboMan/Resources/Components/Scene.js

@@ -0,0 +1,25 @@
+
+var game = Atomic.game;
+var node = self.node;
+
+
+function start() {
+
+	var scene = game.scene;
+
+    var lightNode = scene.createChild("Directional Light");
+    lightNode.direction = [0.6, -1.0, 0.8];
+    var light = lightNode.createComponent("Light")
+    light.lightType = Atomic.LIGHT_DIRECTIONAL;
+
+    // add the roboman
+    var roboman = node.createChild("TheRoboMan");
+    roboman.createJSComponent("RoboMan");
+
+
+}
+
+// we need an update or it doesn't run the start, fix in JSVM
+function update(timeStep) {
+
+}

+ 5 - 0
RoboMan/Resources/Materials/Robot_01_Diffuse.xml

@@ -0,0 +1,5 @@
+<material>
+    <technique name="Techniques/Diff.xml" />
+    <texture unit="diffuse" name="Textures/Robot_01_Diffuse.png" />
+    <parameter name="MatSpecColor" value="0.1 0.1 0.1 16" />
+</material>

BIN
RoboMan/Resources/Models/RoboMan.mdl


BIN
RoboMan/Resources/Models/RoboMan_Attack_Idle.ani


BIN
RoboMan/Resources/Models/RoboMan_Attack_JumpFall.ani


BIN
RoboMan/Resources/Models/RoboMan_Attack_Run.ani


BIN
RoboMan/Resources/Models/RoboMan_Crouch_Idle.ani


BIN
RoboMan/Resources/Models/RoboMan_Crouch_Walk.ani


BIN
RoboMan/Resources/Models/RoboMan_Normal_Idle.ani


BIN
RoboMan/Resources/Models/RoboMan_Normal_JumpFall.ani


BIN
RoboMan/Resources/Models/RoboMan_Normal_Run.ani


BIN
RoboMan/Resources/Models/RoboMan_Normal_Walk.ani


+ 22 - 0
RoboMan/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.createScene3D();
+
+	// create the game component
+	var node = game.scene.createChild("TheScene");
+	node.createJSComponent("Scene");
+
+}
+
+// called per frame
+function Update(timeStep) {
+
+
+}

BIN
RoboMan/Resources/Textures/Robot_01_Diffuse.png


+ 0 - 0
RoboMan/RoboMan.atomic


BIN
RoboMan/SourceArt/RoboMan/Robo_01.fbx


BIN
RoboMan/SourceArt/RoboMan/Robot_01_Diffuse.png


BIN
RoboMan/SourceArt/RoboMan/animation_frames.png