feat: add mobile touch controls

pull/232/head
Jochum van der Ploeg 3 years ago
parent 9a0f72693c
commit 84fa48f759
No known key found for this signature in database
GPG Key ID: E961B7B51589CA09

@ -90,6 +90,7 @@ class PinballGame extends Forge2DGame
final rocket = children.whereType<RocketSpriteComponent>().first; final rocket = children.whereType<RocketSpriteComponent>().first;
final bounds = rocket.topLeftPosition & rocket.size; final bounds = rocket.topLeftPosition & rocket.size;
// NOTE(wolfen): As long as Flame does not have https://github.com/flame-engine/flame/issues/1586 we need to check it at the highest level manually.
if (bounds.contains(info.eventPosition.game.toOffset())) { if (bounds.contains(info.eventPosition.game.toOffset())) {
children.whereType<Plunger>().first.pull(); children.whereType<Plunger>().first.pull();
} else { } else {

Loading…
Cancel
Save