Integrated new content, Fixed Map Collision
This commit is contained in:
@ -62,11 +62,12 @@ public:
|
||||
case SDLK_LEFT:
|
||||
transform->velocity.x = -1;
|
||||
// sprite->Play("Walk");
|
||||
sprite->spriteFlip = SDL_FLIP_NONE;
|
||||
break;
|
||||
case SDLK_RIGHT:
|
||||
transform->velocity.x = 1;
|
||||
// sprite->Play("Walk");
|
||||
// sprite->spriteFlip = SDL_FLIP_HORIZONTAL;
|
||||
sprite->spriteFlip = SDL_FLIP_HORIZONTAL;
|
||||
break;
|
||||
case SDLK_k:
|
||||
// game->printDebug("");
|
||||
@ -88,22 +89,21 @@ public:
|
||||
{
|
||||
case SDLK_UP:
|
||||
transform->velocity.y = 0;
|
||||
// sprite->Play("Idle");
|
||||
// sprite->Play("idle");
|
||||
// sprite->spriteFlip = SDL_FLIP_NONE;
|
||||
break;
|
||||
case SDLK_DOWN:
|
||||
transform->velocity.y = 0;
|
||||
// sprite->Play("Idle");
|
||||
// sprite->Play("idle");
|
||||
// sprite->spriteFlip = SDL_FLIP_NONE;
|
||||
break;
|
||||
case SDLK_LEFT:
|
||||
transform->velocity.x = 0;
|
||||
// sprite->Play("Idle");
|
||||
// sprite->Play("idle");
|
||||
break;
|
||||
case SDLK_RIGHT:
|
||||
transform->velocity.x = 0;
|
||||
// sprite->Play("Idle");
|
||||
// sprite->spriteFlip = SDL_FLIP_NONE;
|
||||
// sprite->Play("idle");
|
||||
break;
|
||||
case SDLK_k:
|
||||
if (Game::debugCollisionBoxes)
|
||||
|
@ -96,11 +96,8 @@ public:
|
||||
int toFrame = cJSON_GetObjectItem(animItem, "to")->valueint;
|
||||
Animation anim = Animation(fromFrame,toFrame,100);
|
||||
animations.emplace(name, anim);
|
||||
// printf("Playing animation named: %s fromFrame:%d toFrame:%d \n",name,fromFrame,toFrame);
|
||||
Play(name);
|
||||
// printf("Animation name: \n%s\n",name);
|
||||
// printf("animation.frames: %d\n", animations[name].frames);
|
||||
// printf("animations.index: %d\n", animations[name].index);
|
||||
// printf("animations.speed: %d\n", animations[name].speed);
|
||||
}
|
||||
|
||||
// if(!animations.empty()){
|
||||
@ -108,9 +105,12 @@ public:
|
||||
// }else{
|
||||
// printf("No animations\n");
|
||||
// }
|
||||
// Play("S-Fly");
|
||||
setTex(id);
|
||||
// Play("idle");
|
||||
}
|
||||
Animation Idle = Animation(0,2,100);
|
||||
animations.emplace("Idle", Idle);
|
||||
Play("Idle");
|
||||
setTex(id);
|
||||
}
|
||||
|
||||
SpriteComponent(std::string id, SpriteType sType, char fontLetter, int letterW, int letterH, int letterScale)
|
||||
|
Reference in New Issue
Block a user