MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / onTouchBegan

Method onTouchBegan

Source/MenuGameLayer.cpp:186–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184//}
185
186bool MenuGameLayer::onTouchBegan(ax::Touch* touch, ax::Event* event)
187{
188 auto touchPos = touch->getLocation();
189 ax::Rect hitbox = player->getBoundingBox();
190
191 //hitbox probably needs to be adjusted because it feels a bit off atm
192 //constexpr float hitboxMult = 2.5f;
193 //hitbox.origin -= {hitboxMult, hitboxMult};
194 //hitbox.size += {hitboxMult * 2, hitboxMult * 2};
195
196 if(hitbox.containsPoint(touchPos)) {
197 this->resetPlayer(true);
198 }
199 return true;
200}

Callers

nothing calls this directly

Calls 1

resetPlayerMethod · 0.95

Tested by

no test coverage detected