I'm making a 2d version of Minecraft and I don't know what's wrong with the walking and jumping scripts. They work for one block that I made but when I duplicate the block the player falls through it. Can someone download it and try to see whats wrong? Thanks.
Link: scratch.mit.edu/projects/dankill51/2623586
Offline
The problem is you have conflicting scripts if you do that...you have one sprite saying it's touching the ground and the other one saying it isn't. Overall, that means nothing is because they're using the same variable. Here's what I would do:
-Make a list called "b-touch"
-For each new block you make, add an item to the list and change the item that the block sets to the latest length of the list (i.e. if you have 4 blocks, block one replaces item (1) and block two replaces item (2). etc.)
-have the character sprite contain this script:
when gf clicked forever set [ground? v] to <[b-touch v] contains (1)?> //or whatever means it's touching the character-instead of testing for 1 or 0, test for "true" or "false". "true" means it is touching, "false" not.
Offline
dankill51 wrote:
I'm confused on how to add an item to the list and change the item that the block sets to the latest length of the list for each new block I make, and should I take out any scripts or just add these?
Here, I'll download and make the changes so it's less confusing
EDIT: Here you go!
Last edited by AtomicBawm3 (2012-06-20 12:05:05)
Offline