Discuss Scratch

cutiepop12345678
Scratcher
11 posts

How do I make my boss switch different costumes if moving left or right?

The game is here: https://scratch.mit.edu/projects/1367688394
btw the boss is on the third backdrop; play through to test it.

Last edited by cutiepop12345678 (Aug. 20, 2026 13:49:57)

Catscratcher07
Scratcher
1000+ posts

How do I make my boss switch different costumes if moving left or right?

I wasn't able to get to the boss because your game is unintuitive, but what I think you are trying to do would be inefficient. Instead you should set the boss' rotation style to left-right (only doable with a block in the motion category, but even clicking the block in the pallet will save until the block is triggered again), and have it constantly point towards the player.
10goto10
Scratcher
1000+ posts

How do I make my boss switch different costumes if moving left or right?

I assumed that you wanted a different set of left and right costumes, which I tried to show why you might want that by adding some badly drawn shading on the tree boss's costumes, otherwise you don't need to actually switch costumes when you switch directions - but I was trying to answer the question you asked.

I modified the tree boss code in this remix: https://scratch.mit.edu/projects/1370218728/ to use a different set of right and left costumes and with walking animation.

I also changed the stage to quickly go to background #3 so I could get to the part where the tree boss is walking toward the player.

cutiepop12345678
Scratcher
11 posts

How do I make my boss switch different costumes if moving left or right?

10goto10 wrote:

I assumed that you wanted a different set of left and right costumes, which I tried to show why you might want that by adding some badly drawn shading on the tree boss's costumes, otherwise you don't need to actually switch costumes when you switch directions - but I was trying to answer the question you asked.

I modified the tree boss code in this remix: https://scratch.mit.edu/projects/1370218728/ to use a different set of right and left costumes and with walking animation.

I also changed the stage to quickly go to background #3 so I could get to the part where the tree boss is walking toward the player.


Also, please add an attack mechanism because your code doesn’t work when I tested it

Last edited by cutiepop12345678 (Aug. 22, 2026 20:01:50)

10goto10
Scratcher
1000+ posts

How do I make my boss switch different costumes if moving left or right?

I was just trying to answer your question about the costume changes. If this is what you needed then I assumed you could continue to make progress on your project. However, the question is ‘do you need a separate looking set of left and right costumes or do you just need two walking costumes that can be pointed to either left or right.

But about the attack, you could change that repeat 0 block to let the ‘if touching player then broadcast damage’ blocks run. Putting those blocks in a repeat 0 loop is just a way to keep them in the script but not have them ever execute.
Ruby_A_Reynolds
Scratcher
57 posts

How do I make my boss switch different costumes if moving left or right?

when [right arrow v] key pressed
switch costume to [whatever...? v]
when [left arrow v] key pressed
switch costume to [whatever...? v]
ITS_DINO_XD
Scratcher
100+ posts

How do I make my boss switch different costumes if moving left or right?

Ruby_A_Reynolds wrote:

when [right arrow v] key pressed
switch costume to [whatever...? v]
when [left arrow v] key pressed
switch costume to [whatever...? v]
Using the when key pressed hatblocks are not recommended instead use forever loops and if statements but thats besides the point since this is a boss i would do this
when green flag clicked
set rotation style [dont rotate v]
set [steps v] to [number of steps you want]
move (steps) steps
point in direction (steps)
This works bc if your moving in a positive number you will point right and if negative you will point left
Catscratcher07
Scratcher
1000+ posts

How do I make my boss switch different costumes if moving left or right?

ITS_DINO_XD wrote:

Ruby_A_Reynolds wrote:

when [right arrow v] key pressed
switch costume to [whatever...? v]
when [left arrow v] key pressed
switch costume to [whatever...? v]
Using the when key pressed hatblocks are not recommended instead use forever loops and if statements but thats besides the point since this is a boss i would do this
when green flag clicked
set rotation style [dont rotate v]
set [steps v] to [number of steps you want]
move (steps) steps
point in direction (steps)
This works bc if your moving in a positive number you will point right and if negative you will point left
You need left-right to do this, not don't rotate

Powered by DjangoBB