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
1
vote
2 answers

Cocos2d - Actions and Animations are not paused

When I do this: [gameLayer pauseSchedulerAndActions]; Most of the game pauses, but the sprites that are undergoing this action do not pause spinning: [sprite runAction:[CCRepeatForever actionWithAction:[CCRotateBy actionWithDuration:5.0 angle:…
soleil
  • 12,133
  • 33
  • 112
  • 183
1
vote
2 answers

Run many effect actions simultaneously in Cocos2dx

I'm new to Cocos2dx and I'm trying to create a planet animation rotate itself by using a 3:1 rectangle texture, which contains 3 squares are two faces (map) of sphere (the third square is a clone of the first one). I create a frames array by…
eee
  • 280
  • 4
  • 15
1
vote
2 answers

setting sprite display duration

The delayperunit property in my code below keeps the sprite on screen for 2.5 seconds before it changes. What I actually want to do is display the sprite for 0.5 seconds so that there is 2.0 second break (no animation displayed) before the next one…
oopology
  • 1,072
  • 1
  • 10
  • 19
1
vote
4 answers

Cocos 2D is it possible to add more CCActions to a node during execution?

I have a node in my game that I'd like to be able to queue up additional actions after it's already started executing. Is this even a possibility?
InkGolem
  • 2,662
  • 1
  • 15
  • 22
1
vote
0 answers

When my Cocos2d game resumes from the background, animation actions stutter

I have a sprite that I am rotating on a menu screen in my Cocos2d game like this: CCAction* action = [CCRepeatForever actionWithAction: [CCRotateBy actionWithDuration:1.0 angle:90.0f]]; [sprite runAction:action]; The…
Brian Stewart
  • 9,157
  • 11
  • 54
  • 66
0
votes
1 answer

Using CCEaseOut together with CCSequence?

I want my action have an effect ease in / ease out, but I already have CCSequence. If I put CCEaseOut in front of my code, movement become weird. Is it possible to make CCEaseOut/CCEaseIn with CCSequence ? Here is my code : [player…
Alex Moskalev
  • 607
  • 7
  • 15
0
votes
1 answer

CCAction: Stopping and running

For my project, I've created a running character. Currently, I am attempting to implement different animations for the character. I've decided to create 2 different actions 1) CCAction *walkAction; 2) CCAction *jumpAction; When the character is…
Sushi Ninja
  • 1
  • 1
  • 1
0
votes
1 answer

Can a CCSprite switch between multiple animations?

Is it possible to make a CCSprite switch between two different animations? (both are CCRepeatForever) I try to use stopAction: and runAction: but it crashes the app. I can only use pauseSchedulerAndActions: and resumeSchedulerAndActions: with one…
eazimmerman
  • 599
  • 4
  • 20
0
votes
1 answer

cocos2d help: CCMenuItem unselected 'EXC_BAD_ACCESS' and CCCallFunc

I've been having problems with CCMenuItem and its timing with CCCallFunc. Basically I'm getting 'EXC_BAD_ACCESS' @ this line of the CCMenuItem class -(void) ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event { ... [selectedItem_…
0
votes
2 answers

CCMoveBy behaviour

I'm getting stuck to implement some Cocos2D animations for my Tetris clone(that works perfectly, no logic bugs, i just want to perform some smooth animation when deleting rows). The current code(no animation) just drops the block position, like…
Fernando
  • 7,785
  • 6
  • 49
  • 81
0
votes
1 answer

Sequential cocos2d actions on different nodes

I need to run sequential cocos2d actions on different nodes. I know about CCSequence but that is not good for me since it allows running sequence of actions on the same node. How would I go about running sequential actions for this scenario: Move…
Eimantas
  • 48,927
  • 17
  • 132
  • 168
0
votes
1 answer

How to Export a Flash tween or timeline animation as cocos2d-x actions?

Is there a way to export Flash tweens so that we can use them in cocos2d-x? Our goals are to let our artist use flash to create the dialog animations, and then export the matrix animations (not the images). Then we would use the matrix animations to…
ohthepain
  • 2,004
  • 3
  • 19
  • 30
0
votes
1 answer

Call function with 3 parameter when sprite finished action

I have sprite with a Move action, I want to call a function with 3 parameters when sprite finish Move action, I try to use CC_CALLBACK_3and CallFuncN but i don't know where I put my parameters.
user3496448
  • 9
  • 1
  • 5
0
votes
1 answer

Using a random point in two actions

Sorry I'm new to this. Right now I'm trying to create an endless randomly moving sprite that rotates to its direction. However I can't figure out how to use the random location generated from randomPoint on the rotateAction. Basically the bug…
0
votes
1 answer

Cocos2d CCActionSequence order and delay messed up

I'm working on cocos2d V3.x project (SpriteBuilder V1.2.1). Currently trying to run this action sequence with a delay on a CCSprite. I'm not sure if there is a problem or maybe I just don't understand how CCActionSequence works. I want action 'a' to…
Fdo
  • 1,053
  • 4
  • 15
  • 38