Forum > C# > CCCallFunc problems from within a class

CCCallFunc problems from within a class

By petemyster Posted 2012-03-16 17:13 Comments 1
petemyster
  • Posts: 5

Hey guys, I’ve used the objective-c cocos2d and am currently porting my game to windows phone.

I have a class called AnimalClass, which extends CCObject, and a class CatClass which extends AnimalClass.

I am trying to use CCCallFunc but I’m having problems with the selector. When I’m creating the instance of CCCallFunc its complaining about “not able to convert from CatClass to cocos2d.selectorProtocol” when I’m passing in “this” to the method.

The hierarchy is..

class AnimalClass : CCObject
class CatClass : AnimalClass

And what I want to do is..

CCCallFunc example= CCCallFunc.actionWithTarget(this, new SEL_CallFunc(StartLoopingFall));

Any idea what I need to do to get this working? Thanks in advance!

petemyster
  • Posts: 5

#1 RE: 2012-03-16 23:02

Urgh I feel silly, I should have made AnimalClass extend CCnode, not CCObject. I blame me being out of practice :p

Loggin to reply

Copyright © 2010 - 2013 Cocos2d-x.orgClustrmaps