[UE5] ๐Ÿš€ Project Galaga (14)

Singery00ยท2024๋…„ 5์›” 21์ผ
0

Project Galaga

๋ชฉ๋ก ๋ณด๊ธฐ
14/15
post-thumbnail

๊ฐœ์š”

๐Ÿš€ Project Galaga ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

Unreal C++๊ณผ ๊ฒŒ์ž„์ˆ˜ํ•™์„ ์ ‘๋ชฉํ•ด์„œ ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ–ˆ์Šต๋‹ˆ๋‹ค.

2024.05.04 ~ 2024.05.21์˜ ๊ฐœ๋ฐœ ๊ธฐ๊ฐ„์œผ๋กœ, ์ด 17์ผ ๋™์•ˆ ๊ฐœ๋ฐœ์„ ์™„๋ฃŒํ•˜์˜€์Šต๋‹ˆ๋‹ค.

๊ฑฐ์ฐฝํ•˜๊ฒŒ ์‹œ์ž‘ํ•œ ํ”„๋กœ์ ํŠธ๋ณด๋‹จ ์ง€๊ธˆ๊นŒ์ง€ ๋ฐฐ์šด ๊ฒƒ๋“ค์„ ์ข…ํ•ฉ์ ์œผ๋กœ ์‚ฌ์šฉํ•ด์„œ ๊ฒฐ๊ณผ๋ฌผ์„ ๋งŒ๋“ค์–ด ๋‚ด๋ณด๊ฒ ๋‹ค๋Š” ๋งˆ์Œ์œผ๋กœ ์™„์„ฑํ•˜์˜€์Šต๋‹ˆ๋‹ค.

ํ•ด๋‹น ์‹œ๋ฆฌ์ฆˆ์—๋Š” ๊ฐœ๋ฐœ ์ผ์ง€๋ฅผ ์ •๋ฆฌํ•˜๋ฉฐ, ๊ฐœ๋ฐœ ๋‚ด์šฉ์— ๋Œ€ํ•œ ์„ค๋ช…๊ณผ ์ด์Šˆ๋ฅผ ์ •๋ฆฌํ•  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.

๐Ÿš€ Project Galaga Github Repository


๋ณธ๋ก 

๊ฒŒ์ž„์—๋Š” ์ง„ํ–‰์ƒํ™ฉ์„ ์ €์žฅํ•  ์ˆ˜ ์žˆ๋Š” ์„ธ์ด๋ธŒ ๊ธฐ๋Šฅ์ด ์žˆ์–ด์•ผ ๊ฒ ์ฃ .

์–ธ๋ฆฌ์–ผ์—์„œ๋Š” ๊ฒŒ์ž„์˜ ์„ธ์ด๋ธŒ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ด์ค๋‹ˆ๋‹ค.


Save Class

๊ฒŒ์ž„ ์ง„ํ–‰ ์ƒํ™ฉ, ์˜ต์…˜ ์„ค์ • ๋“ฑ ์ €์žฅ์ด ํ•„์š”ํ•œ ๋‚ด์šฉ๋“ค์— ๋Œ€ํ•ด์„œ C++๋กœ ํด๋ž˜์Šค๋ฅผ ์ƒ์„ฑํ•ด์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค.

UCLASS()
class GALAGA_API USaveStage : public USaveGame
{
	GENERATED_BODY()
	
public:
	USaveStage();

public:

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SaveData")
	int32 ClearStageIndex;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SaveData")
	TArray<float> SoundVolumns;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SaveData")
	float totalScore;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SaveData")
	int ScreenMode;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SaveData")
	int Resolution;

	//UPROPERTY()
	//FString PlayerName;

};

Save, Load ๊ตฌํ˜„

์†”๋กœ ํ”Œ๋ ˆ์ด ๊ฒŒ์ž„์ด๋ฏ€๋กœ SaveSlot์„ 'Player1'์œผ๋กœ ๊ณ ์ •ํ•˜์—ฌ ๊ฐœ๋ฐœ์„ ์ง„ํ–‰ํ–ˆ์Šต๋‹ˆ๋‹ค.

์ €์žฅํ•  ๋ฐ์ดํ„ฐ์— ๋Œ€ํ•œ ๋‚ด์šฉ์€ ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • ๊ฒŒ์ž„ ๋ฐ์ดํ„ฐ
  1. ํด๋ฆฌ์–ดํ•œ ์Šคํ…Œ์ด์ง€ ์ธ๋ฑ์Šค

  • ์˜ต์…˜ ๋ฐ์ดํ„ฐ
  1. ํ™”๋ฉด ๋ชจ๋“œ ์˜ต์…˜
  2. ํ•ด์ƒ๋„ ์˜ต์…˜
  3. ์‚ฌ์šด๋“œ ์˜ต์…˜

UI์™€ ์—ฐ๋™ํ•˜์—ฌ ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค.

๋ฐ์ดํ„ฐ ๋กœ๋“œ

Slot Name์ด Player1์ธ ์„ธ์ด๋ธŒ ๋ฐ์ดํ„ฐ๊ฐ€ ์žˆ๋‹ค๋ฉด ๋กœ๋“œํ•ด์ค๋‹ˆ๋‹ค.

ํ•ด๋‹น ๋ฐ์ดํ„ฐ๋ฅผ ์ €ํฌ๊ฐ€ ๋งŒ๋“  Save Class๋กœ Castํ•ด์ฃผ์–ด ๋ฐ์ดํ„ฐ๋ฅผ ํ• ๋‹นํ•ด์ค๋‹ˆ๋‹ค.

๋ฐ์ดํ„ฐ ์„ธ์ด๋ธŒ

Save Stage ํด๋ž˜์Šค๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ Create Save Game Object ๋…ธ๋“œ๋กœ ๋งŒ๋“ค์–ด ์ค๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ  ํ˜„์žฌ ์ƒํƒœ๊ฐ’๋“ค์„ ํ• ๋‹นํ•ด์ฃผ๊ณ  Player1์˜ Slot Name์œผ๋กœ ์ €์žฅํ•ด์ค๋‹ˆ๋‹ค.

์Šคํ…Œ์ด์ง€

๊ฒŒ์ž„์„ ์ข…๋ฃŒํ•˜์—ฌ๋„ ํด๋ฆฌ์–ดํ•œ ์Šคํ…Œ์ด์ง€๊นŒ์ง€๋งŒ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์Šคํ…Œ์ด์ง€ ์ธ๋ฑ์Šค๋ฅผ ๋ฐ›์•„์™€ ํด๋ฆฌ์–ดํ•œ ์Šคํ…Œ์ด์ง€๊นŒ์ง€๋งŒ ๋ฒ„ํŠผ์˜ Enabled์„ true๋กœ ์„ค์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

Startํ•ด๋ณด๋ฉด ์•„๋ž˜์ฒ˜๋Ÿผ 3์Šคํ…Œ์ด์ง€๊นŒ์ง€ ํด๋ฆฌ์–ด ์‹œ ๋„์ „์ด ๊ฐ€๋Šฅํ•œ 4์Šคํ…Œ์ด์ง€๊นŒ์ง€๋งŒ ์„ ํƒ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

์˜ต์…˜

์•ž์„œ ์„ค๋ช…๊ณผ ๊ฐ™์ด ํฌ๊ฒŒ 3๊ฐ€์ง€ ์˜ต์…˜์ด ์žˆ์Šต๋‹ˆ๋‹ค.

  1. ํ™”๋ฉด ๋ชจ๋“œ ์˜ต์…˜
  2. ํ•ด์ƒ๋„ ์˜ต์…˜
  3. ์‚ฌ์šด๋“œ ์˜ต์…˜

ํ™”๋ฉด ๋ชจ๋“œ ์˜ต์…˜

์ „์ฒดํ™”๋ฉด, ์ „์ฒดํ™”๋ฉด ์ฐฝ๋ชจ๋“œ, ์ฐฝ๋ชจ๋“œ 3๊ฐ€์ง€ ์˜ต์…˜์„ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Get Game User Settings - Set Fullscreen Mode์„ ์‚ฌ์šฉํ•˜์—ฌ ํ™”๋ฉด ๋ชจ๋“œ๋ฅผ ์กฐ์ ˆํ•˜์˜€์Šต๋‹ˆ๋‹ค.

ํ•ด์ƒ๋„ ์˜ต์…˜

์—ฌ๋Ÿฌ๊ฐ€์ง€ ํ•ด์ƒ๋„์— ๋Œ€ํ•ด์„œ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Get Game User Settings - Set Screen Resolution์„ ์‚ฌ์šฉํ•˜์—ฌ ํ•ด์ƒ๋„๋ฅผ ์กฐ์ ˆํ•˜์˜€์Šต๋‹ˆ๋‹ค.

์‚ฌ์šด๋“œ ์˜ต์…˜

๊ฐ ์š”์†Œ๋ณ„๋กœ ์‚ฌ์šด๋“œ๋ฅผ ๊ฐœ๋ณ„ ์กฐ์ ˆํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Sound Class Mix์™€ Sound Class๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์‚ฌ์šด๋“œ ์†Œ์Šค๋ฅผ ๊ตฌ๋ถ„ํ•ด์„œ ์กฐ์ ˆํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

Set Sound Mix Class Override ๋…ธ๋“œ์—์„œ SCM์™€ Sound Class๋ฅผ ์„ ํƒํ•ด์„œ Volume๊ฐ’์„ ์กฐ์ ˆํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜์˜€์Šต๋‹ˆ๋‹ค.


๋งˆ๋ฌด๋ฆฌ

์—ฌ๊ธฐ๊นŒ์ง€ ๋ฐ์ดํ„ฐ ์„ธ์ด๋ธŒ์— ๋Œ€ํ•ด์„œ ๊ตฌํ˜„ํ•˜๊ณ  ์œ„์ ฏ๊ณผ ์—ฐ๋™ํ•œ ๋‚ด์šฉ์„ ์ •๋ฆฌํ•˜์˜€์Šต๋‹ˆ๋‹ค.

profile
๊ฒŒ์ž„ ๊ฐœ๋ฐœ์ž๊ฐ€ ๋˜์–ด๋ณด์ž

0๊ฐœ์˜ ๋Œ“๊ธ€