Skip to content
Download

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") end
end
  • With Solid checked, it blocks moveAndStop and placeFree.
  • 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….

Reference: Collision, Instances.