aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authoruruk2014-03-01 22:38:25 +0100
committeruruk2014-03-01 22:38:25 +0100
commitf2c03e575156ab815d9e2f3c2e0c55f42c0d91c3 (patch)
tree9b86696bb4e04b0eba1e200cfdb8c4d355b7216a /engines
parent0572fa5d351c0cd1a34a69df76c81c48382be81b (diff)
downloadscummvm-rg350-f2c03e575156ab815d9e2f3c2e0c55f42c0d91c3.tar.gz
scummvm-rg350-f2c03e575156ab815d9e2f3c2e0c55f42c0d91c3.tar.bz2
scummvm-rg350-f2c03e575156ab815d9e2f3c2e0c55f42c0d91c3.zip
AVALANCHE: Implement shooting in ShootEmUp::readKbd().
Diffstat (limited to 'engines')
-rw-r--r--engines/avalanche/shootemup.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp
index bf041b5ad8..88de958747 100644
--- a/engines/avalanche/shootemup.cpp
+++ b/engines/avalanche/shootemup.cpp
@@ -67,7 +67,7 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) {
_avvyAnim = 1;
_avvyFacing = kFacingLeft;
_altWasPressedBefore = false;
- _throwNext = 74;
+ _throwNext = 73;
_firing = false;
for (int i = 0; i < 4; i++) {
_running[i]._x = kFlag;
@@ -420,6 +420,35 @@ void ShootEmUp::moveAvvy() {
}
void ShootEmUp::readKbd() {
+ Common::Event event;
+ _vm->getEvent(event);
+
+ if (_firing)
+ return;
+
+ if (event.type == Common::EVENT_KEYDOWN) {
+ if ((event.kbd.keycode == Common::KEYCODE_LALT) || (event.kbd.keycode == Common::KEYCODE_RALT)) {
+ if (_altWasPressedBefore || (_count321 != 0))
+ return;
+
+ _altWasPressedBefore = true;
+ _firing = true;
+ define(_avvyPos + 27, kAvvyY + 5, _throwNext, 0, -2, 53, true, true);
+ _throwNext++;
+ if (_throwNext == 79)
+ _throwNext = 73;
+ _avvyAnim = 0;
+ _wasFacing = _avvyFacing;
+ _avvyFacing = kAvvyShoots;
+ return;
+ }
+ }
+
+ if ((event.type == Common::EVENT_KEYUP) && ((event.kbd.keycode == Common::KEYCODE_LALT) || (event.kbd.keycode == Common::KEYCODE_RALT))) {
+ _altWasPressedBefore = false;
+ return;
+ }
+
warning("STUB: ShootEmUp::readKbd()");
}