---
tags : introductory-task
---
# TEAM 2, meeting 14-02-2023
- Henri sets up the branch to the right commit from the example repo
- The team reads the markdown document and commits the relevant changes
## Goal
1) Cube which can rotate
2) Arrowtoets ingedrukt : ease in tot bepaalde snelheid. Ingedrukt houden : die snelheid aanhouden
3) Toets loslaten : ease out
4) Als twee tegengestelde toetsen ingedrukt : stilvallen, als daarna één van de twee losgelaten : terug versnellen in de andere richting
4) 3 seconden geen actie? random rotations,
## Tasks
- Henri :
- Opzetten file structuur & display :
- cube die kan geroteerd worden in html en css
- chat-client.js
- lib/rotations.js
- lib/input.js
- functie voor start/stop rotatie (lib/rotation.js)
- direction : 0 for horizontal right, 1 for horizontal left, 2 for vertical up, 3 for vertical down
- startStop : 0 for stop, 1 for start
```js
function rotate(direction, startStop);
```
- Emiel :
- indrukken toetsen handlers
- Installing (chat-client.js), e.g. (idem keyup)
```js
document.addEventListener("keydown", keyDownHandler)
```
- Installing timer for the random keypresses (chat-client.js) with setTimeout
- Remembering wich keys are being held down (chat-client.js) :
```js
export let heldDown = [0,0,0,0] // Left,Right,Up,Down key
```
- Remembering in which direction the cube is rotating (chat-client.js) :
```js
export let currentRotation = [0, 0, 0, 0]; // Left,Right,Up,Down (only one of left and right may be true, same for up and down)
```
- Definition keyDownHandler/keyUpHandler (lib/input.js)
- call the method in lib/rotations.js with correct parameters
- Sets the heldDown variable
- Sets the currentRotation variable
- Remove the random motion timer at keypress, set it when no keys are currently being held
```js
function keyDownHandler(key);
function keyUpHandler(key);
```
- random motion (lib/input.js) :
- Determines random timings for start and stop
- Sets the currentRotation variable
- Sets the timers to stop the rotation (and potentially also timers to start a new rotation if still no keys were pressed after the stop)
```js
function performRandomMotion();
```