This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-02-28 08:31:05

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

My AMAZING Minecraft coming soon!

I need suggestions for my minecraft! Report errors and post suggestions.

Errors

1. Ground level error

Suggestions

none


Marzipan11 must learn to not spoil

Offline

 

#2 2011-02-28 11:50:15

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: My AMAZING Minecraft coming soon!

Bump!!!!!!!!


Marzipan11 must learn to not spoil

Offline

 

#3 2011-02-28 18:25:27

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: My AMAZING Minecraft coming soon!

B U M P


Marzipan11 must learn to not spoil

Offline

 

#4 2011-03-01 08:30:10

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: My AMAZING Minecraft coming soon!

bump again  sad  If you view this, POST!

Last edited by zorket (2011-03-01 08:30:26)


Marzipan11 must learn to not spoil

Offline

 

#5 2011-03-01 10:59:55

mathematics
Scratcher
Registered: 2009-03-01
Posts: 1000+

Re: My AMAZING Minecraft coming soon!

Minecraft again...

Offline

 

#6 2011-03-02 19:19:55

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: My AMAZING Minecraft coming soon!

mathematics wrote:

Minecraft again...

Yeah, I am making minecraft. [rubiks guy gave up]

bump again!!!  mad


Marzipan11 must learn to not spoil

Offline

 

#7 2011-03-03 20:55:17

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: My AMAZING Minecraft coming soon!

This post will discuss how to create a script that would draw the playing area, detect collision with part of the stage, and then briefly describe how "mining" could work. 

Please note that this idea is only theoretical and HAS NOT been tested by me.  If you encounter problems, I will be happy to try to fix them.  I enjoy this kind of challenge. 

Setup

As far as the engine itself, I don't think Scratch is fast enough to deal with scrolling.  This explanation uses a 12 x 12 grid.  You will store different land types (or other objects) in a list, which will be set up to simulate a grid.  The easiest way to do this kind of thing is this:  Each block in the grid is represented by one element in a list.  Since we can't do 2 dimensional lists, the order would be like this:

Each number below represents the number of the item in the list, NOT THE VALUE OF THE ITEM.
       
01 02 03 04 05 06 07 08 09 10 11 12
13 14 15 16 17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32 33 34 35 36
etc.

To get to an item in column a, row b, we simply retrieve item 12(b-1)+a from the list.  So the item at column 5, row 2 is 12(2-1)+5 = 17.

Like the real minecraft, I doubt that putting in gravity for cubes, or in this case, squares, would work. 
________

Drawing

Now, we have set up a grid.  Each item of the grid contains a number, the identification of the type of land in that square.  Suppose 1 is empty, 2 is stone, 3 is grass, 4 is dirt, 5 is tree, 6 is lava, etc.  When the program runs at the beginning, it will sweep every spot in the grid and switch to the appropriate costume and stamp.  So, costume 1 would be the color of the background, costume 2 would be stone, 3 grass, etc.  Now we have drawn the playing area.  For the method described below, it must be drawn from top left to bottom right, across first. 
________

Sensing

The first part of playing the game itself is the ability of the character to identify how to interact with different parts of the stage.  We must determine what kind of land the character is on.  Since we don't want to check every space in the grid to see if the player is there, we have two options:

1. Color sensing (the easy approach): If every type of land is a different color, you can check if it is touching each color.  However, this is tedious (since you have to write an "if touching color _" statement for each possible color).  It also limits the creativity of your sprites, since they must have a uniform color along the edge exposed to the character.  If you use color sensing, skip the rest of the "Sensing" section.

2. Using x and y position (the fast, accurate approach): Since we know that each item in the grid exists at a particular location, by "snapping the character to grid," we can figure out what type of land the character is on.  This is done simply by:

Set "snap x" to ((round((x+240)/12))*12)+1  ## +240 makes it so that snap x will read 1 at the furthest left, and increase moving right.
Set "snap y" to ((round((180-y)/12))*12)+1  ## 180- makes it so that snap y will read 1 at the furthest up, and increase moving down.
Then, we can use the method for the grid described above to identify what item of the list the character is occupying.
If you want the grid to start somewhere else (instead of top left corner), use different values for +240 and 180-

Note: these scripts will depend on how you layout your grid onscreen.  If you use the same way you did in the current version, as of 3/3/11 (start top left, left to right, then down), then your snap x variable will represent "columns" in the list, and snap y will represent rows. 

When we apply the method above, the item number in the list, where row is snap y, column is snap x is (snap x and y are abbreviated sx, sy):

# = 12(sy-1)+sx

So, # is the location in the list from which we must retrieve the type of land.  Make any sense? (That was a pun, look at the title of the section). 

Summary:  At any given position x, y, the identification of the type of block the player is touching is (get ready):

"Item # (12((round((180-y)/12))*12)+((round((x+240)/12))*12)+1) of list _"
where x and y are the x and y positions of the object. 
The script would then execute a different action depending on what type of interaction it registers.  For instance, if the number it retrieved was for lava, it would execute the "kill" script, if it was touching a wall, it would run the physics scripts, etc. 
________

Playing

Once you have set up the sensing, stage, reactions, etc., you are ready to play, even only in a tiny grid. 
When the program discovers that you are mining, it will put a blank block at the appropriate location (based on where you are using above methods). 
That's about it!
________

If you have any questions, or if this doesn't work at all, please tell me.

Offline

 

#8 2011-03-04 16:18:48

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: My AMAZING Minecraft coming soon!

amcerbu wrote:

(Big Post)

THANK YOU THANK YOU! Of course, it's a big topic, and i'll read it later. (this is gonna be sweet!)


Marzipan11 must learn to not spoil

Offline

 

#9 2011-03-16 19:19:28

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: My AMAZING Minecraft coming soon!

bump...

Offline

 

#10 2011-03-18 20:25:01

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: My AMAZING Minecraft coming soon!

You there?

Offline

 

Board footer