void Enemy::hitBottom(JvObject* Contact,double Velocity) { if(Contact==GameState::heroP){ Hero* herop = (Hero*)Contact; if(herop->getStatusModel()=="man"){ herop->dieBomb(); }else{ kill(); } return; } JvSprite::hitBottom(Contact,Velocity); }
void Enemy::hitRight(JvObject* Contact,double Velocity) { if(Contact->name =="hero"){ Hero* herop = (Hero*)Contact; if(herop->getStatusModel()=="man"){ herop->dieBomb(); }else{ kill(); } return; } velocity.x=-velocity.x; }
void Enemy::hitTop(JvObject* Contact,double Velocity) { if(Contact->name =="hero"){ Hero* herop = (Hero*)Contact; if(herop->getStatusModel()=="man"){ herop->dieBomb(); }else{ kill(); } return; } JvSprite::hitTop(Contact,Velocity); }