26#include "../testResource.h"
36IntervalTests::IntervalTests()
45 auto s = Director::getInstance()->getWinSize();
47 auto sun = ParticleSun::create();
48 sun->setTexture(Director::getInstance()->getTextureCache()->addImage(
"Images/fire.png"));
51 sun->setTotalParticles(130);
56 _label0 = Label::createWithBMFont(
"fonts/bitmapFontTest4.fnt",
"0");
57 _label1 = Label::createWithBMFont(
"fonts/bitmapFontTest4.fnt",
"0");
58 _label2 = Label::createWithBMFont(
"fonts/bitmapFontTest4.fnt",
"0");
59 _label3 = Label::createWithBMFont(
"fonts/bitmapFontTest4.fnt",
"0");
60 _label4 = Label::createWithBMFont(
"fonts/bitmapFontTest4.fnt",
"0");
63 schedule([&](
float dt){
67 sprintf(str,
"%2.1f",
_time1);
71 schedule([&](
float dt){
75 sprintf(str,
"%2.1f",
_time2);
79 schedule([&](
float dt){
83 sprintf(str,
"%2.1f",
_time3);
87 schedule([&](
float dt){
91 sprintf(str,
"%2.1f",
_time4);
95 _label0->setPosition(s.width*1/6, s.height/2);
96 _label1->setPosition(s.width*2/6, s.height/2);
97 _label2->setPosition(s.width*3/6, s.height/2);
98 _label3->setPosition(s.width*4/6, s.height/2);
99 _label4->setPosition(s.width*5/6, s.height/2);
111 auto jump = JumpBy::create(3, Vec2(s.width-80,0.0f), 50, 4);
114 sprite->runAction( RepeatForever::create(Sequence::create(jump, jump->reverse(),
nullptr) ));
116 auto item1 = MenuItemFont::create(
"Pause", [&](Ref* sender) {
117 if(Director::getInstance()->isPaused())
118 Director::getInstance()->resume();
120 Director::getInstance()->pause();
122 auto menu = Menu::create(item1,
nullptr);
123 menu->setPosition(s.width/2, s.height-50);
130 if(Director::getInstance()->isPaused())
132 Director::getInstance()->resume();
140 sprintf(time,
"%2.1f",
_time0);
#define ADD_TEST_CASE(__className__)
virtual void update(float dt) override
static cocos2d::Vec2 bottom()
static cocos2d::Vec2 rightTop()
static cocos2d::Vec2 left()
static const char s_pathGrossini[]