Hello all,
I poked around looking to see if this exists but I was not able to find anything. My apologies in advance if someone has already done this.
Basically, I have a game where my sprites only look to the right or left (think like old school arcade beat'em up type games). Currently I'm just using the "right" sprite for "up" and the "left" sprite for "down", but unfortunately this sometimes makes the way the characters move feel... odd. Ideally, if the player was facing left when the "up" key was pressed, he should continue to face left while he moves up.
I imagine it wouldn't be hard to simply skip the part where the player or event changes to the "up" or "down" frame, while still allowing the player to move up or down, but unfortunately the programming is a bit above me.
If someone would be interested in whipping something up I'd be happy to compensate them for their trouble.
As always, thank you!
That looks pretty solid, though I was kinda hoping to modify it within the code itself though a plugin. That will certainly tide me over until I can figure out the correct way to accomplish what I'm looking for in the code.
Thanks for the idea.
No problem. Wasn't sure if this would fix your issue completely or not. Just figured I'd show ya in case you didn't know how to do that. Best of luck with finding the plugin~
This one's a bit of a stretch but you can add a new plugin and write
Game_CharacterBase.prototype.setDirection = function(d) {
if (d == 2 || d == 8) {
// do nothing
}
else if (!this.isDirectionFixed() && d) {
this._direction = d;
}
this.resetStopCount();
};
Which literally disables all direction setting if you move up or down, so that you will continue to face the same direction.
Tsukihime, this is SOOOO close! It makes the movement do EXACTLY what I want, but I'm sad to say since it literately prevents the player from looking up or down, it also prevents them from interacting with anything that might be above or below them.
Is there some way to accomplish what this does, but only on a graphical level? Meaning, let the player actually LOOK up or down, but don't change the sprite when they do so. Thank you so much for your help!
The graphics I'm using only look forward while moving up and down (think like a side-scrolling beat-'em up game like Castle Crashers, or the TMNT Arcade Game, or Double Dragon).
I'm designing the game to be primarily "Point and Click", so they would know what they were interacting with because it would be what they clicked on. (I admit that with arrow key or controller movement their would be the possibility for confusion, but that doesn't matter for the sake of this project.)
Currently I have copy/pasted the "left" and "right" sprites and put them in the slots in the sprite sheet associated with the "up" and "down" movement respectively. However, because this duplicated "right" sprite is automatically used when I press the "down" button, the character appears to turn to the "right" before moving "down" even if they were looking "left" before moving. It's not unusable, but it makes the sprites movement feel kinda strange. Tsukihime suggested code above accomplishes exactly what I want visually, but unfortunately it has the side-effect of preventing the player from interacting with anything above or below their position. It makes sense since Tsukihime's code simply disables looking "up" or "down", which is required to interact with something above or below the player.
There's gotta be a way to simply make the player sprite not change to the "up" or "down" sprite when moving "up" or "down".
Thank again everyone! I appreciate all the feedback!
Sprite directions are tied to character direction.
When the character direction changes, the sprite's direction will change accordingly.
You can make it so that the sprite will check what the character's current direction is to determine whether it should change.