Discuss Scratch

scratchering_coder
Scratcher
500+ posts

Tile game minecraft tutorial

Not copied griffpatch tutorial or used griffpatch tutorial.

WHAT ARE TILES
A tile scrolling game is like 2D minecraft it's scrolling and all of the game are tiles.
Tiles are pieces that make the game.
Minecraft is made of a lot of pieces blocks.
This are tiles.

HOW TO MAKE A TILE SCROLLING GAME
WHY DON'T USE CLONES
Fist don't use clones because clones lag and scratch can't clone a lot of clones. Scratch won't make you clone a lot and a lot of clones.
HOW TO MAKE
If you can't make whit clones you need to make it whit pen.
BASICS
Fist to make this tile game it need to stamp only the tiles that the screen need so you need to know what is the max or smallest position that your sprite can reach.
If your game haves different costumes to make your game you should see the max and smallest position to every costume that are different. YOU NEED TO SWHITCH COSTUME TO A COSTUME AND SEE THE MAX AND SMALLEST POSITION

For see the max and smallest position of the costume or the sprite make this block
change x by (-100000)

change x by (1000000)

change y by (1000000)

change y by (-100000)
Now you can see the max and smallest position to x and y
So you need to click this blocks make them change the position and then check the position x if you clicked a change x block or if you clicked the change y block check position y.

When you check the position if it is a negative number it is the smallest position that can reach.
If it is not a negative number but a positive number it is the max position that can reach.

But now we want to use only the same costume a simple square.

STARTING PROGRAM
The fist think you need to do is create 2 variables scrollX and scrollY
(ScrollX)
(ScrollY)

Now make this script
when green flag clicked
CreateLevel
define CreateLevel
You need to make my block and don't forget to turn on RUN WITHOUT SCREEN REFRESH you can turn on that by clicking the box near the word Run without screen refresh.

RUN WITHOUT SCREEN REFRESH Makes (MY BLOCK) Run faster without turbo mode don't forget this.

Then every tile needs to know where position needs to go and what costume they need to switch so i call this DATA
And something needs to contain this DATA…. A LIST!!!

Make this lists
(TilesDATAX :: list)
(TilesDATAY :: list)
(TilesDATACostume :: list)
This lists will contain ALL THE TILES DATA.

And also all Tiles needs to know what element on the DATA list they need to get
So make
(TileID#)

ID means number and also # means number

EVERY LIST NEEDS TO BE THE SAME LENGHT OF ALL THE TILES NUMBER BECAUSE EVERY ELEMENT ON THE 3 DATA LISTS IS A TILE DATA THAT THE TILE NEEDS TO KNOW THE DATA

To be continued… next…
Sorry i can't continue too much to write lol.

Powered by DjangoBB