void Spiker::update(Player& player, Plataforma& plataforma1, Plataforma& plataforma2, Plataforma& plataforma3) { if(!locked) { //speed with gravity update ObjectInGame::update(); fall = true; collidePlayer(player); collidePlatform(plataforma1); collidePlatform(plataforma2); collidePlatform(plataforma3); calcSpriteSpeed(); if(dead) { speed.setX(0); } } }
void Player::collide(GameObject& o) { if(o.hasTag("platform")) collidePlatform(o); else if(o.hasTag("youngling")) collideYoungling(o); else if(o.hasTag("heart")) collideHeart(o); else if(o.hasTag("meany")) collideMeany(o); else if(o.hasTag("exit_portal")) collideExitPortal(o); else if(o.hasTag("king")) collideKing(o); }