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

Method reinitialize

engine/src/entity.cpp:460–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458}
459
460void Player::reinitialize(float x, float y)
461{
462 animationState = 0;
463 cantSwim = 0;
464 swimming = false;
465 isSquished = false;
466 topPadding = storeTopPadding;
467 holding = 0;
468 kicking = 0;
469 lookingUp = false;
470 crouching = false;
471 health = 3;
472 hit = 0;
473 direction = 1;
474 currentState = 0;
475 currentAtlasFrame = Point(0, 0);
476 lastFrame = Point(0, 0);
477 position = Vector2(x, y);
478 ;
479 velocity = Vector2(0.0f, 0.0f);
480 lastVelocity = Vector2(0.0f, 0.0f);
481 currentFrame = 0;
482 jumpCountDown = JUMPFRAMES;
483 toMove.y = 0;
484 lxycol = 0;
485 ldcol = 0;
486}
487
488void Player::Hit()
489{

Callers 1

G_updateFunction · 0.80

Calls 2

PointClass · 0.85
Vector2Class · 0.85

Tested by

no test coverage detected