CoffeeTime

Retro arcade style game built specifically for mobile

Inspired by the classics, features for mobile

Grab and deliver coffee to co-workers to get points. Stay away from your bosses (enemies) to avoid getting fired.

Enhanced Input Interactions

The click detection system enables cross-platform interaction by supporting both touchscreen and mouse inputs through Unity’s Enhanced Input framework. When a click or tap occurs, the input source is automatically identified and converted from screen coordinates to world space, allowing precise 2D collision checks within the game environment. This method ensures consistent behavior across PC and mobile devices without separate input logic. Upon detecting an enemy object, the system triggers a contextual response — consuming the player’s coffee item, respawning it, and temporarily stalling the enemy to create strategic gameplay flow.

private void OnClick(InputAction.CallbackContext ctx)
    {
        var device = ctx.control.device;
        Vector2 screenPos;
        if (device is Touchscreen ts)
        {
            screenPos = ts.primaryTouch.position.ReadValue();
        }
        else if (device is Mouse m)
        {
            screenPos = m.position.ReadValue();
        }
        else
        {
            screenPos = actions.UI.Point.ReadValue<Vector2>();
        }
        Vector3 world3 = cam.ScreenToWorldPoint(new Vector3(screenPos.x, screenPos.y, 0f));
        Vector2 worldPos = new Vector2(world3.x, world3.y);
        Collider2D col = Physics2D.OverlapPoint(worldPos, enemyLayer);
        Debug.Log(worldPos);
        if (col == null) return;
        Debug.Log("hit");

        EnemyController enemy = col.GetComponent<EnemyController>();
        if (enemy == null) return;

        if (player != null && player.holdingCoffee)
        {
            player.UseCoffee();
            spawnController.RespawnCoffee();
            enemy.Stall(stallSeconds

  void Start()
    {
        _movement = GetComponent<Movement>();
        gameObject.GetComponent<Rigidbody2D>().freezeRotation = true;
        initPosition = transform.position;

        if (UnityEngine.InputSystem.Gyroscope.current != null)
        {
            InputSystem.EnableDevice(UnityEngine.InputSystem.Gyroscope.current);
        }
        if (AttitudeSensor.current != null)
        {
            InputSystem.EnableDevice(AttitudeSensor.current);
        }

        if (GravitySensor.current != null)
        {
            InputSystem.EnableDevice(GravitySensor.current);
        }
    }

    // Update is called once per frame
    void Update()
    {
        Vector2 moveInput = action.Player.Move.ReadValue<Vector2>();
        Vector3 gyroVector = action.Player.Gyroscope.ReadValue<Vector3>() * scale;
        gyroVector = gyroVector * verticalScale;
        _movement.SetDirection((Vector2)gyroVector - (Vector2)calibrationOffset + moveInput

Mobile Features in Retro Games

This feature creatively integrates mobile gyroscope input into a retro arcade-style gameplay system, blending classic mechanics with modern device capabilities. By reading real-time gyro data, the player’s movement or aim responds to physical device tilt, introducing a tactile layer of control that goes beyond traditional button or joystick input. The system dynamically maps rotation data to in-game actions, maintaining the fast, responsive feel of old-school arcade games while adding a fresh, immersive twist. This fusion of nostalgic design and contemporary mobile technology enhances player engagement and redefines how retro games can feel on modern platforms.