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

Only show supported directions for each object that has Direction #2572

Merged
merged 16 commits into from
Aug 14, 2023

Conversation

Narre
Copy link
Contributor

@Narre Narre commented Aug 5, 2023

For most badguys, this is just auto, left and right. For some, up and down but not auto. For other objects, it varies - Dart has auto, left, right, up, down, DartTrap the same but without auto, PushButton has up and down, Bumper left and right. The Switch has none, left, right, up and down (I added up and down in this PR).

The bumper and the button used to have a bool instead of a Direction, I replaced those but made sure that levels saved with the old bool would load correctly and figure out the proper direction.

With switches, I replaced the three sprites with just one that supports directions. This does mean that old levels that used left or right switches will default to switch.sprite and show Direction::NONE switches, but that shouldn't matter much since those won't look out of place.

Also, code quality and guidelines in the files I touched.

direction_limit.mp4

NOTE: This will require proper testing, the more people test, the better. Especially if all directions save and load properly.

src/object/bumper.cpp Outdated Show resolved Hide resolved
@Narre Narre marked this pull request as draft August 6, 2023 21:13
@Narre Narre marked this pull request as ready for review August 8, 2023 00:05
Vankata453 added a commit to Vankata453/supertux that referenced this pull request Aug 8, 2023
Pull request SuperTux#2572 moves all switch variants into one sprite file, where the different switch types are managed via Directions.

[ci skip]
this ensures compatibility with existing custom switch sprites
@mrkubax10 mrkubax10 added involves:editor category:code status:needs-review Work needs to be reviewed by other people type:bugfix Pull Requests that fix bugs. labels Aug 11, 2023
@tylerandari13
Copy link
Contributor

For certain objects such as the bonus block every time you placed one it would bring a warning like invalid "direction" in bonus block. Will this go away with this PR?

@Vankata453
Copy link
Member

@tylerandari13 I am fixing how BonusBlock parse their data in my object types PR (#2542).

@Vankata453 Vankata453 merged commit ca3a77a into SuperTux:master Aug 14, 2023
29 of 36 checks passed
@mrkubax10 mrkubax10 removed the status:needs-review Work needs to be reviewed by other people label Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants