-
Notifications
You must be signed in to change notification settings - Fork 0
/
DefyingGravityCharacter.h
117 lines (91 loc) · 3.89 KB
/
DefyingGravityCharacter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "PaperCharacter.h"
#include "DefyingGravityCharacter.generated.h"
// This class is the default character for DefyingGravity, and it is responsible for all
// physical interaction between the player and the world.
//
// The capsule component (inherited from ACharacter) handles collision with the world
// The CharacterMovementComponent (inherited from ACharacter) handles movement of the collision capsule
// The Sprite component (inherited from APaperCharacter) handles the visuals
class UTextRenderComponent;
UCLASS(config=Game)
class ADefyingGravityCharacter : public APaperCharacter
{
GENERATED_BODY()
/** Side view camera */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera, meta=(AllowPrivateAccess="true"))
class UCameraComponent* SideViewCameraComponent;
/** Camera boom positioning the camera beside the character */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
class USpringArmComponent* CameraBoom;
UTextRenderComponent* TextComponent;
virtual void Tick(float DeltaSeconds) override;
/** Collection Sphere */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Block", meta = (AllowPrivateAccess = "true"))
class USphereComponent* CollectionSphere;
protected:
// The animation to play while running around
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Animations)
class UPaperFlipbook* RunningAnimation;
// The animation to play while idle (standing still)
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Animations)
class UPaperFlipbook* IdleAnimation;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Animations)
class UPaperFlipbook* catWalkAnimation;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Animations)
class UPaperFlipbook* idleCatAnimation;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Animations)
class UPaperFlipbook* JumpCatAnimation;
/** Called to choose the correct animation to play based on the character's movement state */
void UpdateAnimation();
/** Called for side to side input */
void MoveRight(float Value);
void UpdateCharacter();
/** Handle touch inputs. */
void TouchStarted(const ETouchIndex::Type FingerIndex, const FVector Location);
/** Handle touch stop event. */
void TouchStopped(const ETouchIndex::Type FingerIndex, const FVector Location);
// APawn interface
virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
// End of APawn interface
bool bPast;
bool bChangeMap;
bool bActive;
FString gravityDir;
public:
ADefyingGravityCharacter();
/** Returns SideViewCameraComponent subobject **/
FORCEINLINE class UCameraComponent* GetSideViewCameraComponent() const { return SideViewCameraComponent; }
/** Returns CameraBoom subobject **/
FORCEINLINE class USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
/** Return CollectionSphere subobject*/
FORCEINLINE class USphereComponent* GetCollectionSphere() const { return CollectionSphere; }
/** called when we press a key to collect any pickups inside the CollectionSphere*/
UFUNCTION(BlueprintCallable, Category = "Block")
void changeGravity();
UFUNCTION(BlueprintCallable, Category = "Time")
void changeTime();
UFUNCTION(BlueprintCallable, Category = "Time")
void setPast(bool bPast);
UFUNCTION(BlueprintPure, Category = "Time")
bool isPast();
UFUNCTION(BlueprintPure, Category = "Power")
float getMaxPower();
UFUNCTION(BlueprintPure, Category = "Power")
float getPower();
bool isChangingMap();
void setbChangeMap(bool bChangeMap);
void setGravityDir(FString gravityDir);
FString getGravityDir();
void upGravity();
void downGravity();
void leftGravity();
void rightGravity();
UFUNCTION(BlueprintCallable, Category = "State")
void getActiveFromGameMode(bool bActive);
float power;
float maxPower;
float decayrate;
bool readyJump;
};