Initial Agrarian Unreal project

This commit is contained in:
2026-05-11 00:26:02 -07:00
commit 15f5cfc0f8
863 changed files with 12516 additions and 0 deletions
@@ -0,0 +1,35 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "SideScrollingGameMode.h"
#include "Kismet/GameplayStatics.h"
#include "Blueprint/UserWidget.h"
#include "SideScrollingUI.h"
#include "SideScrollingPickup.h"
void ASideScrollingGameMode::BeginPlay()
{
Super::BeginPlay();
// create the game UI
APlayerController* OwningPlayer = UGameplayStatics::GetPlayerController(GetWorld(), 0);
UserInterface = CreateWidget<USideScrollingUI>(OwningPlayer, UserInterfaceClass);
check(UserInterface);
}
void ASideScrollingGameMode::ProcessPickup()
{
// increment the pickups counter
++PickupsCollected;
// if this is the first pickup we collect, show the UI
if (PickupsCollected == 1)
{
UserInterface->AddToViewport(0);
}
// update the pickups counter on the UI
UserInterface->UpdatePickups(PickupsCollected);
}