- Joined
- Feb 3, 2021
- Messages
- 15
- Reaction score
- 1
- First Language
- English
- Primarily Uses
- RMMV
Sorry to be "Sir Spamalot", but I am currently having problems with the framerate from my Fossil Cleaning System Plugin.
The problem is shown here: Cleaning Drill Effect Near Completion
And this is the code that is most likely the cause:
Can anyone point me in the right direction to not adding so many images that would cause lag?
The problem is shown here: Cleaning Drill Effect Near Completion
And this is the code that is most likely the cause:
JavaScript:
Spriteset_Cleaning.prototype.updateDrillEffect = function(){
if (TouchInput.isLongPressed()){
this._drillHole = new Sprite();
this._drillHole3 = new Sprite();
this._drillHole4 = new Sprite();
var toolX = TouchInput._x;
var toolY = TouchInput._y;
$gameScreen.showPicture(1, 'DrillEffect', 1, toolX, toolY, 100, 100, 255, 0);
$gameScreen.showPicture(2, 'DrillTracker', 1, toolX, toolY, 100, 100, 255, 0);
layer--;
if(layer <= 1200){
this._drillHole.bitmap = this.drillBitmap();
this._drillHole.bitmap.blt(this.drillBitmap, TouchInput._x, TouchInput._y, 48, 48, 0, 0);
this._drillHole.move(TouchInput._x, TouchInput._y);
this._rockLayer3.addChild(this._drillHole);
if (layer <= 1000 && this._rockLayer3.children.indexOf(this._drillHole)){
this._drillHole3.bitmap = this.drill3Bitmap();
this._drillHole3.move(TouchInput._x, TouchInput._y);
this._rockLayer3.addChild(this._drillHole3);
this._drillHole3.mask = this._fossil;
if(layer <= 800 && this._rockLayer3.children.indexOf(this._drillHole3)){
this._drillHole4.bitmap = this.drill4Bitmap();
this._drillHole4.bitmap.blt(this.drill4Bitmap, TouchInput._x, TouchInput._y, 48, 48, 0, 0);
this._drillHole4.move(TouchInput._x, TouchInput._y);
this._rockLayer3.addChild(this._drillHole4);
this._drillHole4.mask = this._fossil;
layer = 1200;
}
}
}
}else{
$gameScreen.showPicture(1, 'DrillEffect', 1, toolX, toolY, 100, 100, 0, 0);
$gameScreen.showPicture(2, 'DrillTracker', 1, toolX, toolY, 100, 100, 0, 0);
}
};
Spriteset_Cleaning.prototype.drillBitmap = function(){
return ImageManager.loadDrillBitmap(this.drillBitmapName());
};
ImageManager.loadDrillBitmap = function(filename, hue){
return this.loadBitmap('img/hole/', filename, hue, true)
};
Spriteset_Cleaning.prototype.drillBitmapName = function(){
return 'Drill';
};
Spriteset_Cleaning.prototype.drill3Bitmap = function(){
return ImageManager.loadDrill3Bitmap(this.drill3BitmapName());
};
ImageManager.loadDrill3Bitmap = function(filename, hue){
return this.loadBitmap('img/hole/', filename, hue, true)
};
Spriteset_Cleaning.prototype.drill3BitmapName = function(){
return 'Drill3';
};
Spriteset_Cleaning.prototype.drill4Bitmap = function(){
return ImageManager.loadDrill4Bitmap(this.drill4BitmapName(), -121);
};
ImageManager.loadDrill4Bitmap = function(filename, hue){
return this.loadBitmap('img/hole/', filename, hue, true)
};
Spriteset_Cleaning.prototype.drill4BitmapName = function(){
return 'Drill4';
};
Can anyone point me in the right direction to not adding so many images that would cause lag?