Working on Collisions
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user