presidents-brigade/Source/PresidentsBrigade/PlayerPawn.h
Sara Montecino 0bf9105fcd Add boost
2022-11-11 17:33:00 -08:00

72 lines
1.5 KiB
C++
Executable File

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "BasePawn.h"
#include "PlayerPawn.generated.h"
class UCameraComponent;
/**
*
*/
UCLASS()
class PRESIDENTSBRIGADE_API APlayerPawn : public ABasePawn
{
GENERATED_BODY()
public:
// Sets default values for this pawn's properties
APlayerPawn(const FObjectInitializer &object_initializer);
virtual void Tick(float delta_time) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
protected:
UPROPERTY(EditAnywhere, Category="Player")
UCameraComponent* main_camera;
/**
* Multiplier to apply to current speed while boosting. Applies to max speed and accleration.
*/
UPROPERTY(EditAnywhere, Category = "Movement")
float boost_multiplier;
/**
* Time in seconds before auto resetting boost.
*/
UPROPERTY(EditAnywhere, Category = "Movement")
float reset_threshold_s;
/**
* Time in seconds before allowed to boost again.
*/
UPROPERTY(EditAnywhere, Category = "Movement")
float cooldown_threshold_s;
private:
void boost();
void reset_boost();
/**
* Default max speed. Cached when boost is called.
*/
float default_max_speed;
/**
* Default max acceleration. Cached when boost is called.
*/
float default_max_accel;
/**
* Time waited for boost reset.
*/
float reset_wait_s;
/**
* Time waited for cooldown.
*/
float cooldown_wait_s;
};