{"id":1425,"date":"2024-01-13T14:57:13","date_gmt":"2024-01-13T14:57:13","guid":{"rendered":"https:\/\/rubennotario.es\/?page_id=1425"},"modified":"2025-10-02T19:13:14","modified_gmt":"2025-10-02T19:13:14","slug":"simple-shoter-c","status":"publish","type":"page","link":"https:\/\/rubennotario.es\/?page_id=1425","title":{"rendered":"Simple Shoter C++"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"1425\" class=\"elementor elementor-1425\" data-elementor-post-type=\"page\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-99b6739 elementor-section-height-min-height elementor-section-boxed elementor-section-height-default elementor-section-items-middle\" data-id=\"99b6739\" data-element_type=\"section\" data-e-type=\"section\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-wide\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-6b31ab2\" data-id=\"6b31ab2\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8fc517b elementor-widget elementor-widget-heading\" data-id=\"8fc517b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Mission Escape<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e093b2a elementor-widget elementor-widget-heading\" data-id=\"e093b2a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h5 class=\"elementor-heading-title elementor-size-default\">Summer 2023<\/h5>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6d1a2e0 elementor-widget elementor-widget-text-editor\" data-id=\"6d1a2e0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>This is my second game programmed with with C++. Consists of eliminating all the enemies without being eliminated.<\/p><p>This project started following an\u00a0<a style=\"background-color: #0c0c0c;\" href=\"https:\/\/www.udemy.com\/course\/unrealcourse\/?couponCode=LETSLEARNNOWPP\">udemy course<\/a>\u00a0made by\u00a0<a style=\"background-color: #0c0c0c;\" href=\"https:\/\/www.udemy.com\/user\/gamedevtv\/\">GameDev.tv Team<\/a>\u00a0and\u00a0<a style=\"background-color: #0c0c0c;\" href=\"https:\/\/www.udemy.com\/user\/bentristem\/\">Ben Tristem<\/a>. (One of the best selling courses about c++ for Unreal Engine).<span style=\"font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); font-size: 1rem;\"><br \/><\/span><\/p><p>Still being a simple project, but was useful to go a bit further and program more complex mechanics.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-a39dcf9\" data-id=\"a39dcf9\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-6890530 elementor-widget elementor-widget-eael-feature-list\" data-id=\"6890530\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"eael-feature-list.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"-icon-position-left -tablet-icon-position-left -mobile-icon-position-left\">\n\t\t\t<ul id=\"eael-feature-list-6890530\" class=\"eael-feature-list-items rhombus stacked connector-type-classic eael-feature-list-vertical\" data-layout-tablet=\"vertical\" data-layout-mobile=\"vertical\">\n\t\t\t                <li class=\"eael-feature-list-item elementor-repeater-item-71b0dd0\">\n                                            <span class=\"connector\" style=\"right: calc(100% - 50px); left: 0;\"><\/span>\n                        <span class=\"connector connector-tablet\" style=\"right: calc(100% - 50px); left: 0;\"><\/span>\n                        <span class=\"connector connector-mobile\" style=\"right: calc(100% - 50px); left: 0;\"><\/span>\n                    \n\t\t\t\t\t\t<div class=\"eael-feature-list-icon-box\">\n\t\t\t\t\t\t\t<div class=\"eael-feature-list-icon-inner\">\n\n\t\t\t\t\t\t\t\t<span class=\"eael-feature-list-icon fl-icon-0\">\n\n\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"eael-feature-list-content-box\">\n                            <h2 class=\"eael-feature-list-title\">Engine<\/h2>\t\t\t\t\t\t<p class=\"eael-feature-list-content\">Unreal 5.2<\/p>\n\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/li>\n\t\t\t\t                <li class=\"eael-feature-list-item elementor-repeater-item-926b957\">\n                                            <span class=\"connector\" style=\"right: calc(100% - 50px); left: 0;\"><\/span>\n                        <span class=\"connector connector-tablet\" style=\"right: calc(100% - 50px); left: 0;\"><\/span>\n                        <span class=\"connector connector-mobile\" style=\"right: calc(100% - 50px); left: 0;\"><\/span>\n                    \n\t\t\t\t\t\t<div class=\"eael-feature-list-icon-box\">\n\t\t\t\t\t\t\t<div class=\"eael-feature-list-icon-inner\">\n\n\t\t\t\t\t\t\t\t<span class=\"eael-feature-list-icon fl-icon-1\">\n\n\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"eael-feature-list-content-box\">\n                            <h2 class=\"eael-feature-list-title\">Team Size<\/h2>\t\t\t\t\t\t<p class=\"eael-feature-list-content\">1<\/p>\n\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/li>\n\t\t\t\t                <li class=\"eael-feature-list-item elementor-repeater-item-ac98475\">\n                                            <span class=\"connector\" style=\"right: calc(100% - 50px); left: 0;\"><\/span>\n                        <span class=\"connector connector-tablet\" style=\"right: calc(100% - 50px); left: 0;\"><\/span>\n                        <span class=\"connector connector-mobile\" style=\"right: calc(100% - 50px); left: 0;\"><\/span>\n                    \n\t\t\t\t\t\t<div class=\"eael-feature-list-icon-box\">\n\t\t\t\t\t\t\t<div class=\"eael-feature-list-icon-inner\">\n\n\t\t\t\t\t\t\t\t<span class=\"eael-feature-list-icon fl-icon-2\">\n\n\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"eael-feature-list-content-box\">\n                            <h2 class=\"eael-feature-list-title\">Project Duration<\/h2>\t\t\t\t\t\t<p class=\"eael-feature-list-content\">2 weeks<\/p>\n\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/li>\n\t\t\t\t                <li class=\"eael-feature-list-item elementor-repeater-item-84835b9\">\n                                            <span class=\"connector\" style=\"right: calc(100% - 50px); left: 0;\"><\/span>\n                        <span class=\"connector connector-tablet\" style=\"right: calc(100% - 50px); left: 0;\"><\/span>\n                        <span class=\"connector connector-mobile\" style=\"right: calc(100% - 50px); left: 0;\"><\/span>\n                    \n\t\t\t\t\t\t<div class=\"eael-feature-list-icon-box\">\n\t\t\t\t\t\t\t<div class=\"eael-feature-list-icon-inner\">\n\n\t\t\t\t\t\t\t\t<span class=\"eael-feature-list-icon fl-icon-3\">\n\n\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"eael-feature-list-content-box\">\n                            <h2 class=\"eael-feature-list-title\">Main Roles<\/h2>\t\t\t\t\t\t<p class=\"eael-feature-list-content\">Programmer<\/p>\n\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/li>\n\t\t\t\t                <li class=\"eael-feature-list-item elementor-repeater-item-2694cad\">\n                                            <span class=\"connector\" style=\"right: calc(100% - 50px); left: 0;\"><\/span>\n                        <span class=\"connector connector-tablet\" style=\"right: calc(100% - 50px); left: 0;\"><\/span>\n                        <span class=\"connector connector-mobile\" style=\"right: calc(100% - 50px); left: 0;\"><\/span>\n                    \n\t\t\t\t\t\t<div class=\"eael-feature-list-icon-box\">\n\t\t\t\t\t\t\t<div class=\"eael-feature-list-icon-inner\">\n\n\t\t\t\t\t\t\t\t<span class=\"eael-feature-list-icon fl-icon-4\">\n\n\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"eael-feature-list-content-box\">\n                            <h2 class=\"eael-feature-list-title\">Platforms<\/h2>\t\t\t\t\t\t<p class=\"eael-feature-list-content\">PC<\/p>\n\t\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t<\/ul>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-1edfc9d elementor-section-height-min-height elementor-section-boxed elementor-section-height-default elementor-section-items-middle\" data-id=\"1edfc9d\" data-element_type=\"section\" data-e-type=\"section\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-e2a6a0d\" data-id=\"e2a6a0d\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-6dd6d9d elementor-widget elementor-widget-heading\" data-id=\"6dd6d9d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Gameplay<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8c1e148 elementor-widget elementor-widget-video\" data-id=\"8c1e148\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;youtube_url&quot;:&quot;https:\\\/\\\/youtu.be\\\/iOv0cTIYyww&quot;,&quot;autoplay&quot;:&quot;yes&quot;,&quot;play_on_mobile&quot;:&quot;yes&quot;,&quot;loop&quot;:&quot;yes&quot;,&quot;video_type&quot;:&quot;youtube&quot;,&quot;controls&quot;:&quot;yes&quot;}\" data-widget_type=\"video.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-wrapper elementor-open-inline\">\n\t\t\t<div class=\"elementor-video\"><\/div>\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-10a925e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"10a925e\" data-element_type=\"section\" data-e-type=\"section\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-491f901\" data-id=\"491f901\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-bc425f1 elementor-widget elementor-widget-spacer\" data-id=\"bc425f1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8e5df7a elementor-widget elementor-widget-heading\" data-id=\"8e5df7a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Code<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-dcd6efc elementor-widget elementor-widget-eael-adv-accordion\" data-id=\"dcd6efc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"eael-adv-accordion.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t            <div class=\"eael-adv-accordion\" id=\"eael-adv-accordion-dcd6efc\" data-scroll-on-click=\"no\" data-scroll-speed=\"300\" data-accordion-id=\"dcd6efc\" data-accordion-type=\"accordion\" data-toogle-speed=\"300\">\n            <div class=\"eael-accordion-list\">\n\t\t\t\t\t<div id=\"shootercharacter\" class=\"elementor-tab-title eael-accordion-header\" tabindex=\"0\" data-tab=\"1\" aria-controls=\"elementor-tab-content-2311\"><span class=\"eael-advanced-accordion-icon-closed\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-advanced-accordion-icon-opened\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-accordion-tab-title\">ShooterCharacter<\/span><i aria-hidden=\"true\" class=\"fa-toggle fas fa-angle-right\"><\/i><\/div><div id=\"elementor-tab-content-2311\" class=\"eael-accordion-content clearfix\" data-tab=\"1\" aria-labelledby=\"shootercharacter\"><style><\/style>\t\t<div data-elementor-type=\"section\" data-elementor-id=\"1444\" class=\"elementor elementor-1444\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-32ba402 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"32ba402\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8953942\" data-id=\"8953942\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-934faba elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"934faba\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n#pragma once\r\n\r\n#include &quot;CoreMinimal.h&quot;\r\n#include &quot;GameFramework\/Character.h&quot;\r\n#include &quot;InputActionValue.h&quot;\r\n#include &quot;ShooterCharacter.generated.h&quot;\r\n\r\nclass UInputMappingContext;\r\nclass UInputAction;\r\nclass AGun;\r\n\r\nUCLASS()\r\nclass SIMPLESHOOTER_API AShooterCharacter : public ACharacter\r\n{\r\n\tGENERATED_BODY()\r\n\r\npublic:\r\n\t\r\n\tAShooterCharacter();\r\n\r\nprotected:\r\n\t\r\n\tvirtual void BeginPlay() override;\r\n\r\n\tUPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)\r\n\tUInputMappingContext* ShooterMappingContext;\r\n\r\n\tUPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)\r\n\tUInputAction* MoveAction;\r\n\r\n\tUPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)\r\n\tUInputAction* LookAction;\r\n\r\n\tUPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)\r\n\tUInputAction* JumpAction;\r\n\r\n\tUPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)\r\n\tUInputAction* ShootAction;\r\n\r\n\tUPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)\r\n\tUInputAction* CrouchAction;\r\n\r\n\tUPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input)\r\n\tUInputAction* RunAction;\r\n\r\npublic:\t\r\n\r\n\tUFUNCTION(BlueprintPure)\r\n\tbool IsDead() const;\r\n\r\n\tUFUNCTION(BlueprintPure)\r\n\tfloat GetHealthPercent() const;\r\n\t\r\n\tvirtual void Tick(float DeltaTime) override;\r\n\r\n\tvirtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;\r\n\r\n\tvirtual float TakeDamage(float DamageAmount, struct FDamageEvent const&amp; DamageEvent, class AController* EventInstigator, AActor* DamageCauser) override;\r\n\r\n\tvoid ShootBullet();\r\n\r\nprivate:\r\n\tvoid Shoot(const FInputActionValue&amp; Value);\r\n\tvoid Move(const FInputActionValue&amp; Value);\r\n\tvoid Look(const FInputActionValue&amp; Value);\r\n\tvoid Crouch(const FInputActionValue&amp; Value);\r\n\tvoid Uncrouch(const FInputActionValue&amp; Value);\r\n\r\n\tUPROPERTY(EditAnywhere)\r\n\tfloat MaxHealth = 100;\r\n\r\n\tUPROPERTY(VisibleAnywhere)\r\n\tfloat Health;\r\n\r\n\tUPROPERTY(EditDefaultsOnly)\r\n\tTSubclassOf&lt;AGun&gt; WeaponClass;\r\n\r\n\tUPROPERTY()\r\n\tAGun* Weapon;\r\n\r\n\tUCharacterMovementComponent* MovementComponent = this-&gt;GetCharacterMovement();;\r\n};\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-220e44d elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"220e44d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>#include &quot;Characters\/ShooterCharacter.h&quot;\r\n#include &quot;EnhancedInputSubsystems.h&quot;\r\n#include &quot;EnhancedInputComponent.h&quot;\r\n#include &quot;Weapons\/Gun.h&quot;\r\n#include &quot;Components\/CapsuleComponent.h&quot;\r\n#include &quot;GameFramework\/CharacterMovementComponent.h&quot;\r\n#include &quot;SimpleShooter\/SimpleShooterGameModeBase.h&quot;\r\n\r\n\/\/ Sets default values\r\nAShooterCharacter::AShooterCharacter()\r\n{\r\n \t\/\/ Set this character to call Tick() every frame.  You can turn this off to improve performance if you don&#039;t need it.\r\n\tPrimaryActorTick.bCanEverTick = true;\r\n\r\n}\r\n\r\n\/\/ Called when the game starts or when spawned\r\nvoid AShooterCharacter::BeginPlay()\r\n{\r\n\tSuper::BeginPlay();\r\n\t\r\n\tAPlayerController* PlayerController = Cast&lt;APlayerController&gt;(GetController());\r\n\tif (PlayerController)\r\n\t{\r\n\t\tUEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem&lt;UEnhancedInputLocalPlayerSubsystem&gt;(PlayerController-&gt;GetLocalPlayer());\r\n\t\tif (Subsystem)\r\n\t\t{\r\n\t\t\tSubsystem-&gt;AddMappingContext(ShooterMappingContext, 0);\r\n\t\t}\r\n\t}\r\n\r\n\tHealth = MaxHealth;\r\n\r\n\tWeapon = GetWorld()-&gt;SpawnActor&lt;AGun&gt;(WeaponClass);\r\n\r\n\tGetMesh()-&gt;HideBoneByName(TEXT(&quot;weapon_r&quot;), EPhysBodyOp::PBO_None);\r\n\r\n\tWeapon-&gt;AttachToComponent(GetMesh(), FAttachmentTransformRules::KeepRelativeTransform, TEXT(&quot;WeaponSocket&quot;));\r\n\tWeapon-&gt;SetOwner(this);\r\n}\r\n\r\nbool AShooterCharacter::IsDead() const\r\n{\r\n\treturn Health &lt;= 0;\r\n}\r\n\r\nfloat AShooterCharacter::GetHealthPercent() const\r\n{\r\n\treturn Health \/ MaxHealth;\r\n}\r\n\r\n\/\/ Called every frame\r\nvoid AShooterCharacter::Tick(float DeltaTime)\r\n{\r\n\tSuper::Tick(DeltaTime);\r\n\r\n}\r\n\r\n\/\/ Called to bind functionality to input\r\nvoid AShooterCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)\r\n{\r\n\tSuper::SetupPlayerInputComponent(PlayerInputComponent);\r\n\r\n\tif (UEnhancedInputComponent* EnhancedInputComponent = CastChecked&lt;UEnhancedInputComponent&gt;(PlayerInputComponent))\r\n\t{\r\n\t\tEnhancedInputComponent-&gt;BindAction(MoveAction, ETriggerEvent::Triggered, this, &amp;AShooterCharacter::Move);\r\n\t\tEnhancedInputComponent-&gt;BindAction(LookAction, ETriggerEvent::Triggered, this, &amp;AShooterCharacter::Look);\r\n\t\tEnhancedInputComponent-&gt;BindAction(JumpAction, ETriggerEvent::Triggered, this, &amp;ACharacter::Jump);\r\n\t\tEnhancedInputComponent-&gt;BindAction(ShootAction, ETriggerEvent::Triggered, this, &amp;AShooterCharacter::Shoot);\r\n\t\tEnhancedInputComponent-&gt;BindAction(CrouchAction, ETriggerEvent::Triggered, this, &amp;AShooterCharacter::Crouch);\r\n\t\tEnhancedInputComponent-&gt;BindAction(CrouchAction, ETriggerEvent::Completed, this, &amp;AShooterCharacter::Uncrouch);\r\n\t}\r\n\r\n}\r\n\r\nfloat AShooterCharacter::TakeDamage(float DamageAmount, FDamageEvent const&amp; DamageEvent, AController* EventInstigator, AActor* DamageCauser)\r\n{\r\n\tfloat DamageToApply = Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser);\r\n\tDamageToApply = FMath::Min(Health, DamageToApply);\r\n\tHealth -= DamageToApply;\r\n\tUE_LOG(LogTemp, Warning, TEXT(&quot;Health left %f&quot;), Health);\r\n\r\n\tif (IsDead())\r\n\t{\r\n\t\tASimpleShooterGameModeBase* GameMode = GetWorld()-&gt;GetAuthGameMode&lt;ASimpleShooterGameModeBase&gt;();\r\n\r\n\t\tif (GameMode != nullptr)\r\n\t\t{\r\n\t\t\tGameMode-&gt;PawnKilled(this);\r\n\t\t}\r\n\r\n\t\tDetachFromControllerPendingDestroy();\r\n\t\tGetCapsuleComponent()-&gt;SetCollisionEnabled(ECollisionEnabled::NoCollision);\r\n\t\t\r\n\t}\r\n\r\n\treturn DamageToApply;\r\n}\r\n\r\nvoid AShooterCharacter::ShootBullet()\r\n{\r\n\tWeapon-&gt;PullTrigger();\r\n}\r\n\r\nvoid AShooterCharacter::Move(const FInputActionValue&amp; Value)\r\n{\r\n\r\n\tif (MovementComponent-&gt;IsCrouching()) { return; };\r\n\r\n\tFVector Forward = GetActorForwardVector();\r\n\tFVector Right = GetActorRightVector();\r\n\tconst FVector2D DirectionValue = Value.Get&lt;FVector2D&gt;();\r\n\tAddMovementInput(Forward * DirectionValue.Y);\r\n\tAddMovementInput(Right * DirectionValue.X);\r\n}\r\n\r\nvoid AShooterCharacter::Look(const FInputActionValue&amp; Value)\r\n{\r\n\tconst float Pitch = Value.Get&lt;FVector2D&gt;().Y;\r\n\tconst float Yaw = Value.Get&lt;FVector2D&gt;().X;\r\n\tAddControllerPitchInput(Pitch);\r\n\tAddControllerYawInput(Yaw);\r\n}\r\n\r\nvoid AShooterCharacter::Crouch(const FInputActionValue&amp; Value)\r\n{\r\n\r\n\tif (MovementComponent)\r\n\t{\r\n\t\tMovementComponent-&gt;bWantsToCrouch = true;\r\n\t}\r\n\r\n}\r\n\r\nvoid AShooterCharacter::Uncrouch(const FInputActionValue&amp; Value)\r\n{\r\n\r\n\tif (MovementComponent)\r\n\t{\r\n\t\tMovementComponent-&gt;bWantsToCrouch = false;\r\n\t}\r\n}\r\n\r\n\r\nvoid AShooterCharacter::Shoot(const FInputActionValue&amp; Value)\r\n{\r\n\tAShooterCharacter::ShootBullet();\r\n}\r\n\r\n\r\n\r\n\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div><div class=\"eael-accordion-list\">\n\t\t\t\t\t<div id=\"shooterplayercontroller\" class=\"elementor-tab-title eael-accordion-header\" tabindex=\"0\" data-tab=\"2\" aria-controls=\"elementor-tab-content-2312\"><span class=\"eael-advanced-accordion-icon-closed\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-advanced-accordion-icon-opened\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-accordion-tab-title\">ShooterPlayerController<\/span><i aria-hidden=\"true\" class=\"fa-toggle fas fa-angle-right\"><\/i><\/div><div id=\"elementor-tab-content-2312\" class=\"eael-accordion-content clearfix\" data-tab=\"2\" aria-labelledby=\"shooterplayercontroller\"><style><\/style>\t\t<div data-elementor-type=\"section\" data-elementor-id=\"1504\" class=\"elementor elementor-1504\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-32ba402 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"32ba402\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8953942\" data-id=\"8953942\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-934faba elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"934faba\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n#pragma once\r\n\r\n#include &quot;CoreMinimal.h&quot;\r\n#include &quot;GameFramework\/PlayerController.h&quot;\r\n#include &quot;ShooterPlayerController.generated.h&quot;\r\n\r\n\/**\r\n * \r\n *\/\r\nUCLASS()\r\nclass SIMPLESHOOTER_API AShooterPlayerController : public APlayerController\r\n{\r\n\tGENERATED_BODY()\r\n\r\npublic:\r\n\r\n\tvirtual void GameHasEnded(class AActor* EndGameFocus = nullptr, bool bIsWinner = false) override;\r\n\r\nprotected:\r\n\t\/\/ Called when the game starts or when spawned\r\n\tvirtual void BeginPlay() override;\r\n\r\nprivate:\r\n\r\n\tUPROPERTY(EditAnywhere)\r\n\tTSubclassOf&lt;class UUserWidget&gt; LoseScreenClass;\r\n\r\n\tUPROPERTY(EditAnywhere)\r\n\tTSubclassOf&lt;class UUserWidget&gt; WinScreenClass;\r\n\r\n\tUPROPERTY(EditAnywhere)\r\n\tTSubclassOf&lt;class UUserWidget&gt; HUDClass;\r\n\r\n\tUPROPERTY(EditAnywhere)\r\n\tfloat RestartDelay = 5;\r\n\r\n\tFTimerHandle RestartTimer;\r\n\r\n\tUPROPERTY()\r\n\tUUserWidget *HUD;\r\n\r\n};\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-220e44d elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"220e44d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n\r\n#include &quot;Controllers\/ShooterPlayerController.h&quot;\r\n#include &quot;TimerManager.h&quot;\r\n#include &quot;Blueprint\/UserWidget.h&quot;\r\n\r\nvoid AShooterPlayerController::GameHasEnded(AActor* EndGameFocus, bool bIsWinner)\r\n{\r\n\r\n\tSuper::GameHasEnded(EndGameFocus, bIsWinner);\r\n\r\n\tHUD-&gt;RemoveFromViewport();\r\n\r\n\tif(bIsWinner)\r\n\t{\r\n\t\tUUserWidget* LoseScreen = CreateWidget(this, WinScreenClass);\r\n\t\tif (LoseScreen != nullptr)\r\n\t\t{\r\n\t\t\tLoseScreen-&gt;AddToViewport();\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\tUUserWidget* LoseScreen = CreateWidget(this, LoseScreenClass);\r\n\t\tif (LoseScreen != nullptr)\r\n\t\t{\r\n\t\t\tLoseScreen-&gt;AddToViewport();\r\n\t\t}\r\n\t}\r\n\t\r\n\tGetWorldTimerManager().SetTimer(RestartTimer, this, &amp;APlayerController::RestartLevel, RestartDelay);\r\n\r\n}\r\n\r\nvoid AShooterPlayerController::BeginPlay()\r\n{\r\n\tSuper::BeginPlay();\r\n\r\n\t HUD = CreateWidget(this, HUDClass);\r\n\tif (HUD != nullptr)\r\n\t{\r\n\t\t\/\/HUD-&gt;AddToViewport();\r\n\t}\r\n}\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div><div class=\"eael-accordion-list\">\n\t\t\t\t\t<div id=\"shooteraicontroller\" class=\"elementor-tab-title eael-accordion-header\" tabindex=\"0\" data-tab=\"3\" aria-controls=\"elementor-tab-content-2313\"><span class=\"eael-advanced-accordion-icon-closed\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-advanced-accordion-icon-opened\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-accordion-tab-title\">ShooterAIController<\/span><i aria-hidden=\"true\" class=\"fa-toggle fas fa-angle-right\"><\/i><\/div><div id=\"elementor-tab-content-2313\" class=\"eael-accordion-content clearfix\" data-tab=\"3\" aria-labelledby=\"shooteraicontroller\"><style><\/style>\t\t<div data-elementor-type=\"section\" data-elementor-id=\"1512\" class=\"elementor elementor-1512\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-32ba402 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"32ba402\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8953942\" data-id=\"8953942\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-934faba elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"934faba\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n#pragma once\r\n\r\n#include &quot;CoreMinimal.h&quot;\r\n#include &quot;AIController.h&quot;\r\n#include &quot;ShooterAIController.generated.h&quot;\r\n\r\n\/**\r\n * \r\n *\/\r\nUCLASS()\r\nclass SIMPLESHOOTER_API AShooterAIController : public AAIController\r\n{\r\n\tGENERATED_BODY()\r\n\t\r\nprotected:\r\n\r\n\tvirtual void BeginPlay();\r\n\r\n\tAPawn* PlayerPawn;\r\n\r\npublic:\r\n\r\n\tvirtual void Tick(float DeltaSeconds) override;\r\n\tbool IsDead() const;\r\n\r\nprivate:\r\n\r\n\tUPROPERTY(EditDefaultsOnly)\r\n\tclass UBehaviorTree* AIBehavior;\r\n};\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-220e44d elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"220e44d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n\r\n#include &quot;AI\/ShooterAIController.h&quot;\r\n#include &quot;Kismet\/GameplayStatics.h&quot;\r\n#include &quot;BehaviorTree\/BlackboardComponent.h&quot;\r\n#include &quot;Characters\/ShooterCharacter.h&quot;\r\n\r\nvoid AShooterAIController::BeginPlay()\r\n{\r\n\r\n\tSuper::BeginPlay();\r\n\r\n\tPlayerPawn = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);\r\n\r\n\tif (AIBehavior != nullptr)\r\n\t{\r\n\t\tRunBehaviorTree(AIBehavior);\t\r\n\t}\r\n\r\n\tGetBlackboardComponent()-&gt;SetValueAsVector(TEXT(&quot;StartLocation&quot;), GetPawn()-&gt;GetActorLocation());\r\n}\r\n\r\nvoid AShooterAIController::Tick(float DeltaSeconds)\r\n{\r\n\tSuper::Tick(DeltaSeconds);\r\n\t\r\n}\r\n\r\nbool AShooterAIController::IsDead() const\r\n{\r\n\tAShooterCharacter* ControlledCharacter = Cast&lt;AShooterCharacter&gt;(GetPawn());\r\n\tif (ControlledCharacter != nullptr)\r\n\t{\r\n\t\treturn ControlledCharacter-&gt;IsDead();\r\n\t}\r\n\treturn false;\r\n}\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div><div class=\"eael-accordion-list\">\n\t\t\t\t\t<div id=\"gun\" class=\"elementor-tab-title eael-accordion-header\" tabindex=\"0\" data-tab=\"4\" aria-controls=\"elementor-tab-content-2314\"><span class=\"eael-advanced-accordion-icon-closed\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-advanced-accordion-icon-opened\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-accordion-tab-title\">Gun<\/span><i aria-hidden=\"true\" class=\"fa-toggle fas fa-angle-right\"><\/i><\/div><div id=\"elementor-tab-content-2314\" class=\"eael-accordion-content clearfix\" data-tab=\"4\" aria-labelledby=\"gun\"><style><\/style>\t\t<div data-elementor-type=\"section\" data-elementor-id=\"1515\" class=\"elementor elementor-1515\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-32ba402 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"32ba402\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8953942\" data-id=\"8953942\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-934faba elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"934faba\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n#pragma once\r\n\r\n#include &quot;CoreMinimal.h&quot;\r\n#include &quot;GameFramework\/Actor.h&quot;\r\n#include &quot;Gun.generated.h&quot;\r\n\r\nclass UParticleSystem;\r\n\r\nUCLASS()\r\nclass SIMPLESHOOTER_API AGun : public AActor\r\n{\r\n\tGENERATED_BODY()\r\n\t\r\npublic:\t\r\n\t\/\/ Sets default values for this actor&#039;s properties\r\n\tAGun();\r\n\r\n\tvoid PullTrigger();\r\n\r\nprotected:\r\n\t\/\/ Called when the game starts or when spawned\r\n\tvirtual void BeginPlay() override;\r\n\r\npublic:\t\r\n\t\/\/ Called every frame\r\n\tvirtual void Tick(float DeltaTime) override;\r\n\r\nprivate:\r\n\r\n\tUPROPERTY(VisibleAnywhere)\r\n\tUSceneComponent* Root;\r\n\r\n\tUPROPERTY(VisibleAnywhere)\r\n\tUSkeletalMeshComponent* Mesh;\r\n\r\n\tUPROPERTY(EditAnywhere)\r\n\tUParticleSystem* MuzzleFlash;\r\n\r\n\tUPROPERTY(EditAnywhere)\r\n\tUSoundBase* MuzzleSound;\r\n\r\n\tUPROPERTY(EditAnywhere)\r\n\tUParticleSystem* ImpactFx;\r\n\r\n\tUPROPERTY(EditAnywhere)\r\n\tUSoundBase* ImpactSound;\r\n\r\n\tUPROPERTY(EditAnywhere)\r\n\tfloat MaxRange = 1000;\r\n\r\n\tUPROPERTY(EditAnywhere)\r\n\tfloat Damage = 10;\r\n\r\n\tbool GunTrace(FHitResult&amp; Hit, FVector&amp; ShotDirection);\r\n\r\n\tAController* GetOwnerController() const;\r\n\r\n};\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-220e44d elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"220e44d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n\r\n#include &quot;Weapons\/Gun.h&quot;\r\n#include &quot;Components\/SkeletalMeshComponent.h&quot;\r\n#include &quot;Kismet\/GameplayStatics.h&quot;\r\n#include &quot;DrawDebugHelpers.h&quot;\r\n#include &quot;Engine\/DamageEvents.h&quot;\r\n\r\n\/\/ Sets default values\r\nAGun::AGun()\r\n{\r\n \t\/\/ Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don&#039;t need it.\r\n\tPrimaryActorTick.bCanEverTick = true;\r\n\r\n\tRoot = CreateDefaultSubobject&lt;USceneComponent&gt;(TEXT(&quot;Root&quot;));\r\n\tSetRootComponent(Root);\r\n\t\r\n\tMesh = CreateDefaultSubobject&lt;USkeletalMeshComponent&gt;(TEXT(&quot;Mesh&quot;));\r\n\tMesh-&gt;SetupAttachment(Root);\r\n\r\n}\r\n\r\nvoid AGun::PullTrigger()\r\n{\r\n\tUGameplayStatics::SpawnEmitterAttached(MuzzleFlash, Mesh, TEXT(&quot;MuzzleFlashSocket&quot;));\r\n\tUGameplayStatics::SpawnSoundAttached(MuzzleSound, Mesh, TEXT(&quot;MuzzleFlashSocket&quot;));\r\n\r\n\tFHitResult Hit;\r\n\tFVector ShotDirection;\r\n\r\n\tbool bSuccess = GunTrace(Hit, ShotDirection);\r\n\r\n\tif (bSuccess)\r\n\t{\t\r\n\t\tUGameplayStatics::SpawnEmitterAtLocation(GetWorld(), ImpactFx ,Hit.Location, ShotDirection.Rotation());\r\n\t\tUGameplayStatics::PlaySoundAtLocation(GetWorld(), ImpactSound, Hit.Location);\r\n\r\n\t\tAActor* HitActor = Hit.GetActor();\r\n\r\n\t\tif (HitActor != nullptr)\r\n\t\t{\r\n\t\t\tFPointDamageEvent DamageEvent(Damage, Hit, ShotDirection, nullptr);\r\n\t\t\tAController* OwnerController = GetOwnerController();\r\n\t\t\tHitActor-&gt;TakeDamage(Damage, DamageEvent, OwnerController, this);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\/\/ Called when the game starts or when spawned\r\nvoid AGun::BeginPlay()\r\n{\r\n\tSuper::BeginPlay();\r\n\t\r\n}\r\n\r\n\/\/ Called every frame\r\nvoid AGun::Tick(float DeltaTime)\r\n{\r\n\tSuper::Tick(DeltaTime);\r\n\r\n}\r\n\r\nbool AGun::GunTrace(FHitResult&amp; Hit, FVector&amp; ShotDirection)\r\n{\r\n\tAController* OwnerController = GetOwnerController();\r\n\tif (OwnerController == nullptr) return false;\r\n\r\n\tFVector Location;\r\n\tFRotator Rotation;\r\n\r\n\tOwnerController-&gt;GetPlayerViewPoint(Location, Rotation);\r\n\tShotDirection = -Rotation.Vector();\r\n\r\n\tFVector End = Location + Rotation.Vector() * MaxRange;\r\n\r\n\tHit;\r\n\tFCollisionQueryParams Params;\r\n\tParams.AddIgnoredActor(this);\r\n\tParams.AddIgnoredActor(GetOwner());\r\n\treturn GetWorld()-&gt;LineTraceSingleByChannel(Hit, Location, End, ECollisionChannel::ECC_GameTraceChannel1, Params);\r\n}\r\n\r\nAController* AGun::GetOwnerController() const\r\n{\r\n\tAPawn* OwnerPawn = Cast&lt;APawn&gt;(GetOwner());\r\n\tif (OwnerPawn == nullptr) return nullptr;\r\n\treturn OwnerPawn-&gt;GetController();\r\n\r\n}\r\n\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div><div class=\"eael-accordion-list\">\n\t\t\t\t\t<div id=\"killemallgamemode\" class=\"elementor-tab-title eael-accordion-header\" tabindex=\"0\" data-tab=\"5\" aria-controls=\"elementor-tab-content-2315\"><span class=\"eael-advanced-accordion-icon-closed\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-advanced-accordion-icon-opened\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-accordion-tab-title\">KillEmAllGameMode<\/span><i aria-hidden=\"true\" class=\"fa-toggle fas fa-angle-right\"><\/i><\/div><div id=\"elementor-tab-content-2315\" class=\"eael-accordion-content clearfix\" data-tab=\"5\" aria-labelledby=\"killemallgamemode\"><style><\/style>\t\t<div data-elementor-type=\"section\" data-elementor-id=\"1518\" class=\"elementor elementor-1518\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-32ba402 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"32ba402\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8953942\" data-id=\"8953942\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-934faba elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"934faba\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n#pragma once\r\n\r\n#include &quot;CoreMinimal.h&quot;\r\n#include &quot;SimpleShooter\/SimpleShooterGameModeBase.h&quot;\r\n#include &quot;KillEmAllGameMode.generated.h&quot;\r\n\r\n\/**\r\n * \r\n *\/\r\nUCLASS()\r\nclass SIMPLESHOOTER_API AKillEmAllGameMode : public ASimpleShooterGameModeBase\r\n{\r\n\tGENERATED_BODY()\r\n\r\npublic:\r\n\r\n\tvirtual void PawnKilled(APawn* PawnKilled) override;\r\n\r\nprivate:\r\n\r\n\tvoid EndGame(bool bIsPlayerWinner);\r\n};\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-220e44d elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"220e44d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n\r\n#include &quot;GameModes\/KillEmAllGameMode.h&quot;\r\n#include &quot;EngineUtils.h&quot;\r\n#include &quot;GameFramework\/Controller.h&quot;\r\n#include &quot;Ai\/ShooterAIController.h&quot;\r\n\r\nvoid AKillEmAllGameMode::PawnKilled(APawn* PawnKilled)\r\n{\r\n\tSuper::PawnKilled(PawnKilled);\r\n\r\n\tAPlayerController* PlayerController = Cast&lt;APlayerController&gt;(PawnKilled-&gt;GetController());\r\n\tif (PlayerController != nullptr)\r\n\t{\r\n\t\tEndGame(false);\r\n\t}\r\n\r\n\tfor (AShooterAIController* Controller : TActorRange&lt;AShooterAIController&gt;(GetWorld()))\r\n\t{\r\n\t\tif (!Controller-&gt;IsDead())\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tEndGame(true);\r\n}\r\n\r\nvoid AKillEmAllGameMode::EndGame(bool bIsPlayerWinner)\r\n{\r\n\tfor (AController* Controller : TActorRange&lt;AController&gt;(GetWorld()))\r\n\t{\r\n\t\tbool bIsWinner = Controller-&gt;IsPlayerController() == bIsPlayerWinner;\r\n\t\tController-&gt;GameHasEnded(Controller-&gt;GetPawn(), bIsWinner);\r\n\t\t\r\n\t}\r\n}\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div><div class=\"eael-accordion-list\">\n\t\t\t\t\t<div id=\"btservice-playerlocation\" class=\"elementor-tab-title eael-accordion-header\" tabindex=\"0\" data-tab=\"6\" aria-controls=\"elementor-tab-content-2316\"><span class=\"eael-advanced-accordion-icon-closed\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-advanced-accordion-icon-opened\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-accordion-tab-title\">BTService_PlayerLocation<\/span><i aria-hidden=\"true\" class=\"fa-toggle fas fa-angle-right\"><\/i><\/div><div id=\"elementor-tab-content-2316\" class=\"eael-accordion-content clearfix\" data-tab=\"6\" aria-labelledby=\"btservice-playerlocation\"><style><\/style>\t\t<div data-elementor-type=\"section\" data-elementor-id=\"1521\" class=\"elementor elementor-1521\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-32ba402 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"32ba402\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8953942\" data-id=\"8953942\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-934faba elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"934faba\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n#pragma once\r\n\r\n#include &quot;CoreMinimal.h&quot;\r\n#include &quot;BehaviorTree\/Services\/BTService_BlackboardBase.h&quot;\r\n#include &quot;BTService_PlayerLocation.generated.h&quot;\r\n\r\n\/**\r\n * \r\n *\/\r\nUCLASS()\r\nclass SIMPLESHOOTER_API UBTService_PlayerLocation : public UBTService_BlackboardBase\r\n{\r\n\tGENERATED_BODY()\r\n\r\npublic:\r\n\tUBTService_PlayerLocation();\r\n\r\nprotected:\r\n\r\n\tvirtual void TickNode(UBehaviorTreeComponent&amp; OwnerComp, uint8* NodeMemory, float DeltaSeconds) override;\r\n\r\n};\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-220e44d elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"220e44d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n\r\n#include &quot;Services\/BTService_PlayerLocation.h&quot;\r\n#include &quot;BehaviorTree\/BlackboardComponent.h&quot;\r\n#include &quot;Kismet\/GameplayStatics.h&quot;\r\n#include &quot;GameFramework\/Pawn.h&quot;\r\n\r\nUBTService_PlayerLocation::UBTService_PlayerLocation()\r\n{\r\n\r\n\tNodeName = TEXT(&quot;Update Player Location&quot;);\r\n\r\n}\r\n\r\nvoid UBTService_PlayerLocation::TickNode(UBehaviorTreeComponent&amp; OwnerComp, uint8* NodeMemory, float DeltaSeconds)\r\n{\r\n\tSuper::TickNode(OwnerComp, NodeMemory, DeltaSeconds);\r\n\r\n\tAPawn* PlayerPawn = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);\r\n\tif (PlayerPawn == nullptr)\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\r\n\tOwnerComp.GetBlackboardComponent()-&gt;SetValueAsVector(GetSelectedBlackboardKey(), PlayerPawn-&gt;GetActorLocation());\r\n}\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div><div class=\"eael-accordion-list\">\n\t\t\t\t\t<div id=\"btservice-playerlocationifseen\" class=\"elementor-tab-title eael-accordion-header\" tabindex=\"0\" data-tab=\"7\" aria-controls=\"elementor-tab-content-2317\"><span class=\"eael-advanced-accordion-icon-closed\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-advanced-accordion-icon-opened\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-accordion-tab-title\">BTService_PlayerLocationIfSeen<\/span><i aria-hidden=\"true\" class=\"fa-toggle fas fa-angle-right\"><\/i><\/div><div id=\"elementor-tab-content-2317\" class=\"eael-accordion-content clearfix\" data-tab=\"7\" aria-labelledby=\"btservice-playerlocationifseen\"><style><\/style>\t\t<div data-elementor-type=\"section\" data-elementor-id=\"1524\" class=\"elementor elementor-1524\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-32ba402 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"32ba402\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8953942\" data-id=\"8953942\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-934faba elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"934faba\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n#pragma once\r\n\r\n#include &quot;CoreMinimal.h&quot;\r\n#include &quot;BehaviorTree\/Services\/BTService_BlackboardBase.h&quot;\r\n#include &quot;BTService_PlayerLocationIfSeen.generated.h&quot;\r\n\r\n\/**\r\n * \r\n *\/\r\nUCLASS()\r\nclass SIMPLESHOOTER_API UBTService_PlayerLocationIfSeen : public UBTService_BlackboardBase\r\n{\r\n\tGENERATED_BODY()\r\n\r\npublic:\r\n\r\n\tUBTService_PlayerLocationIfSeen();\r\n\r\nprotected:\r\n\r\n\tvirtual void TickNode(UBehaviorTreeComponent&amp; OwnerComp, uint8* NodeMemory, float DeltaSeconds) override;\r\n\r\n};\r\n\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-220e44d elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"220e44d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n\r\n#include &quot;Services\/BTService_PlayerLocationIfSeen.h&quot;\r\n#include &quot;BehaviorTree\/BlackboardComponent.h&quot;\r\n#include &quot;Kismet\/GameplayStatics.h&quot;\r\n#include &quot;GameFramework\/Pawn.h&quot;\r\n#include &quot;AIController.h&quot;\r\n\r\nUBTService_PlayerLocationIfSeen::UBTService_PlayerLocationIfSeen()\r\n{\r\n\r\n\tNodeName = TEXT(&quot;Update Player Location If Seen&quot;);\r\n\r\n}\r\n\r\nvoid UBTService_PlayerLocationIfSeen::TickNode(UBehaviorTreeComponent&amp; OwnerComp, uint8* NodeMemory, float DeltaSeconds)\r\n{\r\n\tSuper::TickNode(OwnerComp, NodeMemory, DeltaSeconds);\r\n\r\n\tAPawn* PlayerPawn = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);\r\n\tif (PlayerPawn == nullptr)\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (OwnerComp.GetAIOwner() == nullptr)\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (OwnerComp.GetAIOwner()-&gt;LineOfSightTo(PlayerPawn))\r\n\t{\r\n\t\tOwnerComp.GetBlackboardComponent()-&gt;SetValueAsObject(GetSelectedBlackboardKey(), PlayerPawn);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tOwnerComp.GetBlackboardComponent()-&gt;ClearValue(GetSelectedBlackboardKey());\r\n\t}\r\n\r\n}\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div><div class=\"eael-accordion-list\">\n\t\t\t\t\t<div id=\"bttask-clearblackboardvalue\" class=\"elementor-tab-title eael-accordion-header\" tabindex=\"0\" data-tab=\"8\" aria-controls=\"elementor-tab-content-2318\"><span class=\"eael-advanced-accordion-icon-closed\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-advanced-accordion-icon-opened\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-accordion-tab-title\">BTTask_ClearBlackBoardValue<\/span><i aria-hidden=\"true\" class=\"fa-toggle fas fa-angle-right\"><\/i><\/div><div id=\"elementor-tab-content-2318\" class=\"eael-accordion-content clearfix\" data-tab=\"8\" aria-labelledby=\"bttask-clearblackboardvalue\"><style><\/style>\t\t<div data-elementor-type=\"section\" data-elementor-id=\"1527\" class=\"elementor elementor-1527\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-32ba402 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"32ba402\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8953942\" data-id=\"8953942\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-934faba elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"934faba\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n#pragma once\r\n\r\n#include &quot;CoreMinimal.h&quot;\r\n#include &quot;BehaviorTree\/Tasks\/BTTask_BlackboardBase.h&quot;\r\n#include &quot;BTTask_ClearBlackBoardValue.generated.h&quot;\r\n\r\n\/**\r\n * \r\n *\/\r\nUCLASS()\r\nclass SIMPLESHOOTER_API UBTTask_ClearBlackBoardValue : public UBTTask_BlackboardBase\r\n{\r\n\tGENERATED_BODY()\r\n\r\npublic:\r\n\tUBTTask_ClearBlackBoardValue();\r\n\r\nprotected:\r\n\r\n\tvirtual EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent&amp; OwnerComp, uint8* NodeMemory) override;\r\n\r\n};\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-220e44d elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"220e44d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n#include &quot;Tasks\/BTTask_ClearBlackBoardValue.h&quot;\r\n#include &quot;BehaviorTree\/BlackboardComponent.h&quot;\r\n\r\nUBTTask_ClearBlackBoardValue::UBTTask_ClearBlackBoardValue()\r\n{\r\n\r\n\tNodeName = TEXT(&quot;Clear BlackBoard Value&quot;);\r\n\r\n}\r\n\r\nEBTNodeResult::Type UBTTask_ClearBlackBoardValue::ExecuteTask(UBehaviorTreeComponent &amp;OwnerComp, uint8* NodeMemory)\r\n{\r\n\tSuper::ExecuteTask(OwnerComp, NodeMemory);\r\n\r\n\tOwnerComp.GetBlackboardComponent()-&gt;ClearValue(GetSelectedBlackboardKey());\r\n\r\n\treturn EBTNodeResult::Succeeded;\r\n}\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div><div class=\"eael-accordion-list\">\n\t\t\t\t\t<div id=\"bttask-shoot\" class=\"elementor-tab-title eael-accordion-header\" tabindex=\"0\" data-tab=\"9\" aria-controls=\"elementor-tab-content-2319\"><span class=\"eael-advanced-accordion-icon-closed\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-advanced-accordion-icon-opened\"><i aria-hidden=\"true\" class=\"fa-accordion-icon fas fa-code\"><\/i><\/span><span class=\"eael-accordion-tab-title\">BTTask_Shoot<\/span><i aria-hidden=\"true\" class=\"fa-toggle fas fa-angle-right\"><\/i><\/div><div id=\"elementor-tab-content-2319\" class=\"eael-accordion-content clearfix\" data-tab=\"9\" aria-labelledby=\"bttask-shoot\"><style><\/style>\t\t<div data-elementor-type=\"section\" data-elementor-id=\"1530\" class=\"elementor elementor-1530\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-32ba402 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"32ba402\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8953942\" data-id=\"8953942\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-934faba elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"934faba\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n#pragma once\r\n\r\n#include &quot;CoreMinimal.h&quot;\r\n#include &quot;BehaviorTree\/BTTaskNode.h&quot;\r\n#include &quot;BTTask_Shoot.generated.h&quot;\r\n\r\n\/**\r\n * \r\n *\/\r\nUCLASS()\r\nclass SIMPLESHOOTER_API UBTTask_Shoot : public UBTTaskNode\r\n{\r\n\tGENERATED_BODY()\r\n\r\npublic:\r\n\r\n\tUBTTask_Shoot();\r\n\r\nprotected:\r\n\r\n\tvirtual EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent&amp; OwnerComp, uint8* NodeMemory) override;\r\n\t\r\n};\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-220e44d elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"220e44d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-cpp'>\/\/ Fill out your copyright notice in the Description page of Project Settings.\r\n\r\n#include &quot;Tasks\/BTTask_Shoot.h&quot;\r\n#include &quot;AIController.h&quot;\r\n#include &quot;Characters\/ShooterCharacter.h&quot;\r\n\r\nUBTTask_Shoot::UBTTask_Shoot()\r\n{\r\n\r\n\tNodeName = TEXT(&quot;Shoot&quot;);\r\n\r\n}\r\n\r\nEBTNodeResult::Type UBTTask_Shoot::ExecuteTask(UBehaviorTreeComponent&amp; OwnerComp, uint8* NodeMemory)\r\n{\r\n\tSuper::ExecuteTask(OwnerComp, NodeMemory);\r\n\r\n\tif (OwnerComp.GetAIOwner() == nullptr)\r\n\t{\r\n\t\treturn EBTNodeResult::Failed;\r\n\t}\r\n\r\n\tAShooterCharacter* Character = Cast&lt;AShooterCharacter&gt;(OwnerComp.GetAIOwner()-&gt;GetPawn());\r\n\tif (Character == nullptr)\r\n\t{\r\n\t\treturn EBTNodeResult::Failed;\r\n\t}\r\n\r\n\tCharacter-&gt;ShootBullet();\r\n\r\n\treturn EBTNodeResult::Succeeded;\r\n}\r\n <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/rubennotario.es\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div><\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-df76a12 elementor-widget elementor-widget-spacer\" data-id=\"df76a12\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Mission Escape Summer 2023 This is my second game programmed with with C++. Consists of eliminating all the enemies without being eliminated. This project started following an\u00a0udemy course\u00a0made by\u00a0GameDev.tv Team\u00a0and\u00a0Ben Tristem. (One of the best selling courses about c++ for Unreal Engine). Still being a simple project, but was useful to go a bit further [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_header_footer","meta":{"footnotes":""},"class_list":["post-1425","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Simple Shoter C++ &#183; Rub\u00e9n Notario<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rubennotario.es\/?page_id=1425\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Simple Shoter C++ &#183; Rub\u00e9n Notario\" \/>\n<meta property=\"og:description\" content=\"Mission Escape Summer 2023 This is my second game programmed with with C++. Consists of eliminating all the enemies without being eliminated. This project started following an\u00a0udemy course\u00a0made by\u00a0GameDev.tv Team\u00a0and\u00a0Ben Tristem. (One of the best selling courses about c++ for Unreal Engine). Still being a simple project, but was useful to go a bit further [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rubennotario.es\/?page_id=1425\" \/>\n<meta property=\"og:site_name\" content=\"Rub\u00e9n Notario\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-02T19:13:14+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rubennotario.es\\\/?page_id=1425\",\"url\":\"https:\\\/\\\/rubennotario.es\\\/?page_id=1425\",\"name\":\"Simple Shoter C++ &#183; Rub\u00e9n Notario\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rubennotario.es\\\/#website\"},\"datePublished\":\"2024-01-13T14:57:13+00:00\",\"dateModified\":\"2025-10-02T19:13:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rubennotario.es\\\/?page_id=1425#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rubennotario.es\\\/?page_id=1425\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rubennotario.es\\\/?page_id=1425#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rubennotario.es\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Simple Shoter C++\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/rubennotario.es\\\/#website\",\"url\":\"https:\\\/\\\/rubennotario.es\\\/\",\"name\":\"rubennotario.es\",\"description\":\"Gameplay programmer specialized in Unreal Engine\",\"publisher\":{\"@id\":\"https:\\\/\\\/rubennotario.es\\\/#organization\"},\"alternateName\":\"Rub\u00e9n Notario\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/rubennotario.es\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/rubennotario.es\\\/#organization\",\"name\":\"Rub\u00e9n Notario\",\"alternateName\":\"Rub\u00e9n Notario\",\"url\":\"https:\\\/\\\/rubennotario.es\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rubennotario.es\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/rubennotario.es\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/logo-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/rubennotario.es\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/logo-scaled.jpg\",\"width\":2560,\"height\":2560,\"caption\":\"Rub\u00e9n Notario\"},\"image\":{\"@id\":\"https:\\\/\\\/rubennotario.es\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Simple Shoter C++ &#183; Rub\u00e9n Notario","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/rubennotario.es\/?page_id=1425","og_locale":"en_US","og_type":"article","og_title":"Simple Shoter C++ &#183; Rub\u00e9n Notario","og_description":"Mission Escape Summer 2023 This is my second game programmed with with C++. Consists of eliminating all the enemies without being eliminated. This project started following an\u00a0udemy course\u00a0made by\u00a0GameDev.tv Team\u00a0and\u00a0Ben Tristem. (One of the best selling courses about c++ for Unreal Engine). Still being a simple project, but was useful to go a bit further [&hellip;]","og_url":"https:\/\/rubennotario.es\/?page_id=1425","og_site_name":"Rub\u00e9n Notario","article_modified_time":"2025-10-02T19:13:14+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/rubennotario.es\/?page_id=1425","url":"https:\/\/rubennotario.es\/?page_id=1425","name":"Simple Shoter C++ &#183; Rub\u00e9n Notario","isPartOf":{"@id":"https:\/\/rubennotario.es\/#website"},"datePublished":"2024-01-13T14:57:13+00:00","dateModified":"2025-10-02T19:13:14+00:00","breadcrumb":{"@id":"https:\/\/rubennotario.es\/?page_id=1425#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rubennotario.es\/?page_id=1425"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/rubennotario.es\/?page_id=1425#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rubennotario.es\/"},{"@type":"ListItem","position":2,"name":"Simple Shoter C++"}]},{"@type":"WebSite","@id":"https:\/\/rubennotario.es\/#website","url":"https:\/\/rubennotario.es\/","name":"rubennotario.es","description":"Gameplay programmer specialized in Unreal Engine","publisher":{"@id":"https:\/\/rubennotario.es\/#organization"},"alternateName":"Rub\u00e9n Notario","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rubennotario.es\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/rubennotario.es\/#organization","name":"Rub\u00e9n Notario","alternateName":"Rub\u00e9n Notario","url":"https:\/\/rubennotario.es\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rubennotario.es\/#\/schema\/logo\/image\/","url":"https:\/\/rubennotario.es\/wp-content\/uploads\/2022\/01\/logo-scaled.jpg","contentUrl":"https:\/\/rubennotario.es\/wp-content\/uploads\/2022\/01\/logo-scaled.jpg","width":2560,"height":2560,"caption":"Rub\u00e9n Notario"},"image":{"@id":"https:\/\/rubennotario.es\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/rubennotario.es\/index.php?rest_route=\/wp\/v2\/pages\/1425","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rubennotario.es\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/rubennotario.es\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/rubennotario.es\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rubennotario.es\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1425"}],"version-history":[{"count":172,"href":"https:\/\/rubennotario.es\/index.php?rest_route=\/wp\/v2\/pages\/1425\/revisions"}],"predecessor-version":[{"id":3645,"href":"https:\/\/rubennotario.es\/index.php?rest_route=\/wp\/v2\/pages\/1425\/revisions\/3645"}],"wp:attachment":[{"href":"https:\/\/rubennotario.es\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}