Added FPS meter
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
function CubeEntity() {
|
||||
Entity.call(this);
|
||||
|
||||
this.add(POSITION);
|
||||
this.position.position = new Vec3(1, 0, 0);
|
||||
this.add(MESH);
|
||||
this.add(MATERIAL);
|
||||
}
|
||||
@@ -11,12 +9,12 @@ CubeEntity.prototype = Object.create(Entity.prototype);
|
||||
CubeEntity.prototype.constructor = CubeEntity;
|
||||
|
||||
CubeEntity.prototype.update = function() {
|
||||
var speed = 3.0;
|
||||
var move = Input.axis2D(INPUT_ACTION_LEFT, INPUT_ACTION_RIGHT, INPUT_ACTION_UP, INPUT_ACTION_DOWN);
|
||||
this.position.position.x += move.x * speed * TIME.delta;
|
||||
this.position.position.z += move.y * speed * TIME.delta;
|
||||
this.position.rotation.x += 3 * TIME.delta;
|
||||
this.position.rotation.z += 2 * TIME.delta;
|
||||
// var speed = 3.0;
|
||||
// var move = Input.axis2D(INPUT_ACTION_LEFT, INPUT_ACTION_RIGHT, INPUT_ACTION_UP, INPUT_ACTION_DOWN);
|
||||
// this.position.position.x += move.x * speed * TIME.delta;
|
||||
// this.position.position.z += move.y * speed * TIME.delta;
|
||||
// this.position.rotation.x += 3 * TIME.delta;
|
||||
// this.position.rotation.z += 2 * TIME.delta;
|
||||
this.material.setColor(Color.rainbow());
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user