1 of 10

Architect Simulator

Prevent Blocks From Stamping On the Menu

2 of 10

3 of 10

A quick fix

  1. A quick fix to prevent the blocks from stamping on the menu is to make the backdrop menu bar a new sprite
  2. Next make the menu sprite go to the back layer (so the other sprites appear on top of it) so you end up stamping behind the menu sprite instead of on top of the menu on the backdrop

4 of 10

A new bug

  • However, if we are starting sounds every time we stamp, this will still make the stamp sound even though we can’t see the stamp

5 of 10

Create a new “Stamp if above the line” function

  • Another approach is to prevent the blocks from stamping on our menu by adding an “if” conditional; however, the code will look a lot cleaner if we put the code into a new function called “Stamp if above the line”
  • Create a new function and place the code on the right inside of it

6 of 10

Call our new function

  • Now we can replace our old “stamp” block with our new function that stamps if the sprite is above the menu (y position > -140)
    1. However, if a sprite is turned sideways (standing tall), it might still stamp on the top part of the menu
      1. A quick fix for this bug is to make the backdrop menu a sprite so you end up stamping behind the sprite instead of on top of the menu on the backdrop
  • Repeat this process for each sprite

7 of 10

A potential bug

  • Although the code works really well, if a sprite is turned sideways (standing tall), it might still stamp on the top part of the menu
  • A quick fix for this bug is to use this code AND make the backdrop menu a sprite (see the first couple steps)

8 of 10

Another option (with another potential bug)

  • Another option is to use the code on the right to check to see if the sprite is touching the color of the menu
  • However, a potential bug can occur if you try and stamp on a block that is the same color as the menu

9 of 10

Use the tutorial button for more ideas and tips

10 of 10