Compare commits
2 Commits
272f0bf877
...
134883273e
| Author | SHA1 | Date | |
|---|---|---|---|
| 134883273e | |||
| d8497da0bd |
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1 +1 @@
|
|||||||
UnrealToolbox.exe filter=lfs diff=lfs merge=lfs -text
|
UnrealToolbox.exe filter=lfs diff=lfs merge=lfs -text
|
||||||
@@ -20,6 +20,40 @@ public:
|
|||||||
|
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The movement bounds for the player pawn
|
||||||
|
*/
|
||||||
UPROPERTY(EditAnywhere)
|
UPROPERTY(EditAnywhere)
|
||||||
FBox2D Bounds = FBox2D(FVector2D(-400.0f, -750.0f), FVector2D(-200.0f, 750.0f));
|
FBox2D Bounds = FBox2D(FVector2D(-400.0f, -750.0f), FVector2D(-200.0f, 750.0f));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add to the player's score
|
||||||
|
* @param Amount
|
||||||
|
*/
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
void AddScore(int Amount) { Score += Amount; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the player's current score
|
||||||
|
* @return Current score
|
||||||
|
*/
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
int GetScore() const { return Score; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decrease the player's lives by 1, but not below 0
|
||||||
|
*/
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
void LoseLife() { Lives = FMath::Max(0, Lives - 1); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the player's current lives
|
||||||
|
* @return Current lives
|
||||||
|
*/
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
int GetLives() const { return Lives; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
int Score = 0;
|
||||||
|
int Lives = 3;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user