RPG Maker Forums

So I know Javascript, but my background is entirely different to this. So I am trying to figure out the flow that is going on here.

One thing I am trying to do. Is get the Screen X to eventually be able to draw a sprite over the character. I know this can be done in the Game using variables, but I plan to expand upon this such as including direction and a couple of other things, which to my knowledge isn't really feasible such as drawing a direction sprite depending on where the character is looking and still have it follow.

Now, I'm not asking for working code on how to do that, but really looking for the gap I am missing in how to grab information like that from the current code flow.


I been looking at the:
Code:
Sprite_Character.prototype.updatePosition = function() {
    this.x = this._character.screenX();
    this.y = this._character.screenY();
    this.z = this._character.screenZ();
};
and been trying to reference it
Code:
alias_spriteUpdate = Sprite_Character.prototype.update;
Sprite_Character.prototype.update = function() {
    alias_spriteUpdate.call(this);
    console.log(this._character.screenX());
};
I get readouts but its acting like its still getting just the Pixels and not the screenX.

And looked at:
Code:
Game_CharacterBase.prototype.screenX = function() {
    var tw = $gameMap.tileWidth();
    return Math.round(this.scrolledX() * tw + tw / 2);
};
which is clearly doing the math to offset the scrolling and divide the tiles, but I am still clearing missing how this is all be pulled together.

Hopefully help with this well make me understand the code flow for JS Game Dev more. At the moment all my expertise is all Logic Web based programming, not use to the environment of this.

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
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.

Forum statistics

Threads
106,040
Messages
1,018,476
Members
137,824
Latest member
dobratemporal
Top