summaryrefslogtreecommitdiff
path: root/src/gnu_and_bola_brawlers/keyreleased/default.lua
blob: 99376e96d1cad8007a48daf9206e85f534b8c1b0 (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
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