Skip to content

Commit

Permalink
Merge branch 'release/0.0.5'
Browse files Browse the repository at this point in the history
* release/0.0.5:
  build settings
  disable input on initial tutorial
  • Loading branch information
elton999 committed May 14, 2023
2 parents be3c24a + e66275f commit 6b7932a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

# Define required raylib variables
PROJECT_NAME ?= ProjectLight
RAYLIB_VERSION ?= 0.0.4
RAYLIB_VERSION ?= 0.0.5
RAYLIB_PATH ?= C:/raylib/raylib

# Define compiler path on Windows
Expand Down
3 changes: 3 additions & 0 deletions src/Entities/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ void Player::Input()
return;
}

if (!InputIsEnabled)
return;

if (IsKeyDown(KEY_A))
Direction.x = -1;
if (IsKeyDown(KEY_D))
Expand Down
2 changes: 2 additions & 0 deletions src/Entities/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class Player : public SpriteAnimation, public CollisionCharacter, public IResetS
PlayerFlashLight *FlashLight;
Backpack *PlayerBackpack;

bool InputIsEnabled{false};

float LineTargetLength{50.0f};

virtual void Start() override;
Expand Down
4 changes: 4 additions & 0 deletions src/UI/UI_InputTutorial.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "UI_InputTutorial.h"
#include "../Window.h"
#include "../Scene/Scene.h"

void UI_InputTutorial::Start()
{
Expand Down Expand Up @@ -37,7 +38,10 @@ void UI_InputTutorial::Update(float dt)
mouseAnimation->Update(dt);

if (_timeShowingMouseAnimation <= 0)
{
GetScene()->GetPlayer()->InputIsEnabled = true;
Hide();
}
}

void UI_InputTutorial::Draw()
Expand Down

0 comments on commit 6b7932a

Please sign in to comment.