You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
local playerFilter = function(item, other) if other.isCoin then return 'cross' elseif other.isWall then return 'slide' elseif other.isExit then return 'touch' elseif other.isSpring then return 'bounce' end -- else return nil end
But how do we KNOW that other is, say, a wall or a coin? I'm trying to implement the same thing in my own game, where I have ground tiles called 'tile', all lower case. How would I check that other is a tile?
The text was updated successfully, but these errors were encountered:
The other is just a table. You can put variables/properties there before (or even after) adding to the bump world. isCoin and such are just examples, you put other variables in the table as definitions before using with filter
The other is just a table. You can put variables/properties there before (or even after) adding to the bump world. isCoin and such are just examples, you put other variables in the table as definitions before using with filter
In the readme there is an example as follows:
local playerFilter = function(item, other) if other.isCoin then return 'cross' elseif other.isWall then return 'slide' elseif other.isExit then return 'touch' elseif other.isSpring then return 'bounce' end -- else return nil end
But how do we KNOW that other is, say, a wall or a coin? I'm trying to implement the same thing in my own game, where I have ground tiles called 'tile', all lower case. How would I check that other is a tile?
The text was updated successfully, but these errors were encountered: