embraceltd / waterlily Goto Github PK
View Code? Open in Web Editor NEWA text adventure
Home Page: https://embraceltd.github.io/Waterlily/
A text adventure
Home Page: https://embraceltd.github.io/Waterlily/
The prompt should show the number of turns, like so:
1> get hammer
Nothing happens if you break the bottle with the hammer. It should blow up!
Implement moving southeast, southwest, northeast, northwest, up, down
A max number of items that the player can carry should be defined in the config. Setting it to -1 enables the player to carry an infinite number of items.
In order to create a truly customizable game engine, the available commands (TAKE, DROP etc) should be defined in the config rather than being hard coded. This requires the creation of classes for commands, conditions, actions and operations.
The idea is that a command should have a target action.
An action should have a list of conditions that must be fulfilled in order to perform the action.
The action should also have a list of operations. If all conditions are met, the operations are executed.
A condition typically consists of getting a property value of an item and comparing it to a certain value. If not equal, a message is output and execution of the action returns false. I.e. 'You don't have the hammer'.
An operation typically consists of setting a property of an item to a new value.
The completed action should output a description of what was done, i.e. 'You take the hammer'.
Example
Command: take hammer
The command is interpreted as a verb, 'take', and an object, 'hammer'.
The verb 'take' is defined in the config and associated with an action.
The action has a list of conditions for the object to be taken by the player.
Item.carry == false (that you don't have it already)
Item.location == userLocation (that the hammer is present)
Item.canTake == true (that it can be picked up unlike, let's say, a car)
It has a list of operations:
The action has a CompletedMessage:
A command object can have a list of synonyms (GET, TAKE, PICK, SNATCH, GRAB) etc.
Conclusion
A command object contains:
a list of command (verb) synonyms
a named target action
An action object contains:
a name for retrieval
a list of conditions
a list of operations
a CompletedMessage
A condition object contains:
a condition definition, a string that defines what item, what property, what value and what comparison operator to use.
a FailureMessage
An operation object contains
Locations should have generic properties just like items. The can even share the same entity.
When you load a game the turn count is not reset.
These classes should derive from Item and add properties that are specific for them.
Let triggerActions only be triggered by trig instruction. Remove option to trigger actions by conditions. TriggerActions can be triggered by Actions and other triggerActions.
Syntax: trig:{triggerActionName}
Example: "trig:takeBottleExplosionAction"
Configurations should be validated after load
People, animals and moving objects (like trains) could have a pathway, defined as an array of location numbers, which they move along, one step for every new turn. A pathway could optionally be started by triggering an event, otherwise it starts when the game starts.
A turn is defined as the events between two player commands. The 'wait' command was created to prepare for the concept of turns (in that it progresses one turn without doing anything).
In order to spice up the game, there should be a time limit of 1 minute after a player issues a command, after which the game engine sends a 'wait' command and forces a new turn.
If there is a pending detonation action, the player would be killed if he/she just sits idle without getting out of the location.
It should be possible for the player to save the game and play later.
Put the games intro text in the config to allow for customization, and put less focus on the engine's intro text.
Output a mention of the engine in the "header box", don't include it in the config. It shouldn't be possible to edit out.
Example: A config setting like:
"intro" : "DEERWOOD 1.0 BY EMBRACE LTD."
would output
Example:
waterlily testgame
Would start Waterlily and load testgame.json.
Try to define conditions and special events as config properties instead of hard-coding them. This will require new objects and new properties in existing objects.
All properties on items should be refactored into a dictionary so that game creators can customize their own properties.
Let boolean properties have a default value of false, and specify them only in the config when they are true.
If unset, examinedTitle should be set to title, and examinedShortDescription to shortDescription, so that they don't have to be in the config file if they do not differ from title and shortDescription.
A pending action could have a number of turns which have to pass before the action happens. Now it's just one.
Let location destination properties (destNorth etc.) have a default value of -1 (the "null place") and specify them only in the config when they are larger than 0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.