Discuss Scratch

cs4973750
Scratcher
2 posts

Touching not working

Hi fellow scratchers! I' m having a problem with some code, you see i have the following game code, before you press the link open the player (mech) and see where it presses space then open bullet and see if you can help me figure out the problem:
game

Thanks for taking a look!

Last edited by cs4973750 (Jan. 12, 2021 00:53:36)

MathPuppy314
Scratcher
500+ posts

Touching not working

What is the problem? Is it that the bullets won't collide with the wall?
Klicky_Kitty
Scratcher
40 posts

Touching not working

well, i notice that bullets dont collide. this is because of sad, built in limitation. the
touchingcolor?
is actually limited to a certin amount of colors, so it reduces lag and processing time. with this, it usually returnes false.
more info on that here:https://en.scratch-wiki.info/wiki/Touching_Color_()%3F_(block) (scratch wiki)
what i recommend you do is to make it so that the BACKGROUND is the color you want behind the levels (in your case brown) and then make it so when it touches the SPRITE it goes away.
whenIstartasaclonerepeatuntiltouchinglevel?move10steps
this is just a simple code. i hope you incorprate something like this into your code.
I found this out the hard way too. ;-;
Klicky_Kitty
Scratcher
40 posts

Touching not working

WAIT FORGET EVERYTHING I JUST SAID CUZ USING A VARIABLE FIXES IT.
on the level:
whenclickedforeveriftouchingbullet?thensetcheckto1elsesetcheckto0
in the bullet:
whenIstartasaclonerepeatuntilcheck=1move10stepsdeletethisclone
here is my remix:
https://scratch.mit.edu/projects/472631295/
cs4973750
Scratcher
2 posts

Touching not working

Thank You! However because the level includes the back drop I'll either have to move the black to the backdrop or just detect the color

Last edited by cs4973750 (Jan. 12, 2021 12:38:37)

Powered by DjangoBB