wip merge pseudo-3d effect from broken-sign-games#82
Open
pancelor wants to merge 1 commit intoAuroriax:masterfrom
Open
wip merge pseudo-3d effect from broken-sign-games#82pancelor wants to merge 1 commit intoAuroriax:masterfrom
pancelor wants to merge 1 commit intoAuroriax:masterfrom
Conversation
pancelor
commented
Feb 8, 2023
| canvasdict[name]=canvas; | ||
| if (!(name in canvasdict)) { | ||
| canvasdict[name]=document.createElement('canvas'); | ||
| canvasdict[name].width = cellwidth; |
Author
There was a problem hiding this comment.
the important bit here is that the canvas only gets resized on creation, not every time we get it
pancelor
commented
Feb 8, 2023
| sprites[i].sw=cellwidth | ||
| sprites[i].sh=tallheight | ||
| sprites[i].oy=cellheight - canv.height | ||
| // console.log("tall",name,canv.width,canv.height); |
Author
There was a problem hiding this comment.
this is the meat of the change - the sprites are packed into a fixed-size spritesheet, but we want to make variably-sized sprites. so, just create a new entire spritesheet for each one. and then for all sprites, track which spritesheet they come from (using the sprites table)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the code's a bit of a mess; it was never meant to last longer than the one game I made it for. but this is the basics of how I merged the 3d effect from https://github.com/broken-sign-games/PuzzleScript/ into PSP for my butter game
I don't intend for this to be merged as-is, and I don't currently have plans to work on it more. hopefully this will be a helpful starting point if you decide to take this up!