Apply different functions to each side of a SKSpriteNote

I need a little help, please. It's to do with SpriteKit. I have created a SKShapeNode (a box), I would like to create functions that I can apply to each side of the box, do you know this can be done? please.


I would like to apply a function to the right side of a box, a different one to the left, bottom and top. Thanks

Replies

Hello,


What exactly do you mean by "functions that I can apply to each side of the box" in this context?

Just do something different based on the user's touch location in relation to the center point of that node. Just some simple if statements using x and y locations, and you got this!