-
Notifications
You must be signed in to change notification settings - Fork 2
/
FShake.h
37 lines (28 loc) · 1.23 KB
/
FShake.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef __SHAKE_H__
#define __SHAKE_H__
#include "2d/CCActionInterval.h"
class FShake : public cocos2d::ActionInterval
{
// Code by Francois Guibert
// Contact: www.frozax.com - http://twitter.com/frozax - www.facebook.com/frozax
public:
FShake();
// Create the action with a time and a strength (same in x and y)
/** @deprecated Use `create()` instead. */
CC_DEPRECATED_ATTRIBUTE static FShake* actionWithDuration(float d, float strength );
static FShake* create(float d, float strength );
// Create the action with a time and strengths (different in x and y)
/** @deprecated Use `create()` instead. */
CC_DEPRECATED_ATTRIBUTE static FShake* actionWithDuration(float d, float strength_x, float strength_y );
static FShake* create(float d, float strength_x, float strength_y );
bool initWithDuration(float d, float strength_x, float strength_y );
virtual void update(float time);
virtual void stop(void);
virtual FShake* clone();
protected:
// Last displacement of the shaked node
float _displacement_x, _displacement_y;
// Strength of the action
float _strength_x, _strength_y;
};
#endif //__SHAKE_H__