ScratchData LogoScratchData
Back to griffpatch's profile

Tile Scrolling Engine v1.7

GRgriffpatch•Created June 3, 2014
Tile Scrolling Engine v1.7
3206
2939
82316 views
View on Scratch

Instructions

Here is a sample project showing how I go about creating a scrolling tile based game. The scripts are well commented so please take a look through. The the rain drops and the two enemy types are separate sprites that can be dropped in or deleted without affecting the game. The Level is a 2d grid of tiles stored in a list of numbers where each number represents a costume number from the "Tiles" sprite. Enough clones of the tiles sprite are created to completely fill the game play window. These are scrolled around as SCROLL_X & SCROLL_Y are changed, and if they move fully of one side of the window, they are instantly moved to the opposite side to fill the gap and make the scrolling seamless. It is only at this point that the costume is changed which greatly reduces lag. The rain effect has been added by the last sprite in the project to demonstrate how you can create objects that interact with the level and that hook into the same 'animate' broadcast as the level itself. Simply delete the rain sprite and it goes away. Next I have added a laser gun effect. This is again done in a separate sprite so it can just be deleted and things will keep on working just fine.

Description

Update History 12 Jun 2014 - v1.7 - Added animating tile costumes. 10 Jun 2014 - v1.6 - Added non solid tile type support and larger than 1x1 tile size enemies (for @craZcat). 9 Jun 2014 - v1.5 - Increased level size and added WASD support.

Project Details

Project ID23134940
CreatedJune 3, 2014
Last ModifiedNovember 26, 2023
SharedJune 12, 2014
Visibilityvisible
CommentsAllowed