ScratchStats LogoScratchStats

ScratchStats

Explore Scratch statistics and discover trending projects and creators.

Community

  • Apply for Verified
  • Apply for Reviewer

More

  • Donate
Not affiliated with Scratch.
Back to Mhart's profile

Mario

MHMhart•Created June 9, 2007
18
22
2,772 views
View on Scratch
View on TurboWarp

Notes & Credits

Super Mario Bros scrolling background with moving and jumping Mario plus turtle and mushroom movement. Use the arrow keys to scroll. Note that you may need to restart a couple of times to see the Mario and other characters - there seems to be a bug in the layering. Also, the mushroom movement isn't quite right in the browser, but it's fine within Scratch itself. The trick to getting a good scrolling background like this is: 1) Use 480x360 sprites as your background images. 2) Since Scratch can't move them all the way off the screen, use two "border" sprites to make the screen narrow enough. 3) Offset the background image positions to overlay each other by the border width (18 pixels). 4) Layer the images. 5) Use a variable for all sprites to control their positions. You'll see that once you set things up with the right size, positions, and the borders, the scripts to handle the scrolls are simple. Handling character movement that occurs off-screen is a bit tougher, with some tricky calculations. Fortunately, most of the math is based on the scrolling background positions.

Project Details

Project ID11909
CreatedJune 9, 2007
Last ModifiedJune 9, 2007
SharedJune 9, 2007
CommentsAllowed