void Check_collision(void) { BallCollision(); MineCollision(); PlayerCollision(); AsteroidCollision(); }
void BacteroidsState::DoCollision(GameObject *obj1, GameObject *obj2, const vec2f &from2To1, float dist) { switch (obj1->GetType()) { case Bacter::TYPE: BacterCollision((Bacter*)obj1, obj2, from2To1, dist); break; case Player::TYPE: PlayerCollision((Player*)obj1, obj2, from2To1, dist); break; case Projectile::TYPE: ProjectileCollision((Projectile*)obj1, obj2, from2To1, dist); break; default: break; } }
void cGoomba :: Update( void ) { if( dead ) { if( visible ) { DieStep(); } return; } walk_count += Framerate.speedfactor; if( walk_count > anispeed ) { walk_count = 1; } if( walk_count > anispeed/2 ) { SetImage( 0 ); } else { SetImage( 1 ); } CheckOnground(); if( !onGround && vely < 25 ) { AddVel( 0,2 + ( vely * 0.05 ) ); } else if( onGround && vely > 0 ) { vely = 0; } if( CollideMove() != DIR_NOTHING ) { SDL_Rect r2 = Get_Collision_rect(); if( iCollisionType && iCollisionType != 4 ) { if( col_dir == DIR_RIGHT || col_dir == DIR_LEFT ) { velx *= -1; Move( velx, vely ); } } else if( posx < 1 ) { velx *= -1; Move( velx, vely ); } if( iCollisionType == 4 && massive ) { PlayerCollision( col_dir ); if( EnemyObjects.size() && !dead && image ) { if( col_dir != -1 ) { velx *= -1; } Move( velx, vely ); } } } if( EnemyObjects.size() && !dead && image ) { Draw( screen ); } }
void MyPS2Application::CheckCollision() { BlockCollision(); PlayerCollision(); }