frozax
February 27, 2012, 8:05pm
#1
Hi,
I posted a small tutorial with source code on how to implement a shake action in cocos2d-x.
Feel free to use the code for your own games.
http://www.frozax.com/blog/2012/02/how-to-create-shake-action-cocos2d-x-source-code/
Hoping some devs will find it useful.
Francois.
2 Likes
ex1
February 27, 2012, 10:09pm
#2
hey, nice blog. looking forward to more tutorials
frozax
February 29, 2012, 10:36am
#3
Thanks, glad you like it
I’ll try to write more tutorials, but probably after my game is released, though.
CCActionInterval.h is not recognized in cocos2dx version 2.2.5, what should i Do?
yagoub
August 29, 2014, 9:07am
#5
Thanks, but i use cocos2d-x v3 , so there’s no ccTime.
Could you update this code please ?
yagoub
August 29, 2014, 9:20am
#6
I have replaced ccTime by float , is this correct ?
there’s two errors :
CCShake *p_action = new CCShake(); // Allocating an object of abstract class type CCShake
m_pTarget->setPosition( Point( _initial_x, _initial_y ) ); // use of undeclared identifier 'm_pTarget'
Tanks.
yagoub
August 29, 2014, 10:05am
#7
I fixed it :
1- we have to implement two methods :
virtual CCShake* reverse() const override;
virtual CCShake* clone() const override;
2- change m_pTarget
to _target
.