Repository navigation
Release v5.5.0 - #41
Merged
Merged
Conversation
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.
A sprite with rotation style
LEFT_RIGHTthat faces left now has its hitboxmirrored along with its costume. The costume was drawn flipped but the hitbox
was not, so a costume whose painted part is not in the middle of its canvas
collided with the empty side - and a hitbox set with
setHitboxto cover, say,only the front of a sprite stayed at its back after it turned around. Speech
and thought bubbles follow the mirrored costume as well. The Online IDE already
mirrored the hitbox.
Sprites can sense colours, like Scratch's
touching color?andcolor is touching color?blocks:A sprite touches a colour when anything it paints lies over that colour on the
stage: on the backdrop, on what the pen drew, or on another sprite. Nearly
equal colours count, with the same tolerance as Scratch, so anti-aliased edges
still match. The check only looks at the pixels the sprite covers, so it costs
the same on a 480 x 360 stage as on a 1920 x 1080 one; a 128 x 128 sprite takes
well under a millisecond.
A sprite can turn around a point of its own choosing, like Scratch's rotation
center:
The point sits at the sprite's position, the costume turns and mirrors around
it, and the hitbox, stamps, speech bubbles and colour sensing follow. It is
given like the points of
setHitbox, grows with the sprite's size and holdsfor every costume. Without it, a sprite turns around the middle of its costume
as before.
getShaders().add(name, fragmentShaderPath, null)works. Leaving out thevertex shader is what the documentation shows, but it stopped the program with
a
NullPointerException; Processing's default vertex shader is now used.Every built-in sprite with a front now faces right, the way a sprite with
direction 90 faces in Scratch. The ships, lasers and other parts of the space
shooter sheet were drawn pointing up (the enemies down), and the bee, fly,
fishes, frog, ladybug, mouse, slimes, snail and worms of the platformer sheet
facing left. So a slime walking right with
movewalked backwards, and a shiptold to
pointTowardsMousePointerpointed its side at the mouse. They are nowturned when they are loaded. A program that showed a ship pointing up at
direction 90 now shows it pointing right;
setDirection(0)points it up, andthen
moveflies it up as well.A broadcast now reaches every sprite on the stage and the stage itself, as in
Scratch and in the Online IDE.
Sprite.broadcastleft out the sprite that sentit, and
Stage.broadcastleft out the stage, so a sprite or stage that reactsto its own message in
whenIReceivenever heard it. A sprite that broadcaststhe same message from its own
whenIReceivenow calls itself again, as thesame script does in Scratch.