This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, {useState} from 'react'; | |
| import {SketchPicker} from 'react-color'; | |
| import Canvas3D from './Canvas3D'; | |
| import contreplaque from './contreplaque.jpg'; | |
| import okoume from './okoume.jpg'; | |
| import '../styles/App.scss'; | |
| function useObjectState(initial) { | |
| const [state, setState] = React.useState(initial); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, {useState} from 'react'; | |
| import {SketchPicker} from 'react-color'; | |
| import Canvas3D from './Canvas3D'; | |
| import contreplaque from './contreplaque.jpg'; | |
| import okoume from './okoume.jpg'; | |
| import '../styles/App.scss'; | |
| const useObjectState = (initial) => { | |
| const [state, setState] = React.useState(initial); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "views", | |
| "version": "0.1.0", | |
| "private": true, | |
| "dependencies": { | |
| "auth0-js": "^9.13.2", | |
| "blend4web": "^17.12.0", | |
| "braintree-web-drop-in-react": "^1.1.1", | |
| "eslint": "^5.16.0", | |
| "eslint-config-react-app": "^5.2.1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default { | |
| rangee: 7, | |
| epaisseur: 0.003, | |
| largeurC: 0.068, | |
| largeurP: 0.100, | |
| largeurP: 0.100, | |
| nbCarreaux: new Array(49).fill(0).map((d, id) => ({id})), | |
| nbPeignes: new Array(12).fill(0).map((d, id) => ({id})), | |
| sequence: [ 3, 5, 2, 1, 2, 5, 3, 5, 0, 4, 3, 4, 0, 5, 2, 4, 1, 0, 1, 4, 2, 1, 3, 0, 6, 0, 3, 1, 2, 4, 1, 0, 1, 4, 2, 5, 0, 4, 3, 4, 0, 5, 3, 5, 2, 1, 2, 5, 3 ], | |
| couleur: "", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fanch@Portable:~/NandY$ npm start | |
| > [email protected] start /home/fanch/NandY | |
| > node ./bin/www | |
| internal/modules/cjs/loader.js:583 | |
| throw err; | |
| ^ | |
| Error: Cannot find module '/home/fanch/NandY/bin/www' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let playersList = {}; | |
| listeId.map((ident, i) => { | |
| playersList[ident] = { | |
| score : 0, | |
| x : 0, | |
| y : 0 | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createStore, useStoreState, action, useStoreActions, computed } from 'easy-peasy'; | |
| import React, {useEffect} from 'react'; | |
| import DatGui, { DatNumber, DatString, DatBoolean} from 'react-dat-gui'; | |
| import {socket} from '../Socket'; | |
| const store = createStore({ | |
| players : {}, | |
| movement : { | |
| up: false, | |
| down: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {useHotkeys} from 'react-hotkeys-hook' | |
| import { useStoreState, useStoreActions, action } from 'easy-peasy'; | |
| const KeyControls= (props) => { | |
| const moveUP = useStoreActions(action => action.moveUP) | |
| useHotkeys('up', event => { | |
| if (event.type === "keydown") { | |
| console.log("down"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express'); | |
| const app = express(); | |
| const server = require('http').Server(app); | |
| const io = require('socket.io')(server); | |
| io.set('origins', '*:*'); | |
| server.listen(3002); | |
| const players = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const store = createStore({ | |
| players : {}, | |
| movement : { | |
| up: false, | |
| down: false, | |
| left: false, | |
| right: false | |
| }, | |
| currentId : 0, | |
| score : computed(state => state.players[state.currentId].score), |