How do touch controls work in a browser game?
A browser game on a phone has no keys and no mouse to read, so it draws its own controls on the screen and reads your fingers on them: a stick for one thumb to walk with, and buttons for the other to attack and dash. In Boomer Brawl the move stick follows your left thumb wherever it lands, and a red button at the bottom right hits the nearest enemy when you tap it or fires where you aim when you drag it and let go.
How a browser game reads your fingers
The browser tells the page when a finger lands on the screen, when it moves, and when it lifts. MDN Web Docs, Mobile touch controls lists these as the touch events a game listens for.
Each finger is followed on its own, so two thumbs can do two things at once. MDN Web Docs, Mobile touch controls describes its own example game that is steered with two fingers: the left one moves the ship and the right one controls its gun.
MDN Web Docs, Mobile touch controls also notes that a game has to stop the browser's own reaction to a drag, or the drag would move the page about and show its scroll bars. So a drag on the game steers, it never scrolls.
The stick and the buttons are pictures the game draws, not part of the phone: they only work in a game built to read touch.
A move stick that follows your thumb
In the game the move stick waits, faint, near the bottom left corner.
Put a finger down anywhere outside the other controls and the stick jumps under it: that finger walks, the way you push it from where it landed. Push past the stick's edge and it slides along after your thumb, so a turn reads from where your thumb is now rather than where it first landed.
Let go and the stick goes back to its corner. A switch in Options, Stick stays put, keeps it in its corner, and then only a finger on the stick walks.
While you are not aiming, your character faces the way you walk.
Tap, hold or drag to attack
The red button at the bottom right attacks, and a tap, a hold and a drag each do something different.
A tap hits the nearest enemy within your weapon's reach and turns you to face them. With nobody in reach, you strike the way you face.
Hold your thumb still on it and you keep hitting the nearest enemy at your weapon's own pace.
Drag it out to aim: a shape on the floor shows what your weapon reaches, and it fires when you let go. Bring your thumb back to the middle before you let go and nothing fires. The two weapons that keep firing, the SMG and the flamethrower, pour for as long as you hold the aim and stop when you let go.
The dash and aim assist
Beside the red button sit the yellow arrows, which dash. A tap dashes the way you walk, or the way you face when you stand still.
Drag the yellow arrows and an arrow on the floor shows the way, with a gold ring round your character: let go and you dash there, or bring your thumb back to the middle to call it off. After a dash the arrows darken while a gold ring fills round them, and they are ready again when it closes.
Aim assist turns a dragged aim onto an enemy close to where you point, within your weapon's reach, so a thumb does not have to be exact. It never picks anyone behind a wall, hidden under a tree or just back from a fall, and Options turns it off.
On a gamepad the same idea is push out to fire: the right stick aims, and pushed all the way to its rim it attacks. Can you use a controller in a browser game? has the rest.
When the controls vanish or will not respond
The touch controls hide as soon as you press a key, click a mouse or use a gamepad, and the next touch on the screen shows them again. In a browser on a computer they show at the start of a round until the first click or key.
On a phone or a tablet held upright the game asks you to turn it sideways, so hold it sideways first.
The red button keeps the finger that landed on it, even when the finger slides off it, until you lift it. A slow or hot phone answers late: why does a browser game lag on a phone? has what to check.
How Boomer Brawl does it
Boomer Brawl is a free top-down arena brawler in the browser that plays by touch on a phone or a tablet held sideways, with nothing to install.
The move stick sits at the bottom left, the red button and the yellow arrows at the bottom right, and the scoreboard and pause buttons at the top.
Everyone in an online match plays on their own device, by touch, keyboard or gamepad, in the same fight. How to play in the browser: controls and touch has every control for touch, keyboard and gamepad.
Boomer Brawl plays by touch in the browser with nothing to install: play a round.
Common questions
Can you play a browser game on a phone without a controller?
Yes. When the game is built for touch, it draws its own stick and buttons on the screen and reads your fingers on them.
Does dragging on a browser game scroll the page?
No. On a game built for touch, it stops the browser's own reaction to a drag on it, so the drag steers instead.
Why did the touch controls disappear?
A key, a mouse click or a gamepad hid them, since the game takes it that you switched; touch the screen and they come back.
Can you turn off aim assist on a phone?
Yes. Options has a switch for it, and then a dragged aim goes exactly where your thumb points.
Sources
- MDN Web Docs, Mobile touch controls, checked on
Keep reading
- Guides to playing games in the browserPlain answers to what people ask about games in the browser: saves, data, lag on a phone, controllers, touch, join codes, hosting and friends far away.
- How to play in the browser: controls and touchA quick fighting game in the browser: move, aim, attack and dash by keyboard, gamepad or touch, grab weapons and health packs, hide, and win the round.
- Can you use a controller in a browser game?Yes: a browser reads a paired gamepad once you press a button with the game in front. How to pair Xbox and PlayStation pads, and what each stick does.
- Why does a browser game lag on a phone?A browser game lags on a phone when its tab is hidden, Low Power Mode or Battery Saver is on, the phone runs hot or the browser is old. What to check.
