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

#1 2011-12-04 11:42:08

maxdoss
Scratcher
Registered: 2010-07-27
Posts: 1000+

How do I make a mining game?

How do I have it so that the blocks don't overlap when the world is generating, how to make the world generate, and how to make it so that when you collect a block it is added to your inventory?

Thanks!


It's my birthday. Deal with it.

Offline

 

#2 2011-12-04 11:50:01

WingsGames
Scratcher
Registered: 2011-02-21
Posts: 500+

Re: How do I make a mining game?

maxdoss wrote:

How do I have it so that the blocks don't overlap when the world is generating, how to make the world generate, and how to make it so that when you collect a block it is added to your inventory?

Thanks!

For the one about blocks in your inventory, if you get lava, you calud make it:

when "lava" clicked
broadcast "add one lava"


Then, in the stage:
When I recieve "add one lava"
change variable "# of lava blocks" by one

I can't help you on the other ones. Sorry!


Are you an aspiring home decorator? If so, please answer my question!

Offline

 

#3 2011-12-04 13:19:14

Happypieman
Scratcher
Registered: 2010-09-28
Posts: 100+

Re: How do I make a mining game?

WingsGames wrote:

For the one about blocks in your inventory, if you get lava, you calud make it:

when "lava" clicked
broadcast "add one lava"


Then, in the stage:
When I recieve "add one lava"
change variable "# of lava blocks" by one

With the "When`clicked thing, i hate to tell you but this isn't the way that world generation works. I'm sure that you would use stamping to be able to make an effective world. Unfortunately, you can't use stamps as clones, they are just placeholders: THEY DO NOTHING.

However-yes, there is a however, it would be possible in 2.0, in which you could easily create a world AND mine the objects as there will be cloning, creates a duplicatesprite without actually creating a sprite. Wait--what? Anyway, i have tried it myself, and for the overlap, make sure you define a height and width for the block.
Eg. 15 tall and 15 wide. Then when generating the world, you have to (if we are using 15 by 15...)
<when green flag clicked>
<go to x sad  # )y sad  # )>
<forever>
<change y by(15)> //this will ensure no overlap//
<if>
x position > ###
<change x by 15>

so this is just a basic example, but you could add more costumes and make the block go to the original point, change to another costume and so on and so forth. NOTE: The above script will only generate flat land. You would have to use a pick randpm block in the repeat for it to work.

Hope this helps heaps!  smile
~Happypieman


2012--The biggest troll ever.

Offline

 

#4 2011-12-04 13:29:26

Happypieman
Scratcher
Registered: 2010-09-28
Posts: 100+

Re: How do I make a mining game?

here is my example if you want it  smile
http://scratch.mit.edu/projects/Happypieman/2194872


2012--The biggest troll ever.

Offline

 

#5 2011-12-05 08:46:21

maxdoss
Scratcher
Registered: 2010-07-27
Posts: 1000+

Re: How do I make a mining game?

Happypieman wrote:

WingsGames wrote:

For the one about blocks in your inventory, if you get lava, you calud make it:

when "lava" clicked
broadcast "add one lava"


Then, in the stage:
When I recieve "add one lava"
change variable "# of lava blocks" by one

With the "When`clicked thing, i hate to tell you but this isn't the way that world generation works. I'm sure that you would use stamping to be able to make an effective world. Unfortunately, you can't use stamps as clones, they are just placeholders: THEY DO NOTHING.

However-yes, there is a however, it would be possible in 2.0, in which you could easily create a world AND mine the objects as there will be cloning, creates a duplicatesprite without actually creating a sprite. Wait--what? Anyway, i have tried it myself, and for the overlap, make sure you define a height and width for the block.
Eg. 15 tall and 15 wide. Then when generating the world, you have to (if we are using 15 by 15...)
<when green flag clicked>
<go to x sad  # )y sad  # )>
<forever>
<change y by(15)> //this will ensure no overlap//
<if>
x position > ###
<change x by 15>

so this is just a basic example, but you could add more costumes and make the block go to the original point, change to another costume and so on and so forth. NOTE: The above script will only generate flat land. You would have to use a pick randpm block in the repeat for it to work.

Hope this helps heaps!  smile
~Happypieman

can you explain it simpiler, it is kinda hard to understand.


It's my birthday. Deal with it.

Offline

 

#6 2011-12-05 11:05:31

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: How do I make a mining game?

What you could do is make it so when the stage is generating the sprites lock into a grid, then it would add that position to a list and all the blocks would make sure they are not on a position which is on the list, and if they are they would move.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

Board footer