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!
Offline
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!
Offline
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 # )y # )>
<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!
~Happypieman
Offline
here is my example if you want it
http://scratch.mit.edu/projects/Happypieman/2194872
Offline
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 oneWith 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 # )y # )>
<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!
~Happypieman
can you explain it simpiler, it is kinda hard to understand.
Offline
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.
Offline