more debug

This commit is contained in:
Brad Hefta-Gaub 2015-09-29 13:28:45 -07:00
parent fdb9455540
commit 4abb251728

View file

@ -76,9 +76,13 @@ function update(deltaTime) {
totalTime += deltaTime;
var intensity = (MINIMUM_LIGHT_INTENSITY + (MAXIMUM_LIGHT_INTENSITY + (Math.sin(totalTime) * MAXIMUM_LIGHT_INTENSITY)));
intensity += randFloat(-LIGHT_INTENSITY_RANDOMNESS, LIGHT_INTENSITY_RANDOMNESS);
var properties = Entities.getEntityProperties(LightMaker.light, "age");
var properties = Entities.getEntityProperties(LightMaker.light, ["age", "lifetime"]);
print("props:" +JSON.stringify(properties));
print("age:" + properties.age);
Entities.editEntity(LightMaker.light, { intensity: intensity, lifetime: properties.age + EPHEMERAL_LIFETIME });
print("lifetime:" + properties.lifetime);
var newLifetime = properties.age + EPHEMERAL_LIFETIME;
print("newLifetime:" + newLifetime);
Entities.editEntity(LightMaker.light, { intensity : intensity, lifetime: newLifetime });
}
}