Implement enemy shooting and scale down for more arcade game feel
This commit is contained in:
43
Source/MyProject3/EnemyProjectile.h
Normal file
43
Source/MyProject3/EnemyProjectile.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "EnemyProjectile.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class MYPROJECT3_API AEnemyProjectile : public AActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
AEnemyProjectile();
|
||||
|
||||
protected:
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
|
||||
class UStaticMeshComponent* ProjectileMesh;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
|
||||
class UProjectileMovementComponent* ProjectileMovement;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Projectile")
|
||||
float ProjectileSpeed = 2500.0f; // Slightly slower than player projectiles
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Projectile")
|
||||
float DamageAmount = 10.0f; // Less damage than player projectiles
|
||||
|
||||
// Add a particle effect for impact
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Effects")
|
||||
class UParticleSystem* ImpactEffect;
|
||||
|
||||
UFUNCTION()
|
||||
void OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp,
|
||||
FVector NormalImpulse, const FHitResult& Hit);
|
||||
|
||||
// Add an overlap handler for redundant collision detection
|
||||
UFUNCTION()
|
||||
void OnOverlapBegin(UPrimitiveComponent* OverlappedComp, AActor* OtherActor,
|
||||
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex,
|
||||
bool bFromSweep, const FHitResult& SweepResult);
|
||||
};
|
||||
Reference in New Issue
Block a user