Working on Collisions

This commit is contained in:
2021-07-10 21:23:45 -04:00
parent de99b127b1
commit 10e5be7a65
6 changed files with 35 additions and 19 deletions

View File

@ -70,19 +70,21 @@ public:
spriteType = sType;
if(sType == spriteAnimation)
{
std::string bogusPath = "src/config/credits.json";
std::ifstream fin(bogusPath);
// std::string bogusPath = "src/config/credits.json";
// std::ifstream fin(bogusPath);
std::ifstream fin(json);
if(fin.is_open()){
std::cout<<"file is open"<<std::endl;
// std::cout<<"file is open"<<std::endl;
} else {
std::cout<<"file is NOT open"<<std::endl;
std::cout<<"json file is NOT open"<<std::endl;
}
if(fin.fail()){
std::cout<<"file open fail"<<std::endl;
std::cout<<"json file open fail"<<std::endl;
} else{
std::cout<<"file open success"<<std::endl;
// std::cout<<"json file open success"<<std::endl;
}
std::ifstream jsonText(json);
@ -111,7 +113,7 @@ 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);
// printf("Adding animation named: %s fromFrame:%d toFrame:%d \n",name,fromFrame,toFrame);
Play(name);
}