That was really close but buggy let me see if I can't explain the game a bit better.
You have two buttons the left key and the right key. If you hold left the player goes left, if you hold right the player goes right. However if you Hit then Release both buttons, the player shoots_a_beam() and does NOT move at all. Hitting and releasing both buttons means that the player wants to shoot the beam and not move. It is important that the beam shooting action happens only on the release of the button combination so the beam will not be executed with every step that the buttons are down.
The player holds only left, the ship moves left. The player holds only right the ship moves right. The player hits both buttons and a beam is fired only upon the release of the two held buttons.
to say it differently
left down= move left
right down = move right
left and right "tapped"=shoot beam
By tap I mean a full press and release. Ofcourse, executing any one of these outcomes will void the other two options. You cannot move while firing the beam for example.
Sorry for the former confusion.
You have two buttons the left key and the right key. If you hold left the player goes left, if you hold right the player goes right. However if you Hit then Release both buttons, the player shoots_a_beam() and does NOT move at all. Hitting and releasing both buttons means that the player wants to shoot the beam and not move. It is important that the beam shooting action happens only on the release of the button combination so the beam will not be executed with every step that the buttons are down.
The player holds only left, the ship moves left. The player holds only right the ship moves right. The player hits both buttons and a beam is fired only upon the release of the two held buttons.
to say it differently
left down= move left
right down = move right
left and right "tapped"=shoot beam
By tap I mean a full press and release. Ofcourse, executing any one of these outcomes will void the other two options. You cannot move while firing the beam for example.
Sorry for the former confusion.