Skip to content

Commit

Permalink
Merge pull request #10 from kookmin-sw/dev
Browse files Browse the repository at this point in the history
0.0.2
  • Loading branch information
autumn-na authored Mar 29, 2024
2 parents 2c4c080 + 83af509 commit fcf3ad6
Show file tree
Hide file tree
Showing 72 changed files with 715 additions and 169 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions capstone_2024_20/Config/DefaultEngine.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@


[/Script/EngineSettings.GameMapsSettings]
GameDefaultMap=/Game/Level/level_1.level_1
GameDefaultMap=/Game/Level/level_Title.level_Title
GlobalDefaultGameMode=/Game/Blueprints/BP_MyGameModeBase.BP_MyGameModeBase_C
EditorStartupMap=/Game/Level/level_1.level_1
EditorStartupMap=/Game/Level/level_Title.level_Title

[/Script/WindowsTargetPlatform.WindowsTargetSettings]
DefaultGraphicsRHI=DefaultGraphicsRHI_DX12
Expand Down
Binary file not shown.
Binary file modified capstone_2024_20/Content/Blueprints/BP_MyCharacter.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified capstone_2024_20/Content/GameObjects/Telescope/telescope.uasset
Binary file not shown.
Binary file not shown.
Binary file modified capstone_2024_20/Content/Inputs/Mappings/IMC_test.uasset
Binary file not shown.
Binary file modified capstone_2024_20/Content/Level/GraphTest.umap
Binary file not shown.
Binary file modified capstone_2024_20/Content/Level/level_1.umap
Binary file not shown.
22 changes: 22 additions & 0 deletions capstone_2024_20/Source/capstone_2024_20/CannonBall.cpp.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff a/capstone_2024_20/Source/capstone_2024_20/CannonBall.cpp b/capstone_2024_20/Source/capstone_2024_20/CannonBall.cpp (rejected hunks)
@@ -52,11 +52,19 @@
// 여기에 충돌 시 필요한 로직을 구현합니다. 예를 들면, 폭발 이펙트 생성, 피해 적용 등이 있습니다.
// 이 예제에서는 단순히 로그를 출력하는 것으로 처리합니다.
UE_LOG(LogTemp, Warning, TEXT("Projectile hit: %s"), *OtherActor->GetName());
+ GEngine->AddOnScreenDebugMessage(-1,
+ 60.f, FColor::Emerald, TEXT("On Hit!!"));
if (WaterSplashEffect)
{
FVector Scale(3.0f, 3.0f, 3.0f);
UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), WaterSplashEffect, Hit.ImpactPoint, FRotator(0.0f), Scale);
}
// 충돌 후 발사체를 제거합니다.
- Destroy();
+
+
+ if (GetWorld())
+ {
+ FTimerHandle TimerHandle;
+ GetWorld()->GetTimerManager().SetTimer(TimerHandle, this, &ThisClass::DestroyDelay, destroyDelayTime, false);
+ }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@


#include "CannonControlStrategy.h"

#include "MyCannon.h"
#include "MyPlayerController.h"
#include "MyCannon.h"


void CannonControlStrategy::Move(const FInputActionInstance& Instance, AActor* Actor,APlayerController* PlayerController, float DeltaTime)
{
Expand All @@ -22,7 +22,7 @@ void CannonControlStrategy::Move(const FInputActionInstance& Instance, AActor* A
//Cannon->M_ShooterMesh->SetRelativeRotation(NewRotation);

AMyPlayerController* Controller = Cast<AMyPlayerController>(PlayerController);
Controller->ServerRPC_MoveCannon(Cannon, NewRotation);
Controller->ServerRPC_RotateCannon(Cannon, NewRotation);


}
Expand Down
18 changes: 0 additions & 18 deletions capstone_2024_20/Source/capstone_2024_20/Common/UGameSingleton.cpp

This file was deleted.

15 changes: 0 additions & 15 deletions capstone_2024_20/Source/capstone_2024_20/Common/UGameSingleton.h

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions capstone_2024_20/Source/capstone_2024_20/Common/UTickableObject.h

This file was deleted.

39 changes: 39 additions & 0 deletions capstone_2024_20/Source/capstone_2024_20/EnemyShip/EnemyShip.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#include "EnemyShip.h"
#include "../MyShip.h"

AEnemyShip::AEnemyShip(): StaticMesh(nullptr)
{
// TODO@autumn - This is a temporary mesh, replace it with the actual mesh from data
StaticMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("StaticMesh"));
StaticMesh->SetStaticMesh(LoadObject<UStaticMesh>(nullptr, TEXT("/Script/Engine.StaticMesh'/Game/GameObjects/FlatShip/Ship_Ship.Ship_Ship'")));
RootComponent = StaticMesh;
}

void AEnemyShip::BeginPlay()
{
Super::BeginPlay();
}

void AEnemyShip::LookAtMyShip(const AMyShip* MyShip)
{
const auto Direction = MyShip->GetActorLocation() - GetActorLocation();
const auto Rotation = FRotationMatrix::MakeFromX(Direction).Rotator();
SetActorRotation(Rotation);
}

void AEnemyShip::MoveToMyShip(const AMyShip* MyShip)
{
const auto MyShipLocation = MyShip->GetActorLocation();
const auto Direction = MyShipLocation - GetActorLocation();

// Todo@autumn - This is a temporary solution, replace it with data.
if (Direction.Size() < 4000.0f)
{
return;
}

const auto NormalizedDirection = Direction.GetSafeNormal();
constexpr auto Speed = 2500.0f; // Todo@autumn - This is a temporary solution, replace it with data.
const auto NewLocation = GetActorLocation() + NormalizedDirection * Speed * GetWorld()->DeltaTimeSeconds;
SetActorLocation(NewLocation);
}
22 changes: 22 additions & 0 deletions capstone_2024_20/Source/capstone_2024_20/EnemyShip/EnemyShip.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

#include "EnemyShip.generated.h"

class AMyShip;

UCLASS()
class AEnemyShip : public AActor
{
GENERATED_BODY()

public:
AEnemyShip();
virtual void BeginPlay() override;

void LookAtMyShip(const AMyShip* MyShip);
void MoveToMyShip(const AMyShip* MyShip);

private:
UPROPERTY(EditAnywhere)
UStaticMeshComponent* StaticMesh;
};
14 changes: 14 additions & 0 deletions capstone_2024_20/Source/capstone_2024_20/Event/Event.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "Event.h"

AEvent::AEvent(): StaticMesh(nullptr)
{
// TODO@autumn - This is a temporary mesh, replace it with the actual mesh from data
StaticMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("StaticMesh"));
StaticMesh->SetStaticMesh(LoadObject<UStaticMesh>(nullptr, TEXT("/Script/Engine.StaticMesh'/Game/GameObjects/Wood/wood_mesh.wood_mesh'")));
RootComponent = StaticMesh;
}

void AEvent::BeginPlay()
{
Super::BeginPlay();
}
20 changes: 20 additions & 0 deletions capstone_2024_20/Source/capstone_2024_20/Event/Event.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Event.generated.h"

UCLASS()
class CAPSTONE_2024_20_API AEvent : public AActor
{
GENERATED_BODY()

public:
AEvent();

virtual void BeginPlay() override;

private:
UPROPERTY(EditAnywhere)
UStaticMeshComponent* StaticMesh;
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "CoreMinimal.h"
#include "InputAction.h"

/**
*
*/
Expand Down
17 changes: 14 additions & 3 deletions capstone_2024_20/Source/capstone_2024_20/MyCannon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,23 @@ void AMyCannon::MultiCastRPC_FireCannon_Implementation()
// 발사체에 추가적인 로직이 필요하면 여기에 작성
}

void AMyCannon::MoveCannon(FRotator newRot)
void AMyCannon::RotateCannon(FRotator newRot)
{
MultiCastRPC_MoveCannon(newRot);
MultiCastRPC_RotateCannon(newRot);
}

void AMyCannon::MultiCastRPC_MoveCannon_Implementation(FRotator newRot)
void AMyCannon::MultiCastRPC_RotateCannon_Implementation(FRotator newRot)
{
M_ShooterMesh->SetRelativeRotation(newRot);
}

bool AMyCannon::GetIsLoad()
{
return IsLoad;
}

void AMyCannon::SetIsLoad(bool b)
{
IsLoad = b;
}

9 changes: 7 additions & 2 deletions capstone_2024_20/Source/capstone_2024_20/MyCannon.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class CAPSTONE_2024_20_API AMyCannon : public AActor
// Called when the game starts or when spawned
virtual void BeginPlay() override;

private:
bool IsLoad = false;

public:
// Called every frame
virtual void Tick(float DeltaTime) override;
Expand Down Expand Up @@ -49,10 +52,12 @@ class CAPSTONE_2024_20_API AMyCannon : public AActor
void MultiCastRPC_FireCannon();

UFUNCTION()
void MoveCannon(FRotator newRot);
void RotateCannon(FRotator newRot);

UFUNCTION(NetMulticast, Reliable)
void MultiCastRPC_MoveCannon(FRotator newRot);
void MultiCastRPC_RotateCannon(FRotator newRot);

bool GetIsLoad();
void SetIsLoad(bool b);

};
Loading

0 comments on commit fcf3ad6

Please sign in to comment.