本文整理汇总了C++中AnimatedSprite::getSpriteType方法的典型用法代码示例。如果您正苦于以下问题:C++ AnimatedSprite::getSpriteType方法的具体用法?C++ AnimatedSprite::getSpriteType怎么用?C++ AnimatedSprite::getSpriteType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnimatedSprite
的用法示例。
在下文中一共展示了AnimatedSprite::getSpriteType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
//.........这里部分代码省略.........
// TO FIGURE OUT HOW TO DO THIS AND HOW TO RESOLVE SUCH COLLISIONS
// RECYCLE THE COLLISION SINCE WE'RE NOW DONE WITH IT
recycledCollisions.push_back(earliestCollision);
}
// APPLY THE REMAINING TIME TO MOVE THE SPRITES. NOTE THAT
// THIS IS ACTUALLY A VERY RISKY, TRICKY STEP BECAUSE IT COULD
// MOVE OBJECTS ALMOST TO THE POINT OF COLLISION, WHICH MAY THEN
// BE DETECTED ALMOST AT TIME 0 NEXT FRAME. THERE ARE OTHER TRICKY
// ISSUES RELATED TO OUR BUFFER AS WELL, SO WE CHEAT A LITTLE HERE
// AND SCALE THE TIME REMAINING DOWN A LITTE
if (currentCollisionTime < 1.0f)
moveAllSpritesToEndOfFrame();
// INIT TILE COLLISION INFO
// SET ON TILE LAST FRAME USING ON TILE THIS FRAME
// SET ON TILE THIS FRAME TO FALSE
spritesIt = sortedSweptShapes[LEFT_EDGE]->begin();
while (spritesIt != sortedSweptShapes[LEFT_EDGE]->end())
{
CollidableObject *sprite = (*spritesIt);
sprite->advanceOnTileStatus();
spritesIt++;
}
// while(!colliding){
for (b2Contact* contact = game->getbworld()->GetContactList(); contact; contact = contact->GetNext()) {
b2Body* a = contact->GetFixtureA()->GetBody();
b2Body* b = contact->GetFixtureB()->GetBody();
AnimatedSprite* c = (AnimatedSprite*) a->GetUserData();
AnimatedSprite* d = (AnimatedSprite*) b->GetUserData();
unsigned int x = c->getSpriteType()->getSpriteTypeID();
unsigned int y = d->getSpriteType()->getSpriteTypeID();
switch(x){
case 0: // player
break;
case 1: //
break;
case 2:
GarbageMon *e;
e= (GarbageMon*)c;
//co.remove(e);
//game->getbworld()->DestroyBody(e->getBody());
//e->collisionResponse(game);
break;
case 4:
//Trash *f = (Trash*)c;
//f->collisionResponse(game);
break;
}
switch(y){
// if (x == 0) {
case 0: // player
break;
case 1: //
break;
case 2:
// colliding = true;
GarbageMon *g;
g= (GarbageMon*)d;
co.push_back(g);
co.remove(g);