diff --git a/defines/editor.js b/defines/editor.js new file mode 100644 index 0000000..a3d2723 --- /dev/null +++ b/defines/editor.js @@ -0,0 +1 @@ +//#define EDITOR__ diff --git a/defines/runtime.js b/defines/runtime.js new file mode 100644 index 0000000..a3097b4 --- /dev/null +++ b/defines/runtime.js @@ -0,0 +1 @@ +//#define RUNTIME__ \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index cb8c9f7..e247c14 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -62,7 +62,7 @@ gulp.task( gulp.task('compileRuntime', ['build'], function() { - gulp.src(['./build/defines/runtime.js', './build/game-lib.js']) + gulp.src(['./defines/runtime.js', './build/game-lib.js']) .pipe(concat('game-lib-runtime.js')) .pipe(preprocessor( { @@ -101,7 +101,7 @@ gulp.task('compileRuntime', ['build'], gulp.task('compileEditor', ['build'], function() { - gulp.src(['./build/defines/editor.js', './build/game-lib.js']) + gulp.src(['./defines/editor.js', './build/game-lib.js']) .pipe(concat('game-lib-editor.js')) .pipe(preprocessor( { diff --git a/src/game-lib-component-path-controls.js b/src/game-lib-component-path-controls.js index 5f67ed7..524f944 100644 --- a/src/game-lib-component-path-controls.js +++ b/src/game-lib-component-path-controls.js @@ -47,12 +47,10 @@ GameLib.D3.ComponentPathControls.prototype.onUpdate = function( this.pathFollowingComponent.offset.x = 0; this.pathFollowingComponent.offset.y = 0; this.pathFollowingComponent.offset.z = 1; - // also: set offset scale } else if (this.keyRightPressed) { // Right [l] this.pathFollowingComponent.offset.x = 0; this.pathFollowingComponent.offset.y = 0; this.pathFollowingComponent.offset.z = -1; - // also: set offset scale } }; diff --git a/src/game-lib-component-path-following.js b/src/game-lib-component-path-following.js index 63d94ed..9df5ec1 100644 --- a/src/game-lib-component-path-following.js +++ b/src/game-lib-component-path-following.js @@ -6,6 +6,7 @@ * @param accel * @param maxSpeed * @param baseOffset + * @param maxOffset * @constructor */ GameLib.D3.ComponentPathFollowing = function ComponentPathFollowing( @@ -14,7 +15,8 @@ GameLib.D3.ComponentPathFollowing = function ComponentPathFollowing( splineCurve3, accel, maxSpeed, - baseOffset + baseOffset, + maxOffset ) { this.id = id || GameLib.D3.Tools.RandomId(); @@ -28,15 +30,16 @@ GameLib.D3.ComponentPathFollowing = function ComponentPathFollowing( this.maxSpeed = maxSpeed || 10.0; this.accel = accel || 2.0; this.baseOffset = baseOffset || new GameLib.D3.Vector3(); + this.maxOffset = maxOffset || new GameLib.D3.Vector3(); // runtime code + this.offset = new GameLib.D3.Vector3(); // this one is our destination offset + this.currentPathValue = 0.0; - this.offset = new GameLib.D3.Vector3(); this.currentSpeed = 0.0; this.direction = 0; - GameLib.D3.Utils.Extend(GameLib.D3.ComponentPathFollowing, GameLib.D3.ComponentInterface); };