From cff6ba0a316f6f23852f7451adaade8454b6592f Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Tue, 3 Sep 2019 20:03:41 -0400 Subject: lua handling movement events? idea --- Scripts/init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Scripts') diff --git a/Scripts/init.lua b/Scripts/init.lua index 6d225f5..d1f108c 100644 --- a/Scripts/init.lua +++ b/Scripts/init.lua @@ -1,5 +1,19 @@ bird = { Player = 0, + EventListeners = { + MoveLeftPressed = function(self) + self.Velocity.x = self.Velocity.x - 100 + end, + MoveLeftReleased = function(self) + self.Velocity.x = self.Velocity.x + 100 + end, + MoveRightPressed = function(self) + self.Velocity.x = self.Velocity.x + 100 + end, + MoveRightReleased = function(self) + self.Velocity.x = self.Velocity.x - 100 + end + }, Position = { x = 150, y = 75 -- cgit v1.2.3