Skip to content

Add arrow display on mobile when earth is selected - #17

Open
wannerdev wants to merge 1 commit into
mainfrom
feature/mobile-arrow-display
Open

Add arrow display on mobile when earth is selected#17
wannerdev wants to merge 1 commit into
mainfrom
feature/mobile-arrow-display

Conversation

@wannerdev

Copy link
Copy Markdown
Owner

Description

Adds a directional arrow indicator on mobile devices that shows the launch direction from Earth to the touch position, similar to the mouse cursor arrow on desktop.

Changes

  • Created new launch_arrow module in effects
  • Implemented draw_launch_arrow system
  • Shows orange/amber arrow from Earth (LaunchPad) to touch position
  • Only displays when launch is armed (earth is selected)
  • Arrow includes directional head (V-shaped tip)
  • Updates in real-time as finger moves across screen
  • Converts touch screen position to world coordinates
  • Integrated into effects plugin system

Visual Details

  • Color: Orange/amber (RGB: 1.0, 0.6, 0.2) with 80% opacity
  • Length: 15.0 units from Earth center
  • Arrow Head: V-shaped tip with 3.0 unit size
  • Style: Matches game's retro orange/amber theme
  • Visibility: Only when LaunchArmed is true

Behavior

  • Shows: When earth is tapped/selected (LaunchArmed = true)
  • Hides: When launch is executed or earth is deselected
  • Updates: Every frame as touch position changes
  • Direction: Points from Earth center toward touch location
  • Mobile-specific: Only responds to touch input

Benefits

  • Provides same directional feedback as desktop mouse cursor
  • Helps mobile users aim their satellite launches accurately
  • Makes launch direction clear before releasing
  • Improves mobile UX parity with desktop
  • Enhances launch precision on touch devices
  • Visual consistency with desktop experience

Technical Implementation

  • Queries LaunchArmed resource to check if earth is selected
  • Gets Earth position from LaunchPad transform
  • Reads touch input events for current finger position
  • Converts screen coordinates to world coordinates
  • Calculates direction vector and normalizes it
  • Draws arrow shaft and head using gizmos
  • Uses perpendicular vector for arrow head geometry

Desktop vs Mobile

  • Desktop: Mouse cursor shows direction naturally
  • Mobile: This arrow provides equivalent visual feedback
  • Parity: Both platforms now have clear directional indicators
  • Consistency: Same visual language across platforms

Performance

  • Lightweight: Only draws when launch is armed
  • Efficient: Uses gizmos (no sprites/meshes)
  • Minimal: Simple line rendering (3 lines total)
  • Real-time: Updates every frame for smooth tracking

Testing

  • Tap Earth on mobile device to arm launch
  • Verify orange arrow appears from Earth
  • Move finger and verify arrow follows touch position
  • Check arrow head points in correct direction
  • Release touch and verify arrow disappears
  • Confirm arrow matches game's color theme

Related Issue

Fixes: Android/Mobile Feedback - When having a mouse there is an Arrow, display this on the mobile as well when earth is selected (mobile)

- Created new launch_arrow module
- Implemented draw_launch_arrow system
- Shows orange/amber arrow from Earth to touch position
- Only displays when launch is armed (earth selected)
- Arrow includes directional head (V-shape)
- Updates in real-time as finger moves
- Helps mobile users aim their satellite launches
- Matches game's orange/amber theme
- Integrated into effects plugin system
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant