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

Refactor fighters spawning #69

Merged
merged 3 commits into from
Jul 12, 2022

Conversation

64kramsystem
Copy link
Member

Extract spawning types and logic from main into player.rs and enemy.rs, and extended the respective bundles to make all the components explicit.

Right now, main.rs still has a mix of different things (e.g. player belly flop attack), so other things should be moved out.

There are still some

@64kramsystem 64kramsystem self-assigned this Jul 11, 2022
@64kramsystem
Copy link
Member Author

Should the belly flop system go into attack.rs (hypothetically, and in a separate PR)? I think so, although the semantics of attack are a bit fuzzy (probably, other systems will be added in the future, so I think that the belly flop system should go there).

@odecay odecay merged commit d1e72f7 into fishfolk:master Jul 12, 2022
@odecay
Copy link
Collaborator

odecay commented Jul 12, 2022

Should the belly flop system go into attack.rs (hypothetically, and in a separate PR)? I think so, although the semantics of attack are a bit fuzzy (probably, other systems will be added in the future, so I think that the belly flop system should go there).

I like this, I was starting to do something like this myself while I was considering #63. I think the attack portion and movement portion of the flop can be different systems, triggering by input should happen in attack. I'll try to make a pr soon and ask what you think.

@64kramsystem 64kramsystem deleted the refactor_fighters_spawning branch July 12, 2022 20:47
@64kramsystem
Copy link
Member Author

64kramsystem commented Jul 12, 2022

I like this, I was starting to do something like this myself while I was considering #63. I think the attack portion and movement portion of the flop can be different systems, triggering by input should happen in attack. I'll try to make a pr soon and ask what you think.

Splitting them is a good idea - actually, I think it will be necessary, if we unify the player translations as described in my recent issue.

The final shape of the split depends on if/how we decide to merge the translations. If yes, I think we should also start to think in stages.

My rough idea of splitting is:

  • stage N: input is read, and it's translated to an intention-to-move message, with the current location and the motion vector
  • stage N+1: move is examined, optionally processed, and optinally applied
    • for example, if the player belly flops from the edge of the screen towards outside, the processing should remove the x component of the motion vector, but leave the y one
  • stage N+2: attack collisions are tested

That's my proposal 😄

@odecay
Copy link
Collaborator

odecay commented Jul 16, 2022

Yea I thinkkkk that makes sense. We will have to account for collisions from attacks in our motion vector application as well. I keep meaning to reply to this but forgetting where it was. Would you transfer above proposal to its own issue @64kramsystem?

edit: I found the "reference comment in issue" feature which keeps like to your original comment. Issue here #99.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants