ScratchData LogoScratchData
Back to geek62's profile

Scratch Cat Likes Trains!

GEgeek62•Created April 1, 2016
Scratch Cat Likes Trains!
221
187
16753 views
View on Scratch

Instructions

Press the left/right arrows to make it move, or down arrow to make it stop. When the train is offscreen, the thought-bubble tells how far. It's almost fun to hold down the right arrow for a minute until the train is far away, then stop it and hold down the left arrow until it comes zooming back - it gets going pretty fast. Yes, I am easily amused. So what?

Description

This is a simple remix of my "I Like Trains" project: https://scratch.mit.edu/projects/96058139/ Because Scratch Cat likes trains too. He told me so himself! Thanks to The_NW_Engine for noticing a problem with the layer order of the drive rods. I'm going to reveal a little secret here: how my sprites can move completely out of the viewport. Scratch tries not to let that happen. But it is a little dumb about how it checks that. If the sprite is all to the left or all to the right of the viewport, or all above or all below, then it is completely outside, and Scratch won't let it move there. But what if the costume was "L" shaped? Then the bottom part of the L could be below the viewport, and the vertical line could be to the left of it, so none of it is visible in the viewport, but Scratch still thinks it overlaps the viewport because it is not all to the left or all below - it overlaps the viewport's area in both X and Y directions. So Scratch would let it move there even though none of it is visible in the viewport. So this is the trick: my costumes have extra little dots far above/left and below/right of the main visible part. That makes them act like that "L" shaped costume - even when the main part has moved out of the viewport to the right, one of those little dots is still below or above, not to the right. So Scratch thinks the sprite is still partly "in the viewport" and thinks it is a legal move - it lets the sprite move there. #animations #scratchcat #ScratchCatLikesStuff

Project Details

Project ID103695821
CreatedApril 1, 2016
Last ModifiedOctober 6, 2023
SharedApril 1, 2016
Visibilityvisible
CommentsAllowed