-
Notifications
You must be signed in to change notification settings - Fork 0
VnScene class and auxillaries #1
Description
The task is to well-architect the part of the game as it relates to orchestrating scenes of a VN, by focusing on creating a VnScene class.
Class Design:
- The
VnSceneclass may have a constructor into which providers are injected, but it's OK to leave this part of the VnScene API underspecified (i.e. consider hardcoding the game objects that the vnscene manages, rather than worry about injecting them) for the experiment. - The
VnSceneclass should implement anUpdatable<T extends SpecificType>interface, so that it has an.update(message: T)method. It then acts based on the message received, as well as perhaps delegates messages (with potential transformation) to its member objects (e.g. dialog object, stage object (manipulating character sprites on the screen, etc.). - The
SpecificTypeabove should be chosen to include (for now, and for this experiment), raw key and mouse state and input, as well as game tick information. In a more elaborate architecture we may revise this to receive more semantic messages.
Demo implementation:
In addition to the above, also implement some simple input-dependent behavior upon update (and possibly creation) in the vnscene's subobjects (don't have to actually represent dialog/stage/etc., just some basic feedback). Instantiate a vnscene object as a member of the Game singleton during game loading, and hook the vnscene's update to be called by the game's update method. Then verify that the game ticks and user input get propagated down to the vnscene's subobjects by observing their feedback.
Further details:
When completed, a working Phaser3 game instance should exist in a top-level folder vnscene that contains the VnScene class in vnscene.ts, an Updatable interface in types/updatable.ts (under appropriate folder hierarchies if desired or necessary), and various dummy classes that will be instantiated into dummy member objects of a vnscene object.