Skip to content

Commit 42612ef

Browse files
author
Raphael Brand
committed
drifting ...
1 parent 20e1da4 commit 42612ef

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

demo/app/js/acceleration.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use strict";
22
define('acceleration', () => {
3+
this.onMove = Function;
34
var move = undefined;
45
var draw = undefined;
56
var printMap = undefined;
@@ -31,12 +32,11 @@ define('acceleration', () => {
3132
return true;
3233
};
3334
this.getPosition = function() {
34-
console.log(playerAt);
3535
let pos = playerAt;
3636
pos.z = pos.y; // mhh ...
37+
console.dir(pos);
3738
return playerAt ? pos : playerPosition
3839
}
39-
this.onMove;
4040
var onKeyDown = function onKeyDown(e) {
4141
var code = codes[e.keyCode] ? codes[e.keyCode] : e.target.className;
4242

demo/app/js/main.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ define('start', ['test-module', 'acceleration'], function (test, acc) {
2020

2121
require(['three-scene', 'start'], (Scene, acc) => {
2222
// Scene.animate({ rotation: { speed: { x: 0.01, y: 0 } } });
23-
Scene.animate({ position: { x: 100, y: 30 } })
24-
acc.onMove(acc.getPosition)
23+
// Scene.animate({ position: { x: 100, y: 30 } })
24+
let setPosition = () => {
25+
Scene.animate({ position: acc.getPosition() })
26+
}
27+
acc.onMove(setPosition);
2528
})

0 commit comments

Comments
 (0)