aboutsummaryrefslogtreecommitdiffstats
path: root/Scripts
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2019-09-03 20:03:41 -0400
committerClyne Sullivan <clyne@bitgloo.com>2019-09-03 20:03:41 -0400
commitcff6ba0a316f6f23852f7451adaade8454b6592f (patch)
tree35e121a87b618be49dda8e77fffd3272dc4a3758 /Scripts
parentec1d57aeadbd0f34616eeec8f1a922ca61b90085 (diff)
lua handling movement events? idea
Diffstat (limited to 'Scripts')
-rw-r--r--Scripts/init.lua14
1 files changed, 14 insertions, 0 deletions
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