-
Notifications
You must be signed in to change notification settings - Fork 828
Description
Jobs
Team:
Mason-producer
Elias -co-producer
Vincent-head of departments
Noah- employee-audio dep
Ishaan-employee-story dep
J8889obs:
JavaScript- Elias
CSS- Chatgpt, Gemini, and my app (Elias)
HTML- Chatgpt, Gemini, and my app (Elias)
Graphic Design 2D and 3D- Mason, Vincent
Animation 3D specifically- Vincent
Game Designer: Vincent
Literally everything other than coding: Vincent (advertisement? Idk are we selling this)
Audio: Noah and Vincent
Story: Ishaan
NO MORE PEOPLE ADDED TO THE TEAM EXCEPT IF EVERYBODY AGREES 100%
https://codepen.io/masedogg55d/pen/RNRaExy
This is the link to our code game.
https://codepen.io/pen?welcome=true
Practice for code:
https://onecompiler.com/javascript/449waewda
Vincent's phone number: 914 314 0338
Vincent’s Email: vincent.hong943@gmail.com
Mason’s phone number: +1 (914) 588-5850
Masons email: masoniansartorius@gmail.com
Elias: 202 550 9309
Elias email: eliasessa651@gmail.com
Ishaan number 914 486 0309
Ishaan email achanta.ishaan@gmail.com
Link to project
https://playcanvas.com/editor/project/1449003
https://codepen.io/IlyasObid/pen/VYjaJEK
Brainstorming Tab
This game will be an action horror game.
Highlighted yellow means subject to change.
Highlighted red should be removed.
Story:
You wake up, barely conscious. A blackish monster charges into your room and eats your nurses and stuff. A worldwide blackout happens, and your hospital is one of the only buildings with power. However, each time you use something, for example, use a flashlight, cook food, etc, the lights get dimmer and darker. The parasite infects and feeds on the lower floors, but you live at the top. Each time you want to refill the generator on the first floor, you must go through all the dangerous floors to get there.
Actually im gonna work on each floor on Canva
https://studio.tripo3d.ai/workspace/generate/ff56934f-eca5-4d2f-84dc-a45d9dc42570
Also, I started the layout. Please check it out
- Floor 4
- Floor 3
- Floor 2
- Floor 1
- Basement
Intro.
You are riding your motorcycle on the street when all of the sudden a car comes speeding down the intersection hitting you from the side, you crash and start sliding down the street on the side of your motorcycle completely shredding the vehicle and almost you, your motorcycle starts to slow down and right before it stops you hit your head on a light post and black out. You wake up in a hospital where your friend says, “oh thank god you are awake!” You then hear screaming coming from the hall near your room and then see people start running from something, you don't know what it is yet, but you and your friend have a bad feeling about it. A rancid scent of death and something els, hits your nose. And then suddenly, through the corner of your eye you see some creature, all you know is that it looks like a human but wrong, no features, dark, tall, skinny, glowing red eyes. But it happened too quickly to fully look. At the same time you see the news on the TV and it shows a news reporter talking about a worldwide outbreak of unknown creatures that had started weeks ago, though it had only hit the United States this morning.
Ending.
You back up monsters completely surrounding you, they keep coming closer and closer, and you keep backing up. However there is a problem, you have a few feet before you get to the end of a cliff. But seeing the monsters still approaching you you keep backing up, now standing at the edge of the cliff, you are forced to make a decision. Either you get ripped apart by the monsters, or you jump off of the cliff. Quickly realizing that you die either way you decide to take the second option and jump off of the cliff. You look behind you at the monsters, with your back at the inevitable fall from the cliff. You stare at the monsters now only a few feet away, you think, think back to everything that has happened since that day you woke up, sadness and anger running in your thoughts and mind. You lean back, and fall. When in the air slowly approaching the ground below the cliff memories start rushing through your mind. One second you are falling the next second you remember the times where you were with your friend, then the next you are falling this time even closer to the ground then last time, then you see yourself with your family, fall, you playing as a kid, fall, your birthday, fall, one second a memory floods into your head, a happy one, then the next you are falling again. Now you are only 10 feet away from the ground. You see one last memory, it is the crash, confused about the fact how all the other memories were happy and now the one, the last one was not. You don't fall, you stay in the memory until everything goes dark, again. You wake up, heart pounding, breathing heavily, you are in the hospital bed, again. Shocked, you think that you survived, until you hear your friend say “thank god you are awake!” all of the sudden you remember what had happened that day, the day where this all started you were in the same hospital, same bed, same room, same friend. Then you start to think, you wonder how after all the time after all that had happened since that day. Then it comes to you. It's the same, same as last time. Was this all a dream? You think. The end- credits roll.
Code
Code is in C++
There will be different code parts for each chapter and subchapter to make it easier like a one step at a time thing.
Chat
red=vincent
black=elias
grey=mason
Blue=Noah
Green=Ishaan
Yo guys wassup (5:07am)
How are ya (3:05 pm)
Resources
CSS color:
https://www.w3.org/wiki/CSS/Properties/color/keywords\
gameplay chapters
CHAPTER 1 — Code Blue
Location: Hospital
Time: ~30 minutes
Purpose: Tutorial + atmosphere
Gameplay
- Wake up during the blackout -Checkpoint one.
- Meet your friend
- Learn:
- Movement, flashlight, batteries
- Inventory limits
- First generator:
- Powers one wing -Checkpoint Two.
- Requires a small fuel can
- Attracts monsters
- First pistol encounter
End Beat - Emergency generator fails
- Hospital overrun
- Escape into the city
CHAPTER 2 — Dead Streets
Location: City blocks
Time: ~45 minutes
Purpose: Exploration + player choice
Gameplay
- Semi-open streets -Checkpoint Three.
- Generators power:
- Streetlights
- Locked shops -Checkpoint Four.
- Fuel locations:
- Delivery trucks
- Maintenance sheds
- Monsters:
- Faster
- Hunt by sound
- Your friend:
- Calls out threats
- Helps distract enemies
End Beat
- Find radio signal mentioning a shelter
CHAPTER 3 — Last Reserves
Location: Gas station + surrounding buildings
Time: ~45 minutes
Purpose: Resource stress
Gameplay
- First major fuel run
- Heavily guarded gas station -Checkpoint Five.
- Choices:
- Power lights (safer, louder)
- Stay dark (harder navigation)
- Weapon upgrade found here
End Beat - Power restored to a safehouse -Checkpoint Six.
- Quiet character moment with your friend
CHAPTER 4 — Below the City
Location: Subway / service tunnels
Time: ~45 minutes
Purpose: Pure horror
Gameplay
- Almost total darkness
- Generators power:
- Tunnel lights -Checkpoint Eight.
- Flood pumps
- Fuel extremely scarce
- Monsters:
- Ambushers
- Light-sensitive stalkers
End Beat
- Your friend is badly injured saving you
- Movement slows
- Stakes rise
CHAPTER 5 — No Way Back
Location: Industrial zone
Time: ~30 minutes
Purpose: Escalation
Gameplay
- Learn bunker needs large generator power -Checkpoint Nine.
- Discover fuel depot nearby
- Depot is overrun
- Your friend volunteers to draw enemies away
- You retrieve fuel under pressure
End Beat - Reunion at bunker entrance -Checkpoint Ten.
- He’s clearly not going to make it
CHAPTER 6 — The Last Light
Location: Bunker exterior
Time: ~30 minutes
Purpose: Climax + sacrifice
Gameplay
- Start bunker generator -Checkpoint Eleven.
- Defend against waves
- Fuel drains fast
- Generator begins to fail
Sacrifice - Your friend:
- Forces the generator to stay on
- Locks you inside
- Holds off monsters alone
- You see/hear him through glass or radio
End Beat - Blast doors close
- Silence
CHAPTER 7 — Aftermath
Location: Bunker interior
Time: ~15 minutes
Purpose: Resolution
Gameplay
- Explore bunker -Checkpoint Twelve.
- Read logs about blackout
- Reflective, quiet tone
Endings Vary Based On - Fuel efficiency
- Optional areas completed
- Survivors helped
TOTAL PLAYTIME
Chapter
Time
1
30 min
2
45 min
3
45 min
4
45 min
5
30 min
6
30 min
7
15 min
TOTAL
~3.5 hours
________________
other details
Ending: after falling off of the cliff you wake up. Turns out it wasnt a loop or a dream. Rather it was a military experiment the whole time. Turns out that your
map design
/Hospital first floor.
Note: copy the same design but remove the front entrance for the other floors.
note.
For reference if needed later on. here are the room numbers. the top left is rooms A 1-5 the right one being A1 and the left on that part is A5, to the right of it it is rooms B 1-5 the left one being B1 right one being B5. then a weird jump goes to the bottom left one which is C 1-5 where C1 is on the right and C5 is on the left of that part, finally to the right of the C part is rooms D 1-5 where D1 is on the left and D5 is on the right of that part is that good for you guys
I will make a basement and parking garage. Oh and i will show where the generators will be
crafting items, location, and rarity
Items and rarity multiplier for each main location (group)
Item
Residential
Hospital
Garage/workshop
Military
Streets/
outdoors
Storage/
warehouse
Shops/
market
alchocol
1x
3x
1x
0.5x
1x
1x
2x
cloth
2x
2x
1x
1x
1x
1.5x
1x
sharps
0.5x
3x
0.5x
0.2x
0.1x
0.5x
0.2x
bindings
1x
0.5x
3x
1x
0.5x
2x
1x
canisters
0.5x
0.5x
2x
1x
0.5x
3x
1x
tools
1x
0.5x
3x
1x
0.5x
2x
1x
ammo
0.5x
0.5x
1x
3x
1x
1x
1x
gunpowder
0.2x
0.1x
1x
3x
0.2x
2x
0.5x
Scrap metal
1x
0.5x
2x
1x
1x
3x
0.5x
Upgrade materials
1x
0.5x
3x
1x
1x
2x
1x
crafting recipes
- Alchocol+Cloth=Molotov
- Binding+Cloth=Bandage
- Canister+Gunpowder+Sharps=Nail Bomb
- Canister+Bindings=Shiv
- Gunpowder+Alchocol=Incendiary Shells
- Canister+Gunpowder=Smoke Bomb
- Alchocol+Canister+Gunpowder=Pipe Bomb
- Binding+Sharps=Arrow
Checklist
THINGS THAT WE NEED TO DO FOR GAME “USE STRIKETHROUGH WHEN COMPLETED”
- Come up with jobs and roles for the project.
- Brainstorm ideas for games.
- Come up with chapter ideas and gameplay.
- Design a map.
- Create skins and looks for both characters and monsters.
- Plan animations.
- Create animations and cinematics.
- Code game.
Other things that will be needed to do;
- Fix any bugs or errors in code.
- After every main step and some other parts if needed, test run the game to make sure that everything is running and going smoothly.
- (IMPORTANT!) other notes.
The game will be made with Unreal Engine.
Unreal Engine uses C++ so if anyone knows how to use it that would be great. :)
Unreal Engine uses DirectX 12 for graphics.
Unreal Engine uses MetaSounds for audio.
These all should be downloadable with windows but there are other softwares for different devices for some of the things for the game.
monsters
Monsters Information
Link to document with monster information.
Monsters doc
etc.
chapters with labels.
1.0-CHAPTER 1 — Code Blue
Location: Hospital
Time: ~30 minutes
Purpose: Tutorial + atmosphere
Gameplay
- 1.1-Wake up during the blackout -Checkpoint one.
- 1.2-Meet your friend
- 1.3-Learn:
- 1.31-Movement, flashlight, batteries
- 1.32-Inventory limits
- 1.4-First generator:
- 1.41-Powers one wing -Checkpoint Two.
- 1.42-Requires a small fuel can
- 1.43-Attracts monsters
- 1.5-First pistol encounter
End Beat - 1.6-Emergency generator fails
- 1.7-Hospital overrun
- 1.8-Escape into the city
2.0-CHAPTER 2 — Dead Streets
Location: City blocks
Time: ~45 minutes
Purpose: Exploration + player choice
Gameplay
- 2.1-Semi-open streets -Checkpoint Three.
- 2.2-Generators power:
- 2.21-Streetlights
- 2.22-Locked shops -Checkpoint Four.
- 2.3-Fuel locations:
- 2.31-Delivery trucks
- 2.32-Maintenance sheds
- 2.4-Monsters:
- 2.41-Faster
- 2.42-Hunt by sound
- 2.5-Your friend:
- 2.51-Calls out threats
- 2.52-Helps distract enemies
End Beat
- 2.6-Find radio signal mentioning a shelter
3.0-CHAPTER 3 — Last Reserves
Location: Gas station + surrounding buildings
Time: ~45 minutes
Purpose: Resource stress
Gameplay
- 3.1-First major fuel run
- 3.2-Heavily guarded gas station -Checkpoint Five.
- 3.3-Choices:
- 3.31-Power lights (safer, louder)
- 3.32-Stay dark (harder navigation)
- 3.4-Weapon upgrade found here
End Beat - 3.5-Power restored to a safehouse -Checkpoint Six.
- 3.6-Quiet character moment with your friend
4.0-CHAPTER 4 — Below the City
Location: Subway / service tunnels
Time: ~45 minutes
Purpose: Pure horror
Gameplay
- 4.1-Almost total darkness
- 4.2-Generators power:
- 4.21-Tunnel lights -Checkpoint Eight.
- 4.22-Flood pumps
- 4.3-Fuel extremely scarce
- 4.4-Monsters:
- 4.41-Ambushers
- 4.42-Light-sensitive stalkers
End Beat
- 4.5-Your friend is badly injured saving you
- 4.6-Movement slows
- 4.7-Stakes rise
5.0-CHAPTER 5 — No Way Back
Location: Industrial zone
Time: ~30 minutes
Purpose: Escalation
Gameplay
- 5.1-Learn bunker needs large generator power -Checkpoint Nine.
- 5.2-Discover fuel depot nearby
- 5.3-Depot is overrun
- 5.4-Your friend volunteers to draw enemies away
- 5.5-You retrieve fuel under pressure
End Beat - 5.6-Reunion at bunker entrance -Checkpoint Ten.
- 5.7-He’s clearly not going to make it
6.0-CHAPTER 6 — The Last Light
Location: Bunker exterior
Time: ~30 minutes
Purpose: Climax + sacrifice
Gameplay
- 6.1-Start bunker generator -Checkpoint Eleven.
- 6.2-Defend against waves
- 6.3-Fuel drains fast
- 6.4-Generator begins to fail
Sacrifice - 6.5-Your friend:
- 6.51-Forces the generator to stay on
- 6.52-Locks you inside
- 6.53-Holds off monsters alone
- 6.6-You see/hear him through glass or radio
End Beat - 6.7-Blast doors close
- 6.8-Silence
7.0-CHAPTER 7 — Aftermath
Location: Bunker interior
Time: ~15 minutes
Purpose: Resolution
Gameplay
- 7.1-Explore bunker -Checkpoint Twelve.
- 7.2-Read logs about blackout
- 7.3-Reflective, quiet tone
Endings Vary Based On - 7.4-Fuel efficiency
- 7.5-Optional areas completed
- 7.6-Survivors helped
TOTAL PLAYTIME
Chapter
Time
1
30 min
2
45 min
3
45 min
4
45 min
5
30 min
6
30 min
7
15 min
TOTAL
~3.5 hours
________________
where to insert code +rules
Code will go into here it would be great to take the code for each part and put it in its own separate doc or maybe to the tenths place one would have any hundreds place one like for example 8.4 would also have 8.41, 8.42, 8.43, 8.44 if you understand you can take that link and put it in column B in the row that goes with what the code is for here is the link to the excel-
link
code document example
8.93 (title size)
Insert code here→
In Progress.
Work In Progress
- Transitions between chapters.
- Tab 19
Code
Html:
Typewriter effect example.
Css
.typewriter p {
font-family: monospace;
overflow: hidden; /* Hides text not yet typed /
border-right: .15em solid orange; / The blinking cursor /
white-space: nowrap; / Keeps text on one line /
margin: 0 auto;
letter-spacing: .15em;
/ Adjust animation speed and steps based on letter count */
animation:
typing 3.5s steps(30, end),
blink-caret .5s step-end infinite;
}
/* Keyframes for typing effect */
@Keyframes typing {
from { width: 0 }
to { width: 100% }
}
/* Keyframes for blinking cursor */
@Keyframes blink-caret {
from, to { border-color: transparent }
50% { border-color: orange }
}
Js
var i = 0;
var txt = 'Text appears one letter at a time.';
var speed = 50; // Milliseconds between letters
function typeWriter() {
if (i < txt.length) {
document.getElementById("demo").innerHTML += txt.charAt(i);
i++;
setTimeout(typeWriter, speed);
}
}
// Call the function on page load
window.onload = typeWriter;
Tab 20
import sys
import time
def delay_print(s):
for c in s:
sys.stdout.write(c)
sys.stdout.flush()
time.sleep(0.05) # Adjust the sleep time for faster/slower typing
print() # Add a final newline character after the text is done
Example usage:
delay_print("Hello world! This text is appearing one letter at a time.")
#include
#include
#include // For std::chrono::milliseconds
#include // For std::this_thread::sleep_for
void print_one_at_a_time(const std::string& text, unsigned int delay_ms) {
for (char c : text) {
std::cout << c << std::flush; // Print the character and flush the output buffer
std::this_thread::sleep_for(std::chrono::milliseconds(delay_ms)); // Pause
}
}
int main() {
std::string message = "Hello, world! This text is displaying one letter at a time.";
unsigned int delay = 50; // Delay in milliseconds
print_one_at_a_time(message, delay);
std::cout << std::endl; // Newline at the end
return 0;
}
Tab 21
#include
#include
#include
#include
#include // Required for rand() and srand()
#include // Required for time()
// Function to print text one character at a time with a fixed delay
void print_slowly_fixed(const std::string& message, int delay_ms) {
for (char ch : message) {
std::cout << ch << std::flush; // Print the character and flush the buffer
std::this_thread::sleep_for(std::chrono::milliseconds(delay_ms)); // Pause
}
std::cout << std::endl; // Move to the next line after the message is complete
}
// Function to print text one character at a time with a random/variable delay
void print_slowly_variable(const std::string& message, int min_delay_ms, int max_delay_ms) {
// Seed the random number generator (only needs to be done once per program execution)
// std::srand(std::time(0));
for (char ch : message) {
std::cout << ch << std::flush; // Print the character and flush the buffer
// Generate a random delay between min_delay and max_delay
int variable_delay = min_delay_ms + (std::rand() % (max_delay_ms - min_delay_ms + 1));
std::this_thread::sleep_for(std::chrono::milliseconds(variable_delay)); // Pause
}
std::cout << std::endl; // Move to the next line
}
int main() {
// Optional: Seed the random number generator
std::srand(static_cast(std::time(0)));
// Example 1: Fixed typing speed (e.g., 50 milliseconds per character)
print_slowly_fixed("This message prints at a constant speed.", 50);
// Example 2: Variable typing speed (e.g., between 30ms and 150ms per character)
print_slowly_variable("This message prints with a variable typing speed, for a more 'human' effect.", 30, 150);
// Example 3: Changing speed mid-message (manual control)
for (char ch : "You can also change speed manually... ") {
std::cout << ch << std::flush;
std::this_thread::sleep_for(std::chrono::milliseconds(40)); // Fast start
}
for (char ch : "then slow down.") {
std::cout << ch << std::flush;
std::this_thread::sleep_for(std::chrono::milliseconds(200)); // Slow finish
}
std::cout << std::endl;
return 0;
}
Tab 22
hi i am working on a video game and i need to start coding the controls for the game the code language required for the game creation software is C++ here are the keys and functions of each one W-move forward, A-move left, S-move backward, D-move right, LShift-crouch, Lctrl-sprint, space-jump, tab-would go to a different thing of code so just make it so i can add that too, F-flashlight, J-would go to a different thing of code so just make it so i can add that too, R-reload would go to a different thing of code so just make it so i can add that too, Left click-Shoot/fire, right click, aim(use scope iron sight etc, and E to interact or pick up items
Tab 23
Hell yeah — Unreal it is 🎮
I’ll assume Unreal Engine 5 (C++) using Enhanced Input (the modern, recommended system). If you’re on UE4 or legacy input, say the word and I’ll switch it.
Below is a clean, production-ready setup with placeholders exactly where you asked.
1️⃣ Create Input Actions (Editor steps)
In Content Browser → Input folder, create these Input Actions:
Input Action Name
Type
IA_Move
Axis2D
IA_Look
Axis2D
IA_Jump
Digital
IA_Crouch
Digital
IA_Sprint
Digital
IA_Interact
Digital
IA_Flashlight
Digital
IA_Fire
Digital
IA_Aim
Digital
IA_Tab
Digital (placeholder)
IA_J
Digital (placeholder)
IA_Reload
Digital (placeholder)
________________
2️⃣ Create Input Mapping Context
Create IMC_Player and bind keys:
Movement
- IA_Move
- W → (0, +1)
- S → (0, -1)
- A → (-1, 0)
- D → (+1, 0)
Actions
- Space → IA_Jump
- Left Shift → IA_Crouch
- Left Ctrl → IA_Sprint
- E → IA_Interact
- F → IA_Flashlight
- Tab → IA_Tab
- J → IA_J
- R → IA_Reload
Mouse - Left Mouse → IA_Fire
- Right Mouse → IA_Aim
3️⃣ Character Header (.h)
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "InputActionValue.h"
#include "MyPlayerCharacter.generated.h"
UCLASS()
class YOURGAME_API AMyPlayerCharacter : public ACharacter
{
GENERATED_BODY()
public:
AMyPlayerCharacter();
protected:
virtual void BeginPlay() override;
virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
// --- Input Actions ---
UPROPERTY(EditDefaultsOnly, Category = "Input")
class UInputMappingContext* PlayerMappingContext;
UPROPERTY(EditDefaultsOnly, Category = "Input")
class UInputAction* IA_Move;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Jump;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Crouch;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Sprint;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Interact;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Flashlight;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Fire;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Aim;
// Placeholders
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Tab;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_J;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Reload;
// --- Functions ---
void Move(const FInputActionValue& Value);
void StartCrouch();
void StopCrouch();
void StartSprint();
void StopSprint();
void Interact();
void ToggleFlashlight();
void Fire();
void AimStart();
void AimStop();
// Placeholders
void OpenTabMenu();
void SpecialActionJ();
void ReloadWeapon();
};
4️⃣ Character CPP (.cpp)
#include "MyPlayerCharacter.h"
#include "EnhancedInputComponent.h"
#include "EnhancedInputSubsystems.h"
AMyPlayerCharacter::AMyPlayerCharacter()
{
PrimaryActorTick.bCanEverTick = true;
}
void AMyPlayerCharacter::BeginPlay()
{
Super::BeginPlay();
if (APlayerController* PC = Cast<APlayerController>(Controller))
{
if (UEnhancedInputLocalPlayerSubsystem* Subsystem =
ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PC->GetLocalPlayer()))
{
Subsystem->AddMappingContext(PlayerMappingContext, 0);
}
}
}
void AMyPlayerCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
UEnhancedInputComponent* Input = CastChecked(PlayerInputComponent);
Input->BindAction(IA_Move, ETriggerEvent::Triggered, this, &AMyPlayerCharacter::Move);
Input->BindAction(IA_Jump, ETriggerEvent::Started, this, &ACharacter::Jump);
Input->BindAction(IA_Crouch, ETriggerEvent::Started, this, &AMyPlayerCharacter::StartCrouch);
Input->BindAction(IA_Crouch, ETriggerEvent::Completed, this, &AMyPlayerCharacter::StopCrouch);
Input->BindAction(IA_Sprint, ETriggerEvent::Started, this, &AMyPlayerCharacter::StartSprint);
Input->BindAction(IA_Sprint, ETriggerEvent::Completed, this, &AMyPlayerCharacter::StopSprint);
Input->BindAction(IA_Interact, ETriggerEvent::Started, this, &AMyPlayerCharacter::Interact);
Input->BindAction(IA_Flashlight, ETriggerEvent::Started, this, &AMyPlayerCharacter::ToggleFlashlight);
Input->BindAction(IA_Fire, ETriggerEvent::Triggered, this, &AMyPlayerCharacter::Fire);
Input->BindAction(IA_Aim, ETriggerEvent::Started, this, &AMyPlayerCharacter::AimStart);
Input->BindAction(IA_Aim, ETriggerEvent::Completed, this, &AMyPlayerCharacter::AimStop);
// Placeholders
Input->BindAction(IA_Tab, ETriggerEvent::Started, this, &AMyPlayerCharacter::OpenTabMenu);
Input->BindAction(IA_J, ETriggerEvent::Started, this, &AMyPlayerCharacter::SpecialActionJ);
Input->BindAction(IA_Reload, ETriggerEvent::Started, this, &AMyPlayerCharacter::ReloadWeapon);
}
void AMyPlayerCharacter::Move(const FInputActionValue& Value)
{
FVector2D Movement = Value.Get();
AddMovementInput(GetActorForwardVector(), Movement.Y);
AddMovementInput(GetActorRightVector(), Movement.X);
}
// --- Actions ---
void AMyPlayerCharacter::StartCrouch() { Crouch(); }
void AMyPlayerCharacter::StopCrouch() { UnCrouch(); }
void AMyPlayerCharacter::StartSprint() { GetCharacterMovement()->MaxWalkSpeed = 800.f; }
void AMyPlayerCharacter::StopSprint() { GetCharacterMovement()->MaxWalkSpeed = 600.f; }
void AMyPlayerCharacter::Interact() {}
void AMyPlayerCharacter::ToggleFlashlight() {}
void AMyPlayerCharacter::Fire() {}
void AMyPlayerCharacter::AimStart() {}
void AMyPlayerCharacter::AimStop() {}
// --- Placeholders ---
void AMyPlayerCharacter::OpenTabMenu() {}
void AMyPlayerCharacter::SpecialActionJ() {}
void AMyPlayerCharacter::ReloadWeapon() {}
5️⃣ What You Can Easily Add Next
- 🔦 Flashlight component toggle
- 🔫 Ammo + reload logic
- 🧠 Interaction line trace
- 🏃 Sprint stamina
- 🔍 ADS FOV zoom
If you want, tell me: - UE version (5.0–5.3?)
- First-person or third-person
- Singleplayer or multiplayer
…and I’ll wire the next system cleanly into this setup.
Tab 24
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "InputActionValue.h"
#include "MyPlayerCharacter.generated.h"
UCLASS()
class YOURGAME_API AMyPlayerCharacter : public ACharacter
{
GENERATED_BODY()
public:
AMyPlayerCharacter();
protected:
virtual void BeginPlay() override;
virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
// --- Input Actions ---
UPROPERTY(EditDefaultsOnly, Category = "Input")
class UInputMappingContext* PlayerMappingContext;
UPROPERTY(EditDefaultsOnly, Category = "Input")
class UInputAction* IA_Move;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Jump;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Crouch;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Sprint;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Interact;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Flashlight;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Fire;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Aim;
// Placeholders
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Tab;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_J;
UPROPERTY(EditDefaultsOnly, Category = "Input")
UInputAction* IA_Reload;
// --- Functions ---
void Move(const FInputActionValue& Value);
void StartCrouch();
void StopCrouch();
void StartSprint();
void StopSprint();
void Interact();
void ToggleFlashlight();
void Fire();
void AimStart();
void AimStop();
// Placeholders
void OpenTabMenu();
void SpecialActionJ();
void ReloadWeapon();
};
Tab 25
#include "MyPlayerCharacter.h"
#include "EnhancedInputComponent.h"
#include "EnhancedInputSubsystems.h"
AMyPlayerCharacter::AMyPlayerCharacter()
{
PrimaryActorTick.bCanEverTick = true;
}
void AMyPlayerCharacter::BeginPlay()
{
Super::BeginPlay();
if (APlayerController* PC = Cast<APlayerController>(Controller))
{
if (UEnhancedInputLocalPlayerSubsystem* Subsystem =
ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PC->GetLocalPlayer()))
{
Subsystem->AddMappingContext(PlayerMappingContext, 0);
}
}
}
void AMyPlayerCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
UEnhancedInputComponent* Input = CastChecked(PlayerInputComponent);
Input->BindAction(IA_Move, ETriggerEvent::Triggered, this, &AMyPlayerCharacter::Move);
Input->BindAction(IA_Jump, ETriggerEvent::Started, this, &ACharacter::Jump);
Input->BindAction(IA_Crouch, ETriggerEvent::Started, this, &AMyPlayerCharacter::StartCrouch);
Input->BindAction(IA_Crouch, ETriggerEvent::Completed, this, &AMyPlayerCharacter::StopCrouch);
Input->BindAction(IA_Sprint, ETriggerEvent::Started, this, &AMyPlayerCharacter::StartSprint);
Input->BindAction(IA_Sprint, ETriggerEvent::Completed, this, &AMyPlayerCharacter::StopSprint);
Input->BindAction(IA_Interact, ETriggerEvent::Started, this, &AMyPlayerCharacter::Interact);
Input->BindAction(IA_Flashlight, ETriggerEvent::Started, this, &AMyPlayerCharacter::ToggleFlashlight);
Input->BindAction(IA_Fire, ETriggerEvent::Triggered, this, &AMyPlayerCharacter::Fire);
Input->BindAction(IA_Aim, ETriggerEvent::Started, this, &AMyPlayerCharacter::AimStart);
Input->BindAction(IA_Aim, ETriggerEvent::Completed, this, &AMyPlayerCharacter::AimStop);
// Placeholders
Input->BindAction(IA_Tab, ETriggerEvent::Started, this, &AMyPlayerCharacter::OpenTabMenu);
Input->BindAction(IA_J, ETriggerEvent::Started, this, &AMyPlayerCharacter::SpecialActionJ);
Input->BindAction(IA_Reload, ETriggerEvent::Started, this, &AMyPlayerCharacter::ReloadWeapon);
}
void AMyPlayerCharacter::Move(const FInputActionValue& Value)
{
FVector2D Movement = Value.Get();
AddMovementInput(GetActorForwardVector(), Movement.Y);
AddMovementInput(GetActorRightVector(), Movement.X);
}
// --- Actions ---
void AMyPlayerCharacter::StartCrouch() { Crouch(); }
void AMyPlayerCharacter::StopCrouch() { UnCrouch(); }
void AMyPlayerCharacter::StartSprint() { GetCharacterMovement()->MaxWalkSpeed = 800.f; }
void AMyPlayerCharacter::StopSprint() { GetCharacterMovement()->MaxWalkSpeed = 600.f; }
void AMyPlayerCharacter::Interact() {}
void AMyPlayerCharacter::ToggleFlashlight() {}
void AMyPlayerCharacter::Fire() {}
void AMyPlayerCharacter::AimStart() {}
void AMyPlayerCharacter::AimStop() {}
// --- Placeholders ---
void AMyPlayerCharacter::OpenTabMenu() {}
void AMyPlayerCharacter::SpecialActionJ() {}
void AMyPlayerCharacter::ReloadWeapon() {}
Tab 26