-
Notifications
You must be signed in to change notification settings - Fork 558
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
Region system #896
Region system #896
Conversation
b4748ad
to
4148234
Compare
62d6082
to
bf8ca30
Compare
This has been updated to work with the current map code! |
This has been updated to work with the current map code. Again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was expecting this to be a quick review. Unfortunately, it wasn't. 😛
I haven't even fully tested everything yet.
Co-authored-by: Misa Elizabeth Kai <infoteddy@infoteddy.info>
Fixes errors or oversights with the region system for the PR review
fde9233
to
94b903a
Compare
Applied changes from the review! |
HAHAHAHA OMG OKAY I'LL FIX THAT |
Co-authored-by: Misa Elizabeth Kai <infoteddy@infoteddy.info>
Co-authored-by: Misa Elizabeth Kai <infoteddy@infoteddy.info>
Changes:
This PR adds a map region system. Regions allow the minimap to display only part of a level even if the level has larger bounds (for example, a 5x5 region in a 20x16 level). Regions can also have custom images. If region
id
.png is present in /graphics, then the minimap will display that image when the current region isid
. The default region is0
, and in region0
the map will display minimap.png (instead of region0.png) if it is present, in order to maintain forwards compatibility. There are a maximum of 401 regions, from0
to400
.It adds three commands to manage them:
setregion(id,x,y,x2,y2)
- sets regionid
fromx,y
tox2,y2
.changeregion(id)
- sets the current region toid
. If regionid
doesn't exist, then it will act as if you aren't in any region at all.removeregion(id)
- removes regionid
from the array.Here is a demonstration video:
Regiondemo.mp4
This PR will not break forwards compatibility. Playing a level which uses this system with an older version of the game probably won't even affect their ability to navigate, although they might end up seeing rooms on the minimap that the level creator intended to be outside of the bounds of the displayed map.
Regions are saved to and loaded from a level's save file, as well as what the current region is. The map cursor and icons for trinkets and teleporters will display properly - if the player/a trinket/a teleporter is outside the bounds of the current region, it won't render on the map screen.
This also cleans up a lot of map code, moving more things into
MapRenderData
. Thanks to Ally and Dav999 for help with this!!!Legal Stuff:
By submitting this pull request, I confirm that...
CONTRIBUTORS
file and the "GitHub Friends"section of the credits for all of said releases, but will NOT be compensated
for these changes