+ void animateLoss(int x, int y, int size, String message) {
+ int startX;
+ if (x < 1920/2) { startX = 1920; }
+ else if (x > 1920/2) { startX = 1920; }
+ else { startX = 1920 * random.nextInt(2); }
+
+ Text msg = graphicEntityModule.createText(message)
+ .setX(startX)
+ .setY(1080)
+ .setAnchorX(0.5)
+ .setAnchorY(0.5)
+ .setScaleX(3*random.nextDouble() - 1)
+ .setScaleY(3*random.nextDouble() - 1)
+ .setSkewX(2*random.nextDouble() - 1)
+ .setSkewY(2*random.nextDouble() - 1)
+ .setRotation(4*Math.PI * (1 + random.nextDouble())
+ * (random.nextInt(2) == 0 ? 1 : -1))
+ .setFontSize(0)
+ .setStrokeColor(0xff7f7f)
+ .setFillColor(0xff7f7f)
+ .setFontWeight(Text.FontWeight.BOLD)
+ .setTextAlign(TextBasedEntity.TextAlign.CENTER);
+ graphicEntityModule.commitEntityState(0.25, msg);
+ Curve curve = Curve.ELASTIC;
+ msg.setX(x, Curve.EASE_OUT)
+ .setY(y, Curve.ELASTIC)
+ .setScaleX(1, curve)
+ .setScaleY(1, curve)
+ .setSkewX(0, curve)
+ .setSkewY(0, curve)
+ .setRotation(2*Math.PI * (random.nextDouble() - 0.5), Curve.LINEAR)
+ .setFontSize(size, curve);
+ }
+