Objects without code
Floors, walls, spikes and decoration need no script. In Resources, right-click a folder › New object (no code)…. The object has only what is in the Inspector.
Other objects react to it by name:
function onSpawn(self) self:onTouchStart("Espinho", function() restart() end)end
function onUpdate(self) if count("Moeda") == 0 then goTo("Fase2") endendvoid onSpawn() override { onTouchStart("Espinho", [this](Entity&) { restart(); });}
void onUpdate() override { if (count("Moeda") == 0) goTo("Fase2");}- With Solid checked, it blocks
moveAndStopandplaceFree. - C++: with no class, there is no
onCollide<Espinho>; use the versions that take the name in quotes (touching,collidesAt,findAt,onCollide,onTouchStart,onTouchEnd,count,any,each,destroyAll). - If the object needs events or variables, create it with New object….
