david-pfx / PuzzleScriptNext

A direct successor to PuzzleScript, building on the work of PuzzleScript Plus, Pattern:Script and others.
http://www.puzzlescriptnext.polyomino.com
MIT License
11 stars 4 forks source link

Sprite Transform Abnormally #37

Open HKMG1 opened 4 months ago

HKMG1 commented 4 months ago

Describe the bug When creating a block larger than sprite size and use transformation to align center, it has one more square at the top right corner

Reproduction Steps (Objects) Wall # brown 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000 000000000 translate:down:2 translate:left:2

(Level) ... .#. ...

What did you expect would happen? A brown square (without the top right block)

OS & Browser version, desktop/mobile Chrome Desktop

Screenshots, example projects, other relevant issues, etc. 螢幕擷取畫面 2024-04-28 112139

david-pfx commented 4 months ago

Thanks for raising this issue. It would help if you could provide the whole program as your repro case.

It looks to me that your spritesize is 5 or close to it, and that rather than one extra square you are missing quite a number of squares.

So I'm guessing you haven't used any collision layer groups. Check out how to do this here: https://puzzlescriptnext.polyomino.com/Documentation/collisionlayers.html

What then happens is the background of the next cell to the right and below overwrite part of your sprite. I really need to add a note to the docs about that, but meanwhile just add -- after the background and see how you go.

HKMG1 commented 4 months ago

OBJECTS

Background . black

Player green

Wall # brown yellow blue 000000000 011111110 012222210 012222210 012222210 012222210 012222210 011111110 000000000 translate:down:2 translate:left:2

LEGEND

SOUNDS

COLLISIONLAYERS

Background (--) Player Wall

RULES

WINCONDITIONS

LEVELS

... .#. ...

It works well after adding -- under the background in collisionlayers

david-pfx commented 4 months ago

Thanks! I'm keeping this here to remind me to update the documentation.