Discuss Scratch

_Stephanie_Lopez
New to Scratch
10 posts

Help with sensing.

This is my first time using Scratch, as I am only on Week 0 of the edX program, and I have hit a snag.

I'll use 3 sprites as examples for this question.

Sprite 1 is set to glide slowly to Sprite 2. Sprite 1 is draggable. The object of the game is to drag Sprite 1 to Sprite 3 before it touches Sprite 2, otherwise, you lose. Hope that makes sense.

The issue I am having is that even though my program is telling Sprite 1 to stop after it makes contact with Sprite 3, it immediately returns to its path and continues gliding to Sprite 2 when I am no longer clicking on it. Sprite 1 will react properly when it touches Sprite 2 but it doesn't react properly when it is touching Sprite 3. It returns to its original path, as I said before.

I have tried using a different sensing tool (sensing the color of the sprite instead of the actual sprite) but that didn't work either.

How can I fix this?

This is probably a simple fix but I have no idea what I am doing. Thanks in advance.


Elitherich
Scratcher
100+ posts

Help with sensing.

could you send me a link
 to the game  it will help determin the problem


add [You] to [Followers v]
_Stephanie_Lopez
New to Scratch
10 posts

Help with sensing.

https://scratch.mit.edu/projects/627421300


It's the Volcanic Debris block that I can't figure out.

Last edited by _Stephanie_Lopez (Feb. 8, 2022 15:52:30)

Digidragonhunter23
Scratcher
50 posts

Help with sensing.

Wait, how is the volcanic debris gonna touch the pool? I tried dragging it in the game however it doesn't work

me whe:
_Stephanie_Lopez
New to Scratch
10 posts

Help with sensing.

How odd. I've had no problem with the draggability. The problem I've run into is that I don't know how to set up the program so that it stops after I drag it to the pool and registers that it is actually touching the pool.

I think I may need to do individual steps for the movement and have it stop and sense after each movement but that sounds so complicated! ugggggggggggggggggggh.
Digidragonhunter23
Scratcher
50 posts

Help with sensing.

useless information here

Last edited by Digidragonhunter23 (Feb. 9, 2022 02:47:45)


me whe:
deck26
Scratcher
1000+ posts

Help with sensing.

I can't make sense of what you're trying to do. I couldn't see any sensing blocks anywhere.

If sprites are draggable and you don't change that sticking set draggable in a forever loop is not going to help in any way and is clutching at straws. Please ignore that advice from @Digidragonhunter23.
_Stephanie_Lopez
New to Scratch
10 posts

Help with sensing.

I changed that.

I think the issue is that I have it set to glide to the shelter and after that, it senses for the shelter or the pool, which means it will inevitably find the shelter.
How can I change the code so that it can sense it continually as it's moving toward the shelter? I don't want to make this more complicated than it needs to be.
_Stephanie_Lopez
New to Scratch
10 posts

Help with sensing.

Okay @deck26. The sensing blocks are inside the volcanic debris code on the volcanic debris sprite.
deck26
Scratcher
1000+ posts

Help with sensing.

_Stephanie_Lopez wrote:

I changed that.

I think the issue is that I have it set to glide to the shelter and after that, it senses for the shelter or the pool, which means it will inevitably find the shelter.
How can I change the code so that it can sense it continually as it's moving toward the shelter? I don't want to make this more complicated than it needs to be.
What's the it in that first sentence?

if you mean the fireball what makes it decide to go to one or the other? Do all the dinos need to be in the pool before it goes there? The more you describe what you're actually trying to achieve the easier it will be to help!
Digidragonhunter23
Scratcher
50 posts

Help with sensing.

ill come tmrw

me whe:
deck26
Scratcher
1000+ posts

Help with sensing.

So the current problem is the dinos are only checking once for touching the colour of the pool - that needs to be in a loop if you want to change the variable counting how many have moved.
_Stephanie_Lopez
New to Scratch
10 posts

Help with sensing.

The first sentence was about the draggable block and the repeating loop but then you said that it was not necessary so I changed it back.

I've changed it slightly to something that will be easier with the code that I already have in the game.
The volcanic debris will always go toward the shelter and it doesn't move. The code only senses the shelter now.

The basic vibe of the game is to move the dinos to the pool before the shelter catches fire from the volcanic debris. The mother nature variable changes when the shelter catches fire and that means that you've lost. Unless you get all the dinos to register that they are touching the pool, which will prompt the challenger variable to change for each dino, for a total of 4, then mother nature will win.

The issue now is with the dinosaurs.
The issue is that even though the dinosaurs code says to change the challenger variable by 1 if it is touching the pool, it doesn't change the variable's count. Does that make sense?


ADDED: Okay. I'll add a loop for the dinos and see if that helps.

Last edited by _Stephanie_Lopez (Feb. 8, 2022 17:02:20)

deck26
Scratcher
1000+ posts

Help with sensing.

_Stephanie_Lopez wrote:

The first sentence was about the draggable block and the repeating loop but then you said that it was not necessary so I changed it back.

I've changed it slightly to something that will be easier with the code that I already have in the game.
The volcanic debris will always go toward the shelter and it doesn't move. The code only senses the shelter now.

The basic vibe of the game is to move the dinos to the pool before the shelter catches fire from the volcanic debris. The mother nature variable changes when the shelter catches fire and that means that you've lost. Unless you get all the dinos to register that they are touching the pool, which will prompt the challenger variable to change for each dino, for a total of 4, then mother nature will win.

The issue now is with the dinosaurs.
The issue is that even though the dinosaurs code says to change the challenger variable by 1 if it is touching the pool, it doesn't change the variable's count. Does that make sense?


ADDED: Okay. I'll add a loop for the dinos and see if that helps.
Just remember to stop the loop when the touch is detected. A wait until touching blue is probably easiest.
_Stephanie_Lopez
New to Scratch
10 posts

Help with sensing.

Thanks for your help! I'll try to fix it tonight! I'll post another comment if I have another issue come up.
HeHeTeeHeeHee
Scratcher
100+ posts

Help with sensing.

Digidragonhunter23 wrote:

put the set draggable thing in a forever loop inside the when flag clicked mb it will work

You don't need it in a forever loop, a forever loop runs until the script is stopped, so… just set it to draggable when you need it then set it back afterwards.

Last edited by HeHeTeeHeeHee (Feb. 8, 2022 17:39:16)


HeHeTeeHeeHee wrote:

i'm brain dead aren't i
i usually use advanced topics or help with scripts but sometimes i can be found in things i'm playing and reading
_Stephanie_Lopez
New to Scratch
10 posts

Help with sensing.

Okay, that problem is fixed and all seems to be going well. Please try it out and send me a message if there's anything else I need to fix. Thanks so much!
CodingBaguette
Scratcher
500+ posts

Help with sensing.

_Stephanie_Lopez wrote:

Okay, that problem is fixed and all seems to be going well. Please try it out and send me a message if there's anything else I need to fix. Thanks so much!
Congrats!

Have you ever wanted to play a Difficulty Chart Obby that keeps on getting harder, and is original? Then this is just for you. It is a scrolling platformer, it is long, has checkpoints, has moving platforms, crushers, and more!


_Stephanie_Lopez
New to Scratch
10 posts

Help with sensing.

Thank you Baguette!

Powered by DjangoBB