frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Game: Add minigame elements in SA game

Open Eola-Z opened this issue 2 years ago • 5 comments

Gameplay Additions:

  • Created a new GameTable object that can be used to create puzzles inside the SA game. The basic template is a rectangular grid of buttons that store its own state and can modify the state of itself (as well as other buttons inside the table).
  • As a proof of concept, we have created 3 simple puzzles that are based on GameTable:
  1. A simple light switch puzzle.
  2. A combination lock puzzle
  3. A rotating pipe puzzle
  • Added InputGameElement class which encapsulates an HTML input element and a button as a Phaser game object. Developers can place and position an input box and button over the and retrieve input from them. The aim is to improve personalization and customization in the SA game by allowing players to name themselves, items, pets, etc. The game can then refer to these names in the scripts, creating a more personalized gaming experience.

Future work/Improvements:

  • Pipeline to return the value in the input box to the parser and store it as a state variable for the player, allowing the engine to use that variable for multiple purposes.
  • Create new user interface elements based on the InputGameElement template to expand the capabilities of the game frontend.
  • Enable the parser to create instances of puzzles and InputGameElements so that story writers can dictate where to add puzzles and input requests to the SA game.
  • Remove redundant constants (since switching from volume buttons to sliders, some constants in the files are no longer needed and can be safely removed).
  • Once the parser can create puzzles and InputGameElements, we will update the story writer's guide with information on how they can generate such game objects in the text files.

How to test

Currently, the game objects cannot be added to the game without being hardcoded using an editor. However, in any Source Academy scene (Phaser), you should be able to instantiate these game objects and add them to the scene itself. Documentation and instructions on how to construct an instance of these game objects can be found the .ts files.

Created by

Gupta Raman & Edwin Zheng

Eola-Z avatar Apr 11 '23 15:04 Eola-Z