Should do. I believe the NPC only makes use of the id, x and y fields, and the mem function.Rednaxela wrote:Though, that type of check does mean it'll seamlessly work with pNPC objects with no fuss, which could be a nice combination for some cases, hah.Hoeloe wrote:Though I curse Lua's lack of typing. Getting the same function to work for multiple types was awkward, I had to manually do some checks to determine the type of an object (I believe one of my tests was "does it have a field called "powerup"? Then it's a player").Rednaxela wrote:Much more generally useful thing you have there.
Yep. Quite easily, actually. It should be just this (though this will destroy powerups, coins, midpoints, etc. so you may want to filter that):Onule wrote:So it would be possible to make a fully working starman?Hoeloe wrote:This is useful if you want to override the behaviour SMBX would normally use when these two objects collide
Also, I think the new version of multipoint on the PGE wiki is missing the library file itself.
Code: Select all
function onLoop() for _,v in pairs(findnpcs(-1,player.section)) do if(colliders.speedCollide(player,v)) then v:kill(); end end end
EDIT: Done. Should be there now.