Wednesday, August 3, 2022
HomeGame DevelopmentAcquired a bug with body animation? - C++

Acquired a bug with body animation? – C++


I’m positive there isn’t any error within the location of the plist file and png picture, why is that this error nonetheless displaying?
the code as follows:

SpriteFrameCache::getInstance()->addSpriteFramesWithFile("/protagonist_move/a.plist");
	auto pSprite2 = Sprite::create();
	pSprite2->setPosition(500, 600);
	this->addChild(pSprite2,2);
	Vector<SpriteFrame*>record;
	record.reserve(2);
	record.pushBack(SpriteFrameCache::getInstance()->getSpriteFrameByName("/protagonist_move/10001.png"));
    record.pushBack(SpriteFrameCache::getInstance()->getSpriteFrameByName("/protagonist_move/10002.png"));
	auto pAnimation = Animation::createWithSpriteFrames(record, 0.2f, 1000);
	auto pAnimate = Animate::create(pAnimation);
	pSprite2->runAction(pAnimate);

the errors as follows:


please take away “/” from “”/protagonist_move/a.plist” => ““protagonist_move/a.plist”

The issue nonetheless exists after modification

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments