From dd185f67ddb1b6dabd686a58ebbfc18e03faeea4 Mon Sep 17 00:00:00 2001 From: platane Date: Wed, 13 Sep 2017 12:45:01 +0200 Subject: [PATCH] :rocket: --- game/src/1 | 2 +- game/src/2 | 2 +- game/src/a.js | 103 ++++++++++++++++++++++++++++++++++++++------------ 3 files changed, 81 insertions(+), 26 deletions(-) diff --git a/game/src/1 b/game/src/1 index 43954c6..489cac2 100644 --- a/game/src/1 +++ b/game/src/1 @@ -1 +1 @@ -39,7,5,254,252,167,242,255,187,131,187,225,41,233,128,204,154,149,60,130,158,37,188,10,223,206,234,68,84,172,201,187,211,37,81,4,231,252,247,4,244,39,43,39,238,71,179,212,201,161,110,92,197,232,252,53,90,106,201,163,154,67,61,178,176,95,33,116,156,163,186,91,33,132,213,173,0,168,42,200,204,145,169,86,249,8,4,0,104,138,4,96,173,36,244,171,3,32,211,24,8,193,90,241,34,94,72,170,192,82,30,234,239,179,134,118,145,89,162,210,68,240,25,225,26,91,49,198,5,49,136,141,122,8,98 \ No newline at end of file +12,225,80,83,254,119,48,153,41,129,243,43,233,156,225,104,118,183,17,136,255,63,203,229,234,223,128,164,11,169,250,210,82,125,111,150,106,195,100,144,188,226,14,32,191,83,214,104,35,114,14,100,197,179,222,121,168,115,44,134,220,10,155,84,2,106,148,200,128,137,196,98,121,56,137,224,96,35,98,70,117,25,8,217,240,90,83,77,231,16,106,105,137,1,0,129,193,17,56,79,1,144,182,57,128,112,79,48,157,69,84,31,102,147,215,31,48,192,117,2,198,96,28,139,139,78,58,144,104,96,0,40,144,69,0 \ No newline at end of file diff --git a/game/src/2 b/game/src/2 index 489cac2..984c321 100644 --- a/game/src/2 +++ b/game/src/2 @@ -1 +1 @@ -12,225,80,83,254,119,48,153,41,129,243,43,233,156,225,104,118,183,17,136,255,63,203,229,234,223,128,164,11,169,250,210,82,125,111,150,106,195,100,144,188,226,14,32,191,83,214,104,35,114,14,100,197,179,222,121,168,115,44,134,220,10,155,84,2,106,148,200,128,137,196,98,121,56,137,224,96,35,98,70,117,25,8,217,240,90,83,77,231,16,106,105,137,1,0,129,193,17,56,79,1,144,182,57,128,112,79,48,157,69,84,31,102,147,215,31,48,192,117,2,198,96,28,139,139,78,58,144,104,96,0,40,144,69,0 \ No newline at end of file +228,198,36,14,255,103,240,255,187,131,77,1,210,216,146,7,86,215,80,171,33,43,226,250,52,225,85,192,210,102,62,78,242,156,9,150,86,170,23,177,164,85,228,154,200,84,178,240,139,146,78,79,9,64,102,65,4,58,158,4,205,221,157,46,249,139,40,164,93,99,22,139,40,0,248,135,235,130,122,8,98,26,158,172,193,126,133,208,56,143,128,254,129,204,248,67,100,1,175,76,100,192,89,41,192,24,2,53,60,72,168,33,44,17,168,173,24,227,62,226,4,32,178,34,182,207,16,214,220,252,25,163,1,25,34 \ No newline at end of file diff --git a/game/src/a.js b/game/src/a.js index 31bb1e4..ebc797e 100644 --- a/game/src/a.js +++ b/game/src/a.js @@ -132,52 +132,105 @@ const texts = [ ['Find "Starry nigth"'], ['by Van Gogh'], ['in the room to your'], + ['left'], + ], + [ + ['Great!'], + [], + ['Find "Scream"'], + ['by Munch'], + ['in the room to your'], ['right'], ], + [ + ['OK!'], + [], + ['Next:'], + ['"The Great Wave"'], + ['by Hokusai'], + ['in this room'], + ], + [ + ['Nice!'], + [], + ['Next:'], + ['"La liberté"'], + ['by Delacroix'], + ['in the next room'], + ], + [['Nice!'], [], ["it's 12h30"], ['no more time'], ["let's say you win"]], ] const worldMap = - '# \n' + - ' # \n' + - ' ################### \n' + - ' # \n' + - ' ################# # \n' + - ' # # # \n' + - ' # # # \n' + - ' ################# #### \n' + - ' ## # # # \n' + - ' ## r l # \n' + - ' # # # \n' + - ' ########### ####### # # # \n' + - ' #### #### # l l 2 \n' + + ' \n' + + ' ########################### \n' + + ' # ########################### \n' + + ' # # ########## \n' + + ' # ##b# ##5# ##b# # # # \n' + + ' #6#7#8## r r 3 ##### # \n' + + ' # \n' + + ' # # \n' + + ' # 4 r r ########## \n' + + ' # ##t# ##t# ##t# # # \n' + + ' # # # \n' + + ' # ###################### ### \n' + + ' #################### ###### # # \n' + + ' # ################### #### \n' + + ' # ## # # # \n' + + ' # # # ## r l 2 \n' + + ' # # # # \n' + + ' # ########### ####### # # # \n' + + ' #### #### # l l # \n' + ' # # # # # ###### \n' + ' # # # # # # \n' + - ' r t 1 l # l l #### # \n' + + ' r l # l l #### # \n' + ' # #### # # # # # \n' + - ' # # # # # # \n' + + ' # 1 # # # # # \n' + ' # #### r l # # # \n' + - ' r b b l # # # # # # \n' + + ' r l # # # # # # \n' + ' # # ################ ####### # \n' + - ' # # # # \n' + + ' # # # # \n' + ' #### ###### ########### \n' + - ' # # \n' + + ' # # \n' + ' # # ' const getCell = x => { switch (x) { + // mona lisa case '1': return [null, 1, null, null] + + /// starry night case '2': return [null, null, 2, null] + // scream + case '3': + return [3, null, null, null] + + // the great wave + case '4': + return [4, null, null, null] + + // delacroix + case '5': + return [null, 5, null, null] + + case '6': + return [null, 6, null, null] + case '7': + return [null, 7, null, null] + case '8': + return [null, 8, null, null] + case 'l': return [null, null, Math.floor(Math.random() * 10) + 20, null] case 't': - return [null, Math.floor(Math.random() * 10) + 20, null, null] + return [null, null, null, Math.floor(Math.random() * 10) + 20] case 'r': return [Math.floor(Math.random() * 10) + 20, null, null, null] case 'b': - return [null, null, null, Math.floor(Math.random() * 10) + 20] + return [null, Math.floor(Math.random() * 10) + 20, null, null] default: return [null, null, null, null] @@ -190,7 +243,7 @@ const world = { .map(line => line.split('').map(c => (c === ' ' ? 0 : getCell(c)))), tim: { - position: { x: 24.5, y: 31.5 }, + position: { x: 30.5, y: 31.5 }, direction: { x: 0, y: 1 }, }, @@ -643,7 +696,7 @@ const generateMazeObject = world => { const object = new THREE.Object3D() - object.position.set(24, 1.2, 30) + object.position.set(30, 1.2, 30) object.rotation.y = 0 @@ -697,9 +750,11 @@ AFRAME.registerComponent('museum', { container.add(generateMazeObject(world.worldGrid)) Promise.all( - '12' + '12345678' .split('') - .map((x, i) => readPainting(x).then(p => (paintings[i] = p))) + .map((x, i) => + readPainting(x).then(p => (paintings[i + 1] = p)) + ) ).then(() => { this.p = generatePaintings(world.worldGrid) container.add(this.p.object)