Hello, I’m trying to set contactDelegate on physicsWorld of SKScene that’s created through create_objc_class but it doesn’t work. Any ideas? Thanks in advance.
Here is that part of code:
scene_class = create_objc_class(name,SKScene,methods=[didMoveToView_,update_,touchesBegan_withEvent_],protocols=[])
screen_size = ui.get_screen_size()
rect = CGRect(CGPoint(0, 0),CGSize(screen_size[0], screen_size[1]))
self.scene = scene_class.sceneWithSize_(rect.size)
delegate_class = create_objc_class('PhysicsDelegate',NSObject,methods=[didBeginContact_],protocols=['SKPhysicsContactDelegate'])
self.scene.physicsWorld().setContactDelegate_(delegate_class.alloc().init())