Skip to content

Commit

Permalink
global balancing
Browse files Browse the repository at this point in the history
  • Loading branch information
Renardjojo committed Feb 26, 2023
1 parent 488c36b commit 1e90bdd
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 25 deletions.
26 changes: 13 additions & 13 deletions content/setting/animation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Nodes:
sprite: idle2.png
sizeFactor: 2
tileCount: 14
framerate: 8
framerate: 7
loop: true
AnimationNode:
name: sleep
sprite: sleep.png
sizeFactor: 2
tileCount: 6
framerate: 6
framerate: 4
loop: true
GrabNode:
name: grab
Expand Down Expand Up @@ -75,9 +75,9 @@ Transitions:
to: grab
RandomDelayTransition:
from: idle1
to: [walk, jump, sleep, fly]
duration: 3000
interval: 1000
to: [walk, walk, jump, sleep]
duration: 4000
interval: 2000
IsNotGroundedTransition:
from: idle1
to: air
Expand All @@ -86,8 +86,8 @@ Transitions:
to: grab
RandomDelayTransition:
from: idle2
to: [walk, jump, sleep, fly]
duration: 3000
to: [walk, jump, jump, fly]
duration: 2000
interval: 1000
IsNotGroundedTransition:
from: idle2
Expand All @@ -101,8 +101,8 @@ Transitions:
RandomDelayTransition:
from: walk
to: [idle1, idle2]
duration: 3000
interval: 500
duration: 2000
interval: 1000
TouchScreenEdgeTransition:
from: fly
to: [idle1, idle2]
Expand All @@ -112,8 +112,8 @@ Transitions:
RandomDelayTransition:
from: fly
to: [idle1, idle2]
duration: 5000
interval: 1000
duration: 6000
interval: 2000
StartLeftClicTransition:
from: jump
to: grab
Expand All @@ -135,5 +135,5 @@ Transitions:
RandomDelayTransition:
from: sleep
to: [idle1, idle2]
duration: 9000
interval: 1000
duration: 30000
interval: 15000
16 changes: 8 additions & 8 deletions content/setting/setting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ Physic:
Friction: 0.85 # [0, 1] : 0 no friction, 1 max friction
GravityX: 0
GravityY: 9.81
Bounciness: 0.7 # [0, 1] : 0 no bounciness, 1 full energie restitution
Bounciness: 0.6 # [0, 1] : 0 no bounciness, 1 full energie restitution
ContinuousCollisionMaxVelocity: 40 # min 0
FootBasementWidth: 4 # min 2
FootBasementWidth: 6 # min 2
FootBasementHeight: 2 # min 2
CollisionPixelRatioStopMovement: 0.3 # min 0, max 1. Ratio of pixel with collision to detect a real collision
IsGroundedDetection: 1.0 # min 0
InputReleaseImpulse: 3.0 # min 0
InputReleaseImpulse: 1.0 # min 0. Velocity factor after release the pet
GamePlay:
CoyoteTimeCursorMovement: 0.1 # min 0
CoyoteTimeCursorMovement: 0.05 # min 0. Record duration of the velocity before released the pet to preserve velocity with the mouse movement
Window:
ShowFrameBufferBackground: false
UseForwardWindow: true
ShowWindow: false
UseMousePassThoughWindow: true
UseForwardWindow: true # Define if the application should be displayed in forground
ShowWindow: false # Display the window edge or not
UseMousePassThoughWindow: true # Define if user can selection pet only with selected pixel or with the entire windows
Debug:
ShowEdgeDetection: false
ShowEdgeDetection: false # Debug mode to display the result of the collision alogyrthm on the entire window
5 changes: 5 additions & 0 deletions include/Engine/TimeManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ class TimeManager
m_timerQueue.emplace(functionToExecute, delay, delay + datas.timeAcc, isLooping);
}

void setFrameRate(int FPS)
{
m_fixedDeltaTime = 1. / FPS;
}

void update(std::function<void(double deltaTime)> unlimitedUpdateFunction,
std::function<void(double deltaTime)> limitedUpdateFunction)
{
Expand Down
8 changes: 4 additions & 4 deletions include/Game/Pet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class NeedUpdator
NeedUpdator(GameData& datas, DialoguePopUp& dialoguePopup, UtilitySystem& utilitySystem)
: m_datas{datas}, m_dialoguePopup{dialoguePopup}, m_utilitySystem{utilitySystem}
{
nexTimeDisplayPopup = randNum(5000, 10000) / 1000.f;
nexTimeDisplayPopup = randNum(10000, 30000) / 1000.f;
}

void update(float deltaTime)
Expand All @@ -131,7 +131,7 @@ class NeedUpdator
m_dialoguePopup.display(1.f, EPopupType::Dialogue, ENeed::Angry);
displayPopupCurrentTimer = 0;
lastNeed = currentNeedIndex;
nexTimeDisplayPopup = randNum(5000, 10000) / 1000.f;
nexTimeDisplayPopup = randNum(10000, 30000) / 1000.f;
}
else
{
Expand All @@ -140,7 +140,7 @@ class NeedUpdator
if (displayPopupCurrentTimer > nexTimeDisplayPopup)
{
displayPopupCurrentTimer -= nexTimeDisplayPopup;
nexTimeDisplayPopup = randNum(5000, 10000) / 1000.f;
nexTimeDisplayPopup = randNum(10000, 30000) / 1000.f;
m_dialoguePopup.display(2.f, EPopupType::Dialogue, ENeed::Angry);
}
}
Expand All @@ -152,7 +152,7 @@ class NeedUpdator
if (displayPopupCurrentTimer > nexTimeDisplayPopup)
{
displayPopupCurrentTimer -= nexTimeDisplayPopup;
nexTimeDisplayPopup = randNum(5000, 10000) / 1000.f;
nexTimeDisplayPopup = randNum(10000, 30000) / 1000.f;
m_dialoguePopup.display(2.f, EPopupType::Dialogue, ENeed::Love);
}
}
Expand Down

0 comments on commit 1e90bdd

Please sign in to comment.