bool liubei::init(){ if (!zhaoyun::init()) { return false; } name="liubei"; winsize=Director::getInstance()->getWinSize(); animate=false; Max_Hp=200; nowhp=Max_Hp; make_comb=false; //未写的 atk=1.8;//攻击段数为3. Max_mp=20; nowmp=20; lv=1; //等级 Max_exe=50;//最大经验 nowexe=0;//当前经验 speed=3.8;//速度 //未写的 ui_name="刘备"; ui_picture="刘备.png"; ui_description="刘备字玄德,东汉末年幽州涿郡涿县人,西汉\n中山靖王刘胜的后代,三国时期蜀汉开国皇帝,\n政治家,史家又称他为先主刘备少年与公孙瓒\n拜卢植为师求学,而后参与镇压黄巾起义。与关\n羽、张飞先后救援过北海孔融、徐州陶谦等。刘备\n早期颠沛流离,后于赤壁之战与孙权联盟击败曹操,\n趁势夺取荆州,而后进取益州,建立蜀汉政权。陈寿\n评刘备机权干略不及曹操,但其弘毅宽厚,知人待士,\n百折不挠,终成帝业。刘备自己也曾说过,自己做事\n“每与操反,事乃成尔”。公元221年,刘备在成都称帝,\n国号汉,年号章武,史称蜀或蜀汉\n公元223年,刘备病逝于白帝城,终年63岁,\n谥号昭烈皇帝."; this->initWithFile("liub.png",Rect(0,0,192/4,256/4)); Sprite*maxhp=Sprite::create("max_hp.0.png"); maxhp->setRotation(90); maxhp->setAnchorPoint(ccp(0.5,0)); maxhp->setPosition(0,this->getContentSize().height); this->addChild(maxhp,0,1); Sprite*hp=Sprite::create("hp.png"); hp->setPosition(0,this->getContentSize().height); hp->setRotation(90); hp->setAnchorPoint(ccp(0.5,0)); this->addChild(hp,0,2); loading_animation(); scheduleUpdate(); return true; }
bool zhugeliang::init(){ if (!zhaoyun::init()) { return false; } name="zhugeliang"; winsize=Director::getInstance()->getWinSize(); animate=false; Max_Hp=80; nowhp=Max_Hp; make_comb=false; //未写的 atk=5;//攻击段数为3. Max_mp=50; nowmp=50; lv=1; //等级 Max_exe=50;//最大经验 nowexe=0;//当前经验 speed=3;//速度 //未写的 ui_name="诸葛亮"; ui_picture="诸葛亮.png"; ui_description="诸葛亮,字孔明,号卧龙,汉族,徐州琅琊\n阳都人,三国时期蜀汉丞相,杰出的政治家、\n军事家、散文家、书法家、发明家。在世时\n被封为武乡侯,死后追谥忠武侯,东晋政权\n因其军事才能特追封他为武兴王。其散文代表\n作有《出师表》、《诫子书》等。曾发明木\n牛流马、孔明灯等,并改造连弩,叫做诸葛\n连弩,可一弩十矢俱发。于建兴十二年\n(234年)在五丈原逝世。"; this->initWithFile("zgl.png",Rect(0,0,192/4,256/4)); Sprite*maxhp=Sprite::create("max_hp.0.png"); maxhp->setRotation(90); maxhp->setAnchorPoint(ccp(0.5,0)); maxhp->setPosition(0,this->getContentSize().height); this->addChild(maxhp,0,1); Sprite*hp=Sprite::create("hp.png"); hp->setPosition(0,this->getContentSize().height); hp->setRotation(90); hp->setAnchorPoint(ccp(0.5,0)); this->addChild(hp,0,2); loading_animation(); scheduleUpdate(); return true; }
bool machao::init(){ if (!zhaoyun::init()) { return false; } name="macao"; winsize=Director::getInstance()->getWinSize(); animate=false; Max_Hp=90; nowhp=Max_Hp; make_comb=false; //未写的 atk=3.2;//攻击段数为3. Max_mp=20; nowmp=20; lv=1; //等级 Max_exe=50;//最大经验 nowexe=0;//当前经验 speed=6;//速度 //未写的 ui_name="马超"; ui_picture="马超.png"; ui_description="马超,字孟起,扶风茂陵人,卫尉马腾\n之子,东汉末年及蜀汉开国名将,汉末群雄之\n一。早年随父征战,马腾入京后,马超留驻割\n据三辅。潼关之战被曹操击败后,又割据陇上\n诸郡。失败后投靠张鲁,又转投刘备。刘备建\n立蜀汉后,马超官至骠骑将军、斄乡侯、凉州\n牧。于章武二年十二月病逝(223年1月),\n终年47岁,追谥威侯。《三国演义》及民间\n文化中绰号“锦马超”,因俊秀容貌与狮盔兽\n带、白袍银甲的非凡装束而得名,\n有“不减吕布之勇”。"; this->initWithFile("mac.png",Rect(0,0,192/4,256/4)); Sprite*maxhp=Sprite::create("max_hp.0.png"); maxhp->setRotation(90); maxhp->setAnchorPoint(ccp(0.5,0)); maxhp->setPosition(0,this->getContentSize().height); this->addChild(maxhp,0,1); Sprite*hp=Sprite::create("hp.png"); hp->setPosition(0,this->getContentSize().height); hp->setRotation(90); hp->setAnchorPoint(ccp(0.5,0)); this->addChild(hp,0,2); loading_animation(); scheduleUpdate(); return true; }
void BaseTab::AdvanceLoadingAnimation(TabRendererData::NetworkState old_state, TabRendererData::NetworkState state) { static bool initialized = false; static int loading_animation_frame_count = 0; static int waiting_animation_frame_count = 0; static int waiting_to_loading_frame_count_ratio = 0; if(!initialized) { initialized = true; ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); SkBitmap loading_animation(*rb.GetBitmapNamed(IDR_THROBBER)); loading_animation_frame_count = loading_animation.width() / loading_animation.height(); SkBitmap waiting_animation(*rb.GetBitmapNamed(IDR_THROBBER_WAITING)); waiting_animation_frame_count = waiting_animation.width() / waiting_animation.height(); waiting_to_loading_frame_count_ratio = waiting_animation_frame_count / loading_animation_frame_count; } // The waiting animation is the reverse of the loading animation, but at a // different rate - the following reverses and scales the animation_frame_ // so that the frame is at an equivalent position when going from one // animation to the other. if(state != old_state) { loading_animation_frame_ = loading_animation_frame_count - (loading_animation_frame_ / waiting_to_loading_frame_count_ratio); } if(state != TabRendererData::NETWORK_STATE_NONE) { loading_animation_frame_ = (loading_animation_frame_ + 1) % ((state == TabRendererData::NETWORK_STATE_WAITING) ? waiting_animation_frame_count : loading_animation_frame_count); } else { loading_animation_frame_ = 0; } ScheduleIconPaint(); }