OpenLearningQuest / game

An educational game where players build competencies as part of an interactive story.
GNU Affero General Public License v3.0
0 stars 0 forks source link

Player Interaction System with In-Game Objects #13

Open brylie opened 1 year ago

brylie commented 1 year ago

This feature aims to establish a robust interaction system allowing players to engage with various in-game objects like doors, chests, and items necessary for progressing through the game. The system will rely on two main components: Interactable and Interactor, enhancing the game's interactivity and player engagement.

Design Goals

Key Components

  1. Interactable:

    • Node Setup: Implemented as an Area3D node with a CollisionShape3D child, defining the interaction zone.
    • Signals:
      • focused: Emitted when an interactor focuses on the object.
      • unfocused: Emitted when an interactor loses focus on the object.
      • interacted: Emitted when an interaction is performed.
    • Behavior Handling: Manages state changes and visual feedback based on interaction status.
  2. Interactor:

    • Node Setup: Also an Area3D node with a CollisionShape3D, defining the active area for initiating interactions.
    • Functionality:
      • Manages detection and interaction logic.
      • Maintains a reference to the controller object (e.g., player character).
  3. PlayerInteractor (a subclass of Interactor):

    • Specialization: Specifically tailored to the player, tracking nearby interactable objects and handling player inputs.
    • Interaction Handling:
      • Monitors player commands to interact with objects.
      • Manages focused and unfocused states based on player proximity and input.

Implementation Considerations

Development Tips

Reference Material

For further guidance and best practices in implementing interaction systems in Godot, refer to the following resources:

Action Items

Summary

This system is foundational for enabling meaningful player engagements within the game world, thereby enriching the gaming experience and supporting the game's educational objectives.