Added Wren scripting with module system 📚

Added Input pressed, released system
Added interface button support with wren onclick callback
This commit is contained in:
Antoine Pilote
2021-06-09 22:15:53 -04:00
parent aa2ebd04c8
commit 19db72aa22
1185 changed files with 320199 additions and 486 deletions

View File

@@ -86,15 +86,15 @@ public:
void OnUpdate(Timestep ts)
{
if (Input::IsKeyPress(GLFW_KEY_W))
if (Input::IsKeyDown(GLFW_KEY_W))
velocity.z = 5.0f;
else if (Input::IsKeyPress(GLFW_KEY_S))
else if (Input::IsKeyDown(GLFW_KEY_S))
velocity.z = -5.0f;
else
velocity.z = 0.0f;
if (Input::IsKeyPress(GLFW_KEY_A))
if (Input::IsKeyDown(GLFW_KEY_A))
velocity.x = 5.0f;
else if (Input::IsKeyPress(GLFW_KEY_D))
else if (Input::IsKeyDown(GLFW_KEY_D))
velocity.x = -5.0f;
else
velocity.x = 0.0f;
@@ -159,16 +159,18 @@ int main()
while (!Engine::GetCurrentWindow()->ShouldClose())
{
Engine::Tick();
Engine::Draw();
if (Input::IsKeyPress(GLFW_KEY_F8))
if (Input::IsKeyPressed(GLFW_KEY_F8))
Engine::ExitPlayMode();
editor.Draw();
Engine::EndDraw();
Engine::Tick();
}
Engine::Close();