RPG Maker Forums

Hi again!
I have a small problem with the window_menustatus and can't figure out yet how to fix it. I made new gauge bars for replace the default one, and they are working fine, but seem I cant animate all them. The code that draw the hp gauge bar is this (ignore the last line "push"):


Code:
Window_MenuStatus.prototype.drawHpGauge = function(index) {
        var actor = $gameParty.members()[index];
        this._HP_GAUGE = new TilingSprite(ImageManager.loadMenu(st_gauge_hp));
        var rect = this.itemRect(index);
        var x = rect.x;
        var y = 0;
        var width = Math.ceil((actor.hp * 176) / actor.mhp);
        this._HP_GAUGE.move(x + 42, y + 282, width, 14);
        this.addChild(this._HP_GAUGE);
        //_HPGauge.push(this._HP_GAUGE);   
};
This will draw a hp gauge for each character in party and is working. For animate it I just simply used a update like this:

Code:
Window_MenuStatus.prototype.update = function() {
    this._HP_GAUGE.origin.x += 1;
};
The animation work, BUT only for the last hp gauge that is draw, precisely the last party member in the party list.
I have try to use that push (the one I said to ignore) to send this._HP_GAUGE in a outside array and then set the update like this:

Code:
Window_MenuStatus.prototype.update = function() {
    for (i = 0; i < $gameParty.size(); i++) {
    this._HPGauge[i].origin.x += 1;
    };
};
Here the animation work for every character, but once hp drop below the max hp... the animation stop working (???).

I know another way to accomplish that and is working but that would involve a function with " this._HPGauge = []; for (i = 0; i < $gameParty.size(); i++) {code for the gauge and this._HPGauge.push(this._HP_GAUGE);}" and I find it drastic...

Thank you kindly for whoever reply and/or help!

Latest Threads

Latest Posts

Latest Profile Posts

He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

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!

Forum statistics

Threads
106,036
Messages
1,018,461
Members
137,821
Latest member
Capterson
Top