summaryrefslogtreecommitdiff
path: root/src/gnu_and_bola_brawlers/keyreleased/default.lua
blob: ccfa93a8087c8bdd764569831aaaf57b59c51ede (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--[[ Contains trigger parameters for when a key is released ]]--

local keyreleased = {}

keyreleased.trigger = function(character, controller, key, scancode)
  if scancode == controller.a then
    character.actionA     = false
  end

  if scancode == controller.left then
    character.actionLeft  = false
  end

  if scancode == controller.right then
    character.actionRight = false
  end

  if scancode == controller.up then
    character.actionUp    = false
  end

  if scancode == controller.down then
    character.actionDown  = false
  end

  if scancode == controller.b then
    character.actionB     = false
  end

  if scancode == controller.a then
    character.actionA = false

    if character.jump.velocity ~= 0 then
      character.jump.limitButtonJump = true
    end
  end
end

return keyreleased