How this build is played.
An application used to ask kIsWeb and mean three different things by
it, which was true while there were two builds and stopped being true the
day a phone appeared. Here rather than in one game because the second game
wanted the same three answers, and two copies of a platform list is two
copies that disagree the day a platform is added. Every one of those questions is asked here instead,
under the name of the thing it is actually asking about:
- whether there is a pointer to capture, which decides the pause and whether a press is the game's to spend;
- whether the camera comes from a captured mouse or from a drag;
- whether the player has fingers rather than a keyboard.
kIsWeb is not asked at all any more, and that is the change worth
reading. It was the wrong question twice over. A browser on a desktop can
capture a pointer — it has had requestPointerLock for a decade, and the web
build of a first-person game was being dragged around like a phone because
this file said otherwise. A browser on a phone has fingers, and the same line
hid the on-screen stick from every player who opened a demo on one, leaving
them a game with no controls at all.
So each question is now asked of the thing that knows the answer: the pointer capture backend for the first, the platform for the second.
A flutter test reports itself as Android, which is flutter_test's own
default, so anything here answers as the touch build inside a test. That is
harmless today because nothing mounts the game in a test, and it is a trap
worth knowing about the day something does: pass the answer in rather than
reading it, as TitleCard does.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited