RPG Maker Forums

Hi people!

Well, I have lost account of how many times I rewrote my plugin... But I hope that is the last one!
It is a plugin that adds new sprites to the timer. And I'm unsure about the performance of the update functions of them.

I have made two versions:

1 - Used only the Sprite_Timer and made every other sprite inside. Like the gauge sprite:

this.gauge = new Sprite();
this.gauge.bitmap = new Bitmap(96,48)..

And so on.
There is a maximum of 7 sprites new.
Although I divided it with comments and proper functions names(Sprite_Timer.prototype.gauge...) I think that is a little unorganized.

So here, the Sprite_Timer.prototype.update carries all the update functions to all sprites.

2 - Made a class sprite for every sprite:
Sprite_timerBackground.prototype...
Sprite_timerGauge.prototype...

That seems cleaner to me, and more readable.

But now I have an update function for each sprite.

________________________________________________________________________________

So if before(method 1) I have made an only one check in Sprite_Timer that goes for every sprite:
Code:
Sprite_Timer.prototype.updateBitmap = function() {
    if (this._seconds !== $gameTimer.seconds()) {
        this._seconds = $gameTimer.seconds();
        // update all things that need update
    }
};
Now(method 2), in some sprites, I have this check again in the other update functions, in 3 or more times, because other sprites need the update to, like the gauge one for every second the timer goes.

So, how do you think about that?
Should I stick with method one? Or go with method two for a more readable code?

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,017
Messages
1,018,356
Members
137,802
Latest member
rencarbali
Top