|
|
@ -41,46 +41,11 @@
|
|
|
|
diamond.sprite = engine.getSprite("diamond");
|
|
|
|
diamond.sprite = engine.getSprite("diamond");
|
|
|
|
diamond.draw_sprite = false;
|
|
|
|
diamond.draw_sprite = false;
|
|
|
|
diamond.onCreate = function() {
|
|
|
|
diamond.onCreate = function() {
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
@fade_step = 0.045
|
|
|
|
|
|
|
|
@fade_current_step = @fade_step
|
|
|
|
|
|
|
|
@fade_value = 0
|
|
|
|
|
|
|
|
@fade_decay_current = 9999 # Disable by default
|
|
|
|
|
|
|
|
@fade_decay_max = 8
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
this.fade_value = 0;
|
|
|
|
this.fade_value = 0;
|
|
|
|
this.shimmer_step = this.engine.random.number(0.003, 0.007, 0.0005) * Math.random();
|
|
|
|
this.shimmer_value = this.engine.ease.circInOut(0, 0.8, engine.random.number(200, 350), null, true, true);
|
|
|
|
this.shimmer_current_step = this.shimmer_step;
|
|
|
|
|
|
|
|
this.shimmer_value = 0;
|
|
|
|
|
|
|
|
return this.gem_type = this.engine.random.pick("diamond", "yellow", "blue");
|
|
|
|
return this.gem_type = this.engine.random.pick("diamond", "yellow", "blue");
|
|
|
|
};
|
|
|
|
};
|
|
|
|
diamond.onStep = function() {
|
|
|
|
diamond.onStep = function() {
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
if @fade_decay_current < Math.pow(2, @fade_decay_max)
|
|
|
|
|
|
|
|
@fade_value += @fade_current_step
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
max = 1.5 / @fade_decay_current
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if @fade_value > Math.min(max, 1)
|
|
|
|
|
|
|
|
@fade_value = Math.min(max, 1)
|
|
|
|
|
|
|
|
@fade_current_step = -@fade_step
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if @fade_value <= 0
|
|
|
|
|
|
|
|
@fade_value = 0
|
|
|
|
|
|
|
|
@fade_decay_current *= 1.5
|
|
|
|
|
|
|
|
@fade_current_step = @fade_step
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
this.shimmer_value += this.shimmer_current_step;
|
|
|
|
|
|
|
|
if (this.shimmer_value > 0.7) {
|
|
|
|
|
|
|
|
this.shimmer_value = 0.7;
|
|
|
|
|
|
|
|
this.shimmer_current_step = -this.shimmer_step;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.shimmer_value < 0) {
|
|
|
|
|
|
|
|
this.shimmer_value = 0;
|
|
|
|
|
|
|
|
this.shimmer_current_step = this.shimmer_step;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
diamond.onDraw = function() {
|
|
|
|
diamond.onDraw = function() {
|
|
|
|