JSFiddle - React, Tailwind, and code Playground

by Michael Prosser

JavaScript

// CLIMB TRACK FOR SCUBANAUT

function Climb(data){
	
	Climb.prototype.setData(data);
	
}

Climb.prototype.data = [];
Climb.prototype.observable;
Climb.prototype.flagMeshStake; // the non-emissive part of the flag
Climb.prototype.flagMeshBulb; // the non-emissive part of the flag


// DATA Required in the form of an array of objects with the format:

/*

{
	position: V3,
  rotation: V3,
  onReached: function(){
  	// what happens when they have reached the flag
  },
  reached: false

}


*/

Climb.prototype.setData = function(data){

	Climb.prototype.data = data;

}

Climb.prototype.buildFlagMeshes = function(){

	

}

Climb.prototype.buildFlag = function(){

	

}




// EXAMPLE OF CREATING ANEW INSTANCE OF THE PROTOTYPE

var c = new Climb([
	{
    position: { x: 0, y: 0, z: 0 },
    rotation: { x: 0, y: 0, z: 0 },
    onReached: function(){

    },
    reached: false
  },
  {
    position: { x: 10, y: 10, z: 10 },
    rotation: { x: 0, y: 0, z: 0 },
    onReached: function(){

    },
    reached: false
  }
]);

console.log(c);