MCPcopy Create free account
hub / github.com/atraczyk/2d-engine / Hit

Method Hit

engine/src/entity.cpp:488–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486}
487
488void Player::Hit()
489{
490 sound.PlaySfx(SOUND_HURT);
491 hit = 120;
492 health--;
493 score--;
494 if (health < 2 && !crouching)
495 topPadding += (size.y / 2 - bottomPadding);
496 else if (!crouching)
497 topPadding = storeTopPadding;
498}
499
500void Player::update(WorldRect* pconstraints, TileMap* pcollisionmap,
501 TileMap* pfrontmap, std::vector<TileMap>* pdcollisionmaps,

Callers

nothing calls this directly

Calls 1

PlaySfxMethod · 0.80

Tested by

no test coverage detected