raise walls so they dont clip the ground
This commit is contained in:
@@ -1,24 +1,27 @@
|
||||
import {BEAT_WARMUP_OFFSET, BEAT_WARMUP_SPEED, BEAT_WARMUP_TIME} from '../constants/beat';
|
||||
|
||||
// So wall does not clip the stage ground.
|
||||
const RAISE_Y_OFFSET = 0.1;
|
||||
|
||||
/**
|
||||
* Wall speed and haptics.
|
||||
* Wall to dodge.
|
||||
*/
|
||||
AFRAME.registerComponent('wall', {
|
||||
schema: {
|
||||
anticipationPosition: {default: 0},
|
||||
durationSeconds: {default: 0},
|
||||
height: {default: 1.3},
|
||||
horizontalPosition: {default: 'middleleft', oneOf: ['left', 'middleleft', 'middleright', 'right']},
|
||||
speed: {default: 1.0},
|
||||
warmupPosition: {default: 0},
|
||||
height: {default: 1.3},
|
||||
width: {default: 1}
|
||||
},
|
||||
|
||||
horizontalPositions: {
|
||||
'left': -0.75,
|
||||
'middleleft': -0.25,
|
||||
'middleright': 0.25,
|
||||
'right': 0.75
|
||||
left: -0.75,
|
||||
middleleft: -0.25,
|
||||
middleright: 0.25,
|
||||
right: 0.75
|
||||
},
|
||||
|
||||
init: function () {
|
||||
@@ -30,7 +33,7 @@ AFRAME.registerComponent('wall', {
|
||||
const data = this.data;
|
||||
el.object3D.position.set(
|
||||
this.horizontalPositions[data.horizontalPosition],
|
||||
data.height,
|
||||
data.height + RAISE_Y_OFFSET,
|
||||
data.anticipationPosition + data.warmupPosition + data.durationSeconds * data.speed / 2
|
||||
);
|
||||
el.object3D.scale.set(data.width * 0.30, 2.5, data.durationSeconds * data.speed);
|
||||
|
||||
Reference in New Issue
Block a user