Grab the 3D coins
Easy · Clones become golden spheres in the 3D world and vanish when you touch them.
Interactive tutorial: the editor checks each step by itself.
- Add the "3D World" extension.
- Pick a sprite. Drag "when flag clicked" and snap "generate flat world…" (3D World) under it.
- In Control, snap "repeat 10" and put "create clone of myself" inside it.
- Make another script with "when I start as a clone" (Control) and snap "become 3D body: sphere" (3D World).
- Snap "go to a spot on the ground 8 blocks from the player" to spread the coins.
- Add a "forever" with "if am I touching the player? (3D) then" and "delete this clone" inside.
- Click the flag and go collect the coins!
- Challenge: create the variable "coins" and snap "change coins by 1" before deleting the clone. (challenge)
The blocks of the finished program
• evt_bandeira
• m3d_gerar [TIPO: plano, SEMENTE: 5]
• ctl_repetir [VEZES: 10]
• ctl_criar_clone
• ctl_quando_clone
• m3d_corpo [FORMA: esfera, COR: #F2C230, TAM: 45]
• m3d_corpo_perto [DIST: 8]
• ctl_sempre
• ctl_se [COND: (m3d_corpo_estado)]
• var_adicionar [VALOR: 1, VAR: moedas]
• ctl_apagar_clone