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

Map editor update - add rotation #24

Merged
merged 44 commits into from
Mar 5, 2024

Conversation

snipercup
Copy link
Collaborator

This requires #22 to work. I will publish this PR as a draft to make sure #22 gets merged first.

This PR adds rotation to tiles on the map. I added a button that will rotate the tile. Next to the button is the amount of degrees it is rotated. Maybe I can replace the number with an arrow. I also added a hovering preview of the selected tile brush. You cannot see the cursor on my image so I added a red dot where the cursor is. You can see the preview floating besides it in a down-right position.
image

The map editor saves the rotation of the tile and then in the map generator the rotation is read and applied to the block that is created. As a proof of concept I added a tower you can climb to the generichouse.json map. In the image below you can see the shadow it produces.
image

I'm still figuring out what is the best way to apply rotation in Godot since apparently 0 degrees meens it's pointing east. For this game I want 0 degrees to point north so I made adjustments to the mapeditor and level generator to make sure that map tiles that are rotated 0 degrees are generated as a block that is rotated 90 degrees on the Y axis, meaning it is pointing north. For the other directions this means there is a bit of funky code to rotate it properly and can probably be improved upon in future prs.

I also added a shortcut to the rotate button but it doesn't work yet. I'll look into it later.

When the materials are generated, set the proper uv scaling so they are correctly visualized in-game.
This fixes the situation where if two map editors are opened, only the last one receives input from the scroll wheel
Improved saving loading, added duplicate and delete buttons, icons
Add name and description labels to show info on a tile
Overmap chunks will stay consistent even after changing scenes.
@snipercup snipercup marked this pull request as ready for review March 5, 2024 15:35
@snipercup snipercup merged commit ebf2b55 into Khaligufzel:main Mar 5, 2024
@snipercup snipercup deleted the map-editor-update branch March 5, 2024 15:36
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.

1 participant