Skip to content

How do we know if the thing we are touching is, say, a coin? #58

@StarrKiss

Description

@StarrKiss

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions