Exemplo n.º 1
0
void ChestEntity::dropItem(enumItemType item)
{
  ItemEntity* newItem = new ItemEntity(item, x, y);
  newItem->setVelocity(Vector2D(50.0f + rand()% 140));
  if (newItem->getVelocity().y < 0.0f) newItem->setVelocity(Vector2D(newItem->getVelocity().x, -newItem->getVelocity().y));
  newItem->setViscosity(0.96f);
  newItem->startsJumping();
}