Discuss Scratch

Toasty_Boy
Scratcher
100+ posts

Script not doing what it's told

Hi, in my new game Home Design The Furniture creates a clone in which, if arrow keys are pressed, it will move the clone around, while the wasd keys turn it in a certain direction. But, the wasd keys do not seem to turn the clone. Help?

“Helping others is the secret sauce to a happy life.” – Todd Stocker
This is why I aim to help others.
To give them a happy life too.


–Toasty_Boy–
mstone326
Scratcher
1000+ posts

Script not doing what it's told

Can you tell us what sprite is creating the clones of the furniture and how that works? I looked quickly but there are too many scripts to comb through on a quick peek

High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335
Toasty_Boy
Scratcher
100+ posts

Script not doing what it's told

mstone326 wrote:

Can you tell us what sprite is creating the clones of the furniture and how that works? I looked quickly but there are too many scripts to comb through on a quick peek
The Furniture sprite

“Helping others is the secret sauce to a happy life.” – Todd Stocker
This is why I aim to help others.
To give them a happy life too.


–Toasty_Boy–
Charles12310
Scratcher
1000+ posts

Script not doing what it's told

repeat until <not <touching [wall v]?>>
...
end

Replace it with this:

if <touching [wall v]?> then
repeat until <not <touching [wall v]?>>
...
end
end


A few internet communication companies want to corrupt the internet by getting rid of net neutrality. Stop Them!
mstone326
Scratcher
1000+ posts

Script not doing what it's told

I see that, but what creates the clone of the furniture?

High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335
Toasty_Boy
Scratcher
100+ posts

Script not doing what it's told

mstone326 wrote:

I see that, but what creates the clone of the furniture?
The menu's create the clones

“Helping others is the secret sauce to a happy life.” – Todd Stocker
This is why I aim to help others.
To give them a happy life too.


–Toasty_Boy–
Toasty_Boy
Scratcher
100+ posts

Script not doing what it's told

Charles12310 wrote:

repeat until <not <touching [wall v]?>>
...
end

Replace it with this:

if <touching [wall v]?> then
repeat until <not <touching [wall v]?>>
...
end
end
It already isn't touching the walls. Why would I need to turn the direction to something it isn't?

“Helping others is the secret sauce to a happy life.” – Todd Stocker
This is why I aim to help others.
To give them a happy life too.


–Toasty_Boy–
mstone326
Scratcher
1000+ posts

Script not doing what it's told

I just saw the before this. I was able to turn the clones then set my furniture. Then choose a new piece and rotate that. Prob should start to include a cloneID system (this sprite only variable) then each clone will know who it is, can be the active clone to move and rotate or be reselected and then can be moved and rotated.


High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335
Toasty_Boy
Scratcher
100+ posts

Script not doing what it's told

Do you know how to do that? Like, what the general script would be?

“Helping others is the secret sauce to a happy life.” – Todd Stocker
This is why I aim to help others.
To give them a happy life too.


–Toasty_Boy–
mstone326
Scratcher
1000+ posts

Script not doing what it's told

Give me a sec, I'll look. Just have to stomach the Patriots missing the extra point to tie the game.

Basically, change the cloneID (this sprite only) by 1 on every creation. Then you can move that furniture around on its own, place it, be done. But then have a variable maybe called moveFurniture. When this sprite clicked (works for clones too) set cloneIF to moveFurniture. Then you could move it around and place it again.

Shouldn't be hard to implement.

High School Athletic Director / Middle School Tech Teacher / High School Baseball Coach
Kung Fu by Nintendo 1984 - https://scratch.mit.edu/projects/369994801/
Taco Defense - Speed Typing - https://scratch.mit.edu/projects/316795450/
Halloween Boss Battle - Taking Back our Woods - https://scratch.mit.edu/projects/257155118/
Almost Pong - https://scratch.mit.edu/projects/656276979/
Studio - My Best Projects - https://scratch.mit.edu/studios/4125978/
Forum Help Project Examples - https://scratch.mit.edu/studios/4133335
Toasty_Boy
Scratcher
100+ posts

Script not doing what it's told

Thanks!

This topic is closed

“Helping others is the secret sauce to a happy life.” – Todd Stocker
This is why I aim to help others.
To give them a happy life too.


–Toasty_Boy–

Powered by DjangoBB