Commits

Anonymous committed ae999e7

mark the correctness/incorrectness of the sequence

Comments (0)

Files changed (3)

checkmark.png

Added
New image
     display3d.setCamera(camera);
     display3d.setVideo(video.viewReality.camera, video.viewReality.scene);
 
-    var generateParticleSystem = function(color, width,height,depth) {
-        var base = createBaseModel();
-        var particleCount = 300;
-        var particles = new THREE.Geometry();
-        var pMaterial = new THREE.ParticleBasicMaterial({
-                color: color,
-                size: 50,
-                map: THREE.ImageUtils.loadTexture("particle.png"),
-                blending: THREE.AdditiveBlending,
-                transparent: true
-            });
-
-        for(var p = 0; p < particleCount; p++) {
-            var pX = Math.random() * width - width/2,
-                pY = Math.random() * height - height/2,
-                pZ = Math.random() * depth/3 - 5,
-                particle = new THREE.Vector3(pX, pY, pZ);
-
-            particles.vertices.push(particle);
-        }
-          
-        // create the particle system
-        var particleSystem = new THREE.ParticleSystem( particles, pMaterial);
-        particleSystem.sortParticles = true;
-        base.model.add(particleSystem);
-        return base;
-    }
-
-
     var notifyWarpHoleState = undefined;
    
     var createBaseModel = function() {
         return result;
     }
 
-    scene.add(createReticule());
+
 
     var createOccluderModel = function() {
         var gap = 0.5;
         }
     }
 
+    var createMarkModel = function(size, image) {
+        var material = new THREE.MeshBasicMaterial({map:image, transparent:true, side:THREE.DoubleSide});
+        var geometry = new THREE.PlaneGeometry(size,size);
+        return new THREE.Mesh(geometry, material);
+    }
 
     var createDoorModel = function(width, height, images) {
 
         b: THREE.ImageUtils.loadTexture('star_b.png'),
     }
 
+    var markImages = {
+        correct: THREE.ImageUtils.loadTexture('checkmark.png'),
+        incorrect: THREE.ImageUtils.loadTexture('xmark.png'),
+    }
+
+    scene.add(createReticule());
+
     var warpHoleTextures = {
         8: starImages,
         2: pentagonImages,
         ballHolderPosition = 0;
     }
 
+    var marks = [];
+    var addMark = function( position, correct ) {
+        var mark = createMarkModel(5, correct ? markImages.correct : markImages.incorrect );
+        mark.position.set( position.x, position.y, position.z );
+        scene.add(mark);
+        marks.push(mark);
+        console.log("adding:",marks);
+    }
+
+    var clearMarks = function() {
+        console.log("clear:",marks);
+        marks.forEach( function(object) {
+            scene.remove(object);
+        });
+        marks.length = 0;
+    }
+
     var leftMostCenter = -15;
     var ballPosition = 0;
     var addBall = function(ballType) {
         });
         tween.onComplete( function() {
             state.push(ballType);
-            updateObjective();
+            var correct = updateObjective();
+            addMark( position, correct );
         });
         ball.position.set(position.x,position.y,position.z);
         tween.start();
     var loadWorld = function(level) {
         clearBallHolders();
         clearBalls();
+        clearMarks();
         leftMostCenter = -((level.objective.length-1)*5)/2;
 
         objective = level.objective;
             if( objectiveIndex === objective.length ) {
                 notifyObjective(true);
             }
+            return true;
         }
         else {
             notifyObjective(false);
+            return false;
         }
     }
 
Added
New image