Randomly Moving The Prize
Running after a particular taco that doesnât move isnât particularly fun. Letâs say that we want to move the taco whenever our player finds it.
Weâre start by selecting our taco and then adding a game loop:
when green flag clicked
forever
end
We might try something like this.
when green flag clicked
forever
if <touching [Player v]?> then
go to [random position v]
end
end
Great. We got a taco. But, there is something missing. Iâm not feeling as celebratory as I would want to. Itâs almost like if we donât have points, then it doesnât matter, right? Letâs look into how to keep score.