2010-11-10 17:47:06 +08:00
|
|
|
#ifndef _ACCELEROMETER_TEST_H_
|
|
|
|
#define _ACCELEROMETER_TEST_H_
|
|
|
|
|
|
|
|
#include "../testBasic.h"
|
2011-03-08 13:49:58 +08:00
|
|
|
|
2012-06-14 05:19:13 +08:00
|
|
|
USING_NS_CC;
|
2011-03-08 13:49:58 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
class AccelerometerTest: public Layer
|
2010-11-10 17:47:06 +08:00
|
|
|
{
|
2011-03-08 13:49:58 +08:00
|
|
|
protected:
|
2013-06-20 14:17:10 +08:00
|
|
|
Sprite* _ball;
|
2013-06-15 14:03:30 +08:00
|
|
|
double _lastTime;
|
2011-03-08 13:49:58 +08:00
|
|
|
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
AccelerometerTest(void);
|
|
|
|
~AccelerometerTest(void);
|
2011-03-08 13:49:58 +08:00
|
|
|
|
2013-11-20 11:21:30 +08:00
|
|
|
void onAcceleration(Acceleration* acc, Event* event);
|
2011-03-08 13:49:58 +08:00
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const;
|
|
|
|
virtual void onEnter() override;
|
2010-11-10 17:47:06 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class AccelerometerTestScene : public TestScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void runThisTest();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|