-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lara: add responsive jumping #864
Conversation
7130485
to
2d163a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a style comment from me.
I just realised that this broke the Lost Valley demo - Lara ends up not leaving the pool. I've gone for the same approach as disabling |
} else { | ||
jump_permitted = true; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this boolean logic can be simplified, I'll follow up tomorrow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this work?
if (g_Config.enable_tr2_jumping) {
int16_t anim = item->anim_number - g_Objects[item->object_number].anim_index;
if (anim == LA_RUN_START) {
m_JumpPermitted = false;
} else if (anim != LA_RUN || item->frame_number == LF_JUMP_READY) {
m_JumpPermitted = true;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks much better - I'll test it out tomorrow. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An ideal outcome would be to forgo introducing a new global variable and set it always in the local scope. But I don't think that's possible since frame number resets to 0 and cycles, so even comparing it with >= will work in an unintended way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is a shame but thankfully this is a short snippet of code now so looks much tidier. I've tested it out and all is good 👍
b90de6d
to
adfc476
Compare
Sorry, just remembered to rebase following #867 (for the changelog). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Resolves #157.
Checklist
Description
The new injection file here will amend the relevant anim range low/high frames as detailed in the issue. It wasn't possible to combine this with the
lara_animations.bin
file as that is always injected, whereas this one needs to be tied to the config option.Demo: https://www.youtube.com/watch?v=mqi9EDz0FYU
A bit more detail on the jump lock workings. It's effectively to allow animation 0 to behave differently the first time compared to subsequent times during continuous running jumps.