Questions tagged [ccaction]

CCAction is a class from the popular Cocos2d engine

CCAction is a class from the popular Cocos2d engine

Class Reference

64 questions
0
votes
1 answer

CCActionDelay in End Game Sequence

My hero sprite is on a physics sprite. If the player (user) doesn't move the hero for 2 seconds while touching the sprite I want to end the game. In the update method I am checking to see if the two sprites are touching for longer than 2 seconds and…
Asdrubal
  • 2,421
  • 4
  • 29
  • 37
0
votes
0 answers

CCSprite animation stops when running other action in Cocos2D v3.x iOS

I'm animating a sprite in my game (via sprite sheets etc.). It's a simple animation, which I want to happen throughout the life of game. The sprite is also a physics body. And when the screen is touched, I want sprite to perform some actions. I've…
Hyder
  • 1,163
  • 2
  • 13
  • 37
0
votes
1 answer

CCActionSequence for two different objects

I want to move two different objects, pane1 and pane2, simultaneously using CCActionMoveTo, and I want to call a function once these two objects finish moving. CCActionMoveTo * actionMove1 = [CCActionEaseOut actionWithAction: …
Aeisys
  • 367
  • 1
  • 3
  • 13
0
votes
1 answer

How to add multiple sprites with time interval of 3 seconds and run same CCAction for all in cocos2d

Please help me as am fed with the searches and new to cocos 2d. Only am getting is the last sprite got moving if i schedule addRed and i want all the sprites moving randomly in the screen. Any help will be Appreciated and thanks in…
Rojonrocks
  • 11
  • 1
0
votes
1 answer

Cocos2d-x 3.0 Label limit?

Is there a limit to how big a Label can be in cocos2d-x 3.0? I'm trying to create a 'typewriter' effect and it seems to work when the string is 45 characters or less. If it's any more if fails with the usual EXC_BAD_ACCESS. Below is the code I'm…
SpellChucker
  • 450
  • 5
  • 18
0
votes
1 answer

Cocos2d match target speed to scrolling background

I'm Using Cocos2d Android. I have a scrolling background in Cocos2d, i use this method to make it work : public void moveBackground(float dt) { bg1.setPosition(CGPoint.ccp(bg1.getPosition().x, bg1.getPosition().y - speed)); …
Tsunaze
  • 3,204
  • 7
  • 44
  • 81
0
votes
1 answer

My CCTargetedAction runs action twice

In cocos2d v3, I could not find something like CCTargetedAction. It is required in my project, so I copied code from cocos2d v2. @interface CCTargetedAction : CCActionInterval /** This is the target that the action will be forced to run with…
noprops
  • 311
  • 3
  • 12
0
votes
1 answer

cocos2d CCDrawNode scale bounding box

I'm using cocos2d and I create a CCDrawNode. The moment I call addChild: to add the CCDrawNode I call the following method to make the node scale forever: CCActionScaleBy *scaleAction = [CCActionScaleBy actionWithDuration:0.3f…
jkigel
  • 1,592
  • 6
  • 28
  • 49
0
votes
2 answers

Move multiple CCSprite across the screen Cocos2dx

I have an Init method and spawn() method which is called by a CCAction every 2 seconds! What i want is to move pipePair node across the screen every 2 seconds, something like in the flappy bird game! But in my case am not able to add multiple pairs…
Harsh
  • 2,852
  • 1
  • 13
  • 27
0
votes
0 answers

CCRepeatAction causing Win32 App to crash on closing

Could someone help me figure out how to safely stop all actions when closing a Win32 cocos2dx app that is running CCRepeatAction. I have tried adding sprite->stopAllActions(); in the Destructor, OnExit() and in the update(float delta); methods but…
badboy11
  • 541
  • 1
  • 6
  • 19
0
votes
2 answers

Cocos2d-x ccaction not called and ccsequence create issue

I'm trying to do what I did hundred of times with cocos2d, but with cocos2d-x seems I have less luck. If i do CCsequence *squence = CCSequence::create(someAction1, someAction2, NULL); the compiler says: No matching function for call to…
Adarkuccio
  • 973
  • 4
  • 12
  • 24
0
votes
1 answer

Is it possible to run a fadeOut action half way through a move action?

I am wondering if it is possible to run a fadeOut action half way through a moveTo action all on the same node. Here is my code: id show = [CCShow action]; id move = [CCMoveTo actionWithDuration:2.5f position:ccp(70, 275)]; id seq = [CCSequence…
Stephen
  • 499
  • 9
  • 28
0
votes
0 answers

Change CCAnimation Frame Rate

I am working on a sidescroller game in cocos2d. I have a CCAction derived from a CCAnimation that runs on a CCSprite. I run the CCAction with CCRepeatForever, but I’m not able to change the animation frame rate while the action is being…
0
votes
1 answer

how to change a sprite's Image during a sequence of actions

In my code (sample) below I would like to change the sprite's image during the sequence of actions. spriteActions = [CCRepeatForever actionWithAction: [CCSequence actions: [CCShow action], …
0
votes
0 answers

how can I synchronise a sequence of actions on two sprites?

I have two sprites that I want to run a sequence of actions on. Though one sprite is created before the other I would like the latter sprites actions to synchronise with the former. How can this be achieved bearing in mind that some actions of the…
IMustCode
  • 109
  • 8