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

Player->Actor Collisions not working in Adventure scene style #979

Closed
Rebusmind opened this issue Jan 10, 2022 · 7 comments
Closed

Player->Actor Collisions not working in Adventure scene style #979

Rebusmind opened this issue Jan 10, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@Rebusmind
Copy link
Contributor

Describe the bug
In scenes that use the adventure type the player can move through actors.

Expected behavior
If I'm not mistaken, in 3.0alpha the collisions worked fine in adventure type scenes.

Screenshots
grafik

Platform (please complete the following information):

  • OS: Windows 10
  • App version 3.0.2
@Rebusmind Rebusmind added the bug Something isn't working label Jan 10, 2022
@ChaoticPumpkin
Copy link

Can confirm this is still an issue in 3.0.3, tested on MacOS 1.14.6.

This is the same scene in Top Down 2D compared to Adventure

Top down 2D
Top Down 2d

Adventure
Adventure

@maxoakland
Copy link

It would be great to be able to pick per actor if you want them to have collision or not

@jessemillar
Copy link

Did this ever work in adventure scenes? This PR exists (#1037) that adds actor collisions to platformer AND adventure scenes. I'm newer to GB Studio though so maybe it did work at some point and the PR is just a refactor...?

@maxoakland
Copy link

Did this ever work in adventure scenes? This PR exists (#1037) that adds actor collisions to platformer AND adventure scenes. I'm newer to GB Studio though so maybe it did work at some point and the PR is just a refactor...?

It’s never been implemented

@Rebusmind
Copy link
Contributor Author

Maybe that PR wasn't implemented, but there used to be a pretty simple implementation for actor collisions in adventure scenes. I digged it up for my game and it works pretty well. The only downside is that when you move diagonally and collide with an actor, the player stops instead of going in at least one free direction.

Here's the code that adds actor collision to the adventure scenes (line numbers should give an indication where the code goes, but these might have changed by now).

  1. Save the current position of the player before updating it
    image

  2. If you detect a collision, set the player back to that saved position so it doesn't get stuck in the actor
    image

Hope this helps.

@maxoakland
Copy link

Maybe that PR wasn't implemented, but there used to be a pretty simple implementation for actor collisions in adventure scenes. I digged it up for my game and it works pretty well. The only downside is that when you move diagonally and collide with an actor, the player stops instead of going in at least one free direction.

Here's the code that adds actor collision to the adventure scenes (line numbers should give an indication where the code goes, but these might have changed by now).

  1. Save the current position of the player before updating it
    image
  2. If you detect a collision, set the player back to that saved position so it doesn't get stuck in the actor
    image

Hope this helps.

Can you implement this and do a pull request?

@jessemillar
Copy link

We might not need another PR. PR #1037 adds the described collisions and supports diagonal sliding in adventure mode. Chris also has done some groundwork changes prepping for that exact PR. I'm no maintainer though so I defer to higher powers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants