Skip to content
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

Boss can jump "behind" background layers #242

Open
odecay opened this issue Aug 29, 2022 · 11 comments
Open

Boss can jump "behind" background layers #242

odecay opened this issue Aug 29, 2022 · 11 comments
Labels
kind:bug Something isn't working

Comments

@odecay
Copy link
Collaborator

odecay commented Aug 29, 2022

If any character moves up past a certain Y value their sprite becomes covered by the parallax background sprites. This is currently possible during the jumping portion of the boss' smash attack if it starts from near the upper boundary of the walkable stage.

Also reproducible with player characters by changing consts::MAX_Y to be a higher value, then walking upward.

Originally posted by @odecay in #241 (comment)

@odecay
Copy link
Collaborator Author

odecay commented Aug 29, 2022

sorting_punchy

example with player, note the z value and background sprite covering fishy

@edgarssilva
Copy link
Collaborator

edgarssilva commented Aug 29, 2022

We could change the base z value of fighters as well as the parallax layers in the ParallaxResource. I thought we add some constants for that but seems not so we could create some.

Edit: Actually the z values of the fighters are already in asset files of the levels so we could change the z there.

@odecay
Copy link
Collaborator Author

odecay commented Aug 29, 2022

Would it not just get overwritten by the ysort system? I tried adding an offset in ysort system but it didn't seem to help

@odecay
Copy link
Collaborator Author

odecay commented Aug 29, 2022

I also tried offsetting the parallax layers in the level file but it didn't behave as expected

@edgarssilva
Copy link
Collaborator

edgarssilva commented Aug 29, 2022

Would it not just get overwritten by the ysort system? I tried adding an offset in ysort system but it didn't seem to help

The y-sorting should only add to the existing z value. Actually it isn't so we could do that.

Should just work by changing the = to += in https://github.com/fishfolks/punchy/blob/dfadfce439aa4d14ba09c7a442c28db52d17d608/src/camera.rs#L36

@odecay
Copy link
Collaborator Author

odecay commented Aug 29, 2022

That would be compoundingly adding the y to the z every frame though

@edgarssilva
Copy link
Collaborator

That would be compoundingly adding the y to the z every frame though

Ho right :P in my mind I thought we were adding then subtracting before and after render but I never actually ended up implementing it like that.
I'll try some stuff out tomorrow and then submit something.

@odecay
Copy link
Collaborator Author

odecay commented Aug 29, 2022

Im going to just add a set value for now so we can get a release out. I tried and it works with 300. But going to leave this open so we can come back to it.

@odecay
Copy link
Collaborator Author

odecay commented Aug 29, 2022

#244

@edgarssilva
Copy link
Collaborator

edgarssilva commented Aug 29, 2022

#244

Actually, I think you should keep the ysort.0 because it differs on the sprite height, but keep the 300. Never mind you kept it to 0., ok then I'll check it out tomorrow.

@odecay
Copy link
Collaborator Author

odecay commented Aug 29, 2022

#244

Actually, I think you should keep the ysort.0 because it differs on the sprite height, but keep the 300. Never mind you kept it to 0., ok then I'll check it out tomorrow.

yeah we arent using the Ysort offset right now, all fighters are initialized with 0. offset since the foot position stuff takes care of sortof what the ysort offset was doing before, but I think it will come in handy if we get to virtual Z for jumping so I think it makes sense to leave it. I could keep the ysort in that calculation AND add the offset which would probably be more correct, but I'm going to leave it the way it is with the intent of removing the new offset from there entirely or moving it to a const if we decide there is not a better way to deal with it.

edit: on second thought I added the ysort back to the calculation in ysort system, and clarified some comments for when we take another look at it #245

@zicklag zicklag added the kind:bug Something isn't working label Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants