add blocky

This commit is contained in:
James B. Pollack 2016-05-21 11:43:12 -07:00
parent 6bc745ee01
commit 5211b6ad77
2 changed files with 22 additions and 13 deletions

View file

@ -42,33 +42,33 @@ var BLOCK_NATURAL = {
};
var blocks = [
BLOCK_RED, BLOCK_BLUE, BLOCK_YELLOW, BLOCK_GREEN, BLOCK_SMALL_CUBE
BLOCK_RED, BLOCK_BLUE, BLOCK_YELLOW, BLOCK_GREEN, BLOCK_NATURAL
];
var arrangements = [{
name: 'tall',
blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_GREEN, ],
target: Script.resolvePath("arrangement1.json")
blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_GREEN],
target: "atp:/blocky/arrangement1A.json"
}, {
name: 'ostrich',
blocks: [BLOCK_RED, BLOCK_RED, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_NATURAL],
target: Script.resolvePath("arrangement2.json")
target: "atp:/blocky/arrangement2A.json"
}, {
name: 'froglog',
blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_GREEN, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL],
target: Script.resolvePath("arrangement3.json")
target: "atp:/blocky/arrangement3A.json"
}, {
name: 'allOneLeg',
blocks: [BLOCK_RED, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_BLUE, BLOCK_BLUE, BLOCK_NATURAL],
target: Script.resolvePath("arrangement4.json")
target: "atp:/blocky/arrangement4A.json"
}, {
name: 'threeppl',
blocks: [BLOCK_BLUE BLOCK_YELLOW, BLOCK_BLUE, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL],
target: Script.resolvePath("arrangement5.json")
blocks: [BLOCK_BLUE, BLOCK_YELLOW, BLOCK_BLUE, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL],
target: "atp:/blocky/arrangement5B.json"
}, {
name: 'dominoes',
blocks: [BLOCK_RED, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW],
target: Script.resolvePath("arrangement6.json")
target: "atp:/blocky/arrangement6B.json"
}]
var PLAYABLE_BLOCKS_POSITION = {
@ -115,8 +115,9 @@ var TARGET_BLOCKS_POSITION = {
print('BLOCKY TARGET BLOCKS:: ' + this.targetBlocks);
},
createPlayableBlocks: function(arrangement) {
print('BLOCKY creating playable blocks');
print('BLOCKY creating playable blocks' + arrangement.blocks.length);
arrangement.blocks.forEach(function(block) {
print('BLOCKY in a block loop')
var blockProps = {
name: "home_model_blocky_block",
type: 'Model',
@ -145,9 +146,13 @@ var TARGET_BLOCKS_POSITION = {
},
position: PLAYABLE_BLOCKS_POSITION
}
this.playableBlocks.push(Entities.addEntity(blockProps));
var newBlock = Entities.addEntity(blockProps);
print('BLOCKY made a playable block' + newBlock)
_this.playableBlocks.push(newBlock);
print('BLOCKY pushing it into playable blocks');
})
print('BLOCKY after going through playable arrangement')
},
startNearTrigger: function() {
print('BLOCKY got a near trigger');

View file

@ -43,6 +43,8 @@
var transformerPath = Script.resolvePath("atp:/dressingRoom/wrapper.js");
var blockyPath = Script.resolvePath("atp:/blocky/wrapper.js");
Script.include(utilsPath);
Script.include(kineticPath);
@ -53,6 +55,7 @@
Script.include(cuckooClockPath);
Script.include(pingPongGunPath);
Script.include(transformerPath);
Script.include(blockyPath);
var TRANSFORMER_URL_ROBOT = 'atp:/dressingRoom/simple_robot.fbx';
@ -327,6 +330,7 @@
y: 179.0293,
z: 89.9698
});
print('home before cuckooClock')
var cuckooClock = new MyCuckooClock({
x: 1105.5237,
@ -337,7 +341,7 @@
y: -57.0089,
z: -0.0013
});
print('home after cuckooClock')
var blocky = new BlockyGame({
x: 1098.27,
y: 460.43,