0

I've started working with cocos2d few days ago...and im working on small 2d game. I figured out how to animate sprites. Now when sprite finished with animation I want it to be cleared from screen.

How to pass argument to callback function?

target.runAction(CCSequence.actions(repeatAnimation,
                        CCCallFuncND.action(this, "deleteTarget",target)));

Function is defined as:

public void deleteTarget(Object target)

It always gives me "NoSuchMethodException"...any idea?

Veljko
  • 1,823
  • 6
  • 27
  • 55

1 Answers1

3

Do it like this

CCCallFuncN ccfun = CCCallFuncN.action(this, "test");

public void test(Object sender) {
    Do whatever you require
}
j0k
  • 21,914
  • 28
  • 75
  • 84
Ajit
  • 214
  • 1
  • 6