TransWikia.com

Is it possible to crouch when playing Downasaur on a mobile/touch device?

Arqade Asked on August 20, 2020

I am aware that when playing with a keyboard it is possible to crouch using the DOWN arrow key, however I can’t find a way to crouch when playing on mobile/touch device.

Actions I have tried without success:

  • tap with two-fingers
  • tap with three-fingers
  • swiping down
  • press and hold
  • double tap
  • tapping in various positions (ie nearer the bottom of the screen, nearer the right-hand side, etc)

Does anyone know if it’s possible?

One Answer

On mobile, it's not possible to "duck" as the source calls it because it fires the event based off of what key code was pressed down. On a mobile keyboard, you don't have the ability to press key code 40, which is the down arrow because most (if not all?) mobile keyboards on devices do not have a down arrow key!

The source for the "Downasaur" can be found in a Javascript file called offline.js. It is publicly available through the Chromium GitHub repository.

If you weren't on mobile, the actual code that makes the dinosaur duck starts on line 712:

.
.
.
else if (this.playing && Runner.keycodes.DUCK[e.keyCode]) {
      e.preventDefault();
      if (this.tRex.jumping) {
        // Speed drop, activated only when jump key is not pressed.
        this.tRex.setSpeedDrop();
      } else if (!this.tRex.jumping && !this.tRex.ducking) {
        // Duck.
        this.tRex.setDuck(true);
      }
    }

Note how it makes use of keyCodes. The down arrow key code is 40 which on a mobile device is not possible to "press" since for one the keyboard isn't available when playing this game on a mobile device and two there is no down arrow on a mobile keyboard - not any that I've seen!

The good news is, the game can tell if you are on a mobile device or not and if you are, it automatically adjusts the Y Coordinates that obstacles are allowed to spawn at. The only obstacle that can even spawn at a height where ducking can be useful when playing the game on a computer is the pterodactyl - see yPosMobile below:

 .
 .
 .
 type: 'PTERODACTYL',
    width: 46,
    height: 40,
    yPos: [ 100, 75, 50 ], // Variable height.
    yPosMobile: [ 100, 50 ], // Variable height mobile.
    multipleSpeed: 999,  

I'm willing to bet (although I haven't tried for myself) that if you connect a keyboard to your device via Bluetooth or some other means, that the mobile game would still let you duck using the connected keyboard. There doesn't seem to be anything in the source that indicates this otherwise, but maybe I missed it. Take a look for yourself!

Correct answer by Timmy Jim on August 20, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP