Forums » C# Framework » sel_shedule »
| shivalingesh nashipur | sel_shedule | ||||
|---|---|---|---|---|---|
|
Added by shivalingesh nashipur about 1 year ago
hey guys am a beginner for cocos and wp7, i worked with wp7 simple game, now using cocos2dx in it can any help me with this to convert to c# of cocos2dx |
||||
| RongHong Huang | RE: sel_shedule | ||||
|
Added by RongHong Huang about 1 year ago
it must be: this.schedule(gameLogic, 1.0f); |
||||
| shivalingesh nashipur | RE: sel_shedule | ||||
|
Added by shivalingesh nashipur about 1 year ago
thats the thing i did first, but the error is something like |
||||
| RongHong Huang | RE: sel_shedule | ||||
|
Added by RongHong Huang about 1 year ago
from what you said, you should define gameLogic like this: public void gameLogic(float interval) |
||||
| shivalingesh nashipur | :-) thanks, but i am not able to remove the childs check the code below? | ||||
|
Added by shivalingesh nashipur about 1 year ago
CCMoveTo actionmove=CCMoveTo.actionWithDuration(actualDuration,new CCPoint(-tSprite.contentSize.width / 2,actualY)); public void spritemovefinished()
{
if i didnt remove child it works well , but i facing mscorlib.dll!systemthrowHelper.ThrowKeyNotFoundException()+0X5 |
||||
| game dev | RE: sel_shedule | ||||
|
Added by game dev about 1 year ago
if you change the touches method in hello cocos2d project with
public override void ccTouchesBegan(List<CCTouch> touches, CCEvent event_)
{
this.removeChild(this.pSprite, true);
}
then it works fine, maybe you added pSprite to a batch node and not to class. |
||||
| Raghu S | RE: sel_shedule | ||||
|
Added by Raghu S about 1 year ago
In case you are defining this as a behavior to a class object, then this should work
public void RemoveThisObject()
{
this.removeFromParentAndCleanup( true );
}
|
||||
| game dev | RE: sel_shedule | ||||
|
Added by game dev about 1 year ago
whats also interesting is that if you call this.removeChild(this.pSprite,true); more than once when the sprite is already removed it wont crash unlike in cocos2dx/c++ |
(1-7/7)