-
Notifications
You must be signed in to change notification settings - Fork 18
HTML
All web pages use a mark-up language called HTML, which stands for HyperText Mark-up Language (or XML or XHTML, but they are almost the same).
HTML is a mark-up language, which means it has codes within the text telling the browser how to display the text. Here is an example:
Here is some text with one word in <b>bold</b>.
The angle brackets, < and > are used to flag that this is mark up. The <b> is the start tag, and </b> the end tag, and as you can see the different is the /. The tag name is "b", and has to be the same in the start tag and the end tag. The "b" tag name tells the browser this text should be in bold.
The bit between the tags, "bold", is called the content, and the entire thing, tags and content, is called an element.
Elements have to be nested; they cannot overlap. This example uses the "i" tag to put some text in italics. The first is badly formed because the bold and italic overlap - the bold starts before the italic, but then ends before it too. The second line is good, because the bold element is nested within the italic.
Here is some text with one word in <b><i>bold</b> and five in italic</i>.
Here is some text with one word in <i><b>bold</b> and five in italic</i>.
Sometimes an element will have attributes. The "div" tag name indicates a division, and you often want to give a division an id so you can do access it with JavaScript. Here, then, is a "div" element with an attribute set. Note that you always need double quotes either side of the value, even if the value is a number.
<div id="example">Here is some text with one word in <i><b>bold</b> and five in italic</i>.</div>
Sometimes an element has no contents, and there is a short hand for that. The "img" tag name indicates an image. It has the "src" attribute which gives the image filename, but has no contents. There is only one tag, but note the /, which tells the browser there is no end tag. The is called an empty element.
<img src="house.png" />
The "script" tag name is used to add JavaScript, which could be the contents of the element, but could be from file. For reasons I do not understand the above form does not work for this tag name, and you need an end tag.
<script src="clock.js"></script>
There are certain elements that browsers expect to be present in specific places.
<!DOCTYPE html>
<html lang="en">
<head>
<title>A Test Page</title>
</head>
<body>
My contents
</body>
</html>
The first line is not really HTML, but is rather a declaration telling the browser that the rest of document is HTML. The root element of an HTML document is the "html" element. Within that element there are two other elements, "head" and "body". The "head" element can contain various things that do not appear on the page, such as the title, meta-data and references to other files. What you see on the page goes into the "body" element.
Certain characters have a special meaning in HTML, the most obvious being <. When the browser hits that character, it will assume what follows is a tag. So what do you do it you want a < to be displayed? A character entity. These start with an ampersand and end with a semi-colon. In between you can have a two to five letter code or a number.
< <
> >
& &
" "
' '
¢ ¢
£ £
¥ ¥
€ €
© ©
® ®
™ ™
µ µ
° °
Also worth a mention is , which is a non-breaking space (so hard to show on the table above). If you want two or more spaces together, use this.
Tutorial
- First steps
- Rooms and Exits
- Items
- Templates
- Items and rooms again
- More items
- Locks
- Commands
- Complex mechanisms
- Uploading
QuestJS Basics
- General
- Settings
- Attributes for items
- Attributes for rooms
- Attributes for exits
- Naming Items and Rooms
- Restrictions, Messages and Reactions
- Creating objects on the fly
- String Functions
- Random Functions
- Array/List Functions
- The
respondfunction - Other Functions
The Text Processor
Commands
- Introduction
- Basic commands (from the tutorial)
- Complex commands
- Example of creating a command (implementing SHOOT GUN AT HENRY)
- More on commands
- Shortcut for commands
- Modifying existing commands
- Custom parser types
- Note on command results
- Meta-Commands
- Neutral language (including alternatives to "you")
- The parser
- Command matching
- Vari-verbs (for verbs that are almost synonyms)
Templates for Items
- Introduction
- Takeable
- Openable
- Container and surface
- Locks and keys
- Wearable
- Furniture
- Button and Switch
- Readable
- Edible
- Vessel (handling liquids)
- Components
- Countable
- Consultable
- Rope
- Construction
- Backscene (walls, etc.)
- Merchandise (including how to create a shop)
- Shiftable (can be pushed from one room to another)
See also:
- Custom templates (and alternatives)
Handing NPCs
- Introduction
- Attributes
- Allowing the player to give commands
- Conversations
- Simple TALK TO
- SAY
- ASK and TELL
- Dynamic conversations with TALK TO
- TALK and DISCUSS
- Following an agenda
- Reactions
- Giving
- Followers
- Visibility
- Changing the player point-of-view
The User Experience (UI)
The main screen
- Basics
- Printing Text Functions
- Special Text Effects
- Output effects (including pausing)
- Hyperlinks
- User Input
The Side Panes
Multi-media (sounds, images, maps, etc.)
- Images
- Sounds
- Youtube Video (Contribution by KV)
- Adding a map
- Node-based maps
- Image-based maps
- Hex maps
- Adding a playing board
- Roulette!... in a grid
Dialogue boxes
- Character Creation
- Other example dialogs [See also "User Input"]
Other Elements
- Toolbar (status bar across the top)
- Custom UI Elements
Role-playing Games
- Introduction
- Getting started
- Items
- Characters (and Monsters!)
- Spawning Monsters and Items)
- Systema Naturae
- Who, When and How NPCs Attack
- Attributes for characters
- Attacking and guarding
- Communicating monsters
- Skills and Spells
- Limiting Magic
- Effects
- The Attack Object
- [Extra utility functions](https://github.com/ThePix/QuestJS/wiki/RPG-Library-%E2%80%90-Extra Functions)
- Randomly Generated Dungeon
- Quests for Quest
- User Interface
Web Basics
- HTML (the basic elements of a web page)
- CSS (how to style web pages)
- SVG (scalable vector graphics)
- Colours
- JavaScript
- Regular Expressions
How-to
Time
- Events (and Turnscripts)
- Date and Time (including custom calendars)
- Timed Events (i.e., real time, not game time)
Items
- Phone a Friend
- Using the USE verb
- Display Verbs
- Change Listeners
- Ensembles (grouping items)
- How to spit
Locations
- Large, open areas
- Region,s with sky, walls, etc.
- Dynamic Room Descriptions
- Transit system (lifts/elevators, buses, trains, simple vehicles)
- Rooms split into multiple locations
- Create rooms on the fly
- Handling weather
Exits
- Alternative Directions (eg, port and starboard)
- Destinations, Not Directions
Meta
- Customise Help
- Provide hints
- Include Achievements
- Add comments to your code
-
End The Game (
io.finish)
Meta: About The Whole Game
- Translate from Quest 5
- Authoring Several Games at Once
- Chaining Several Games Together
- Competition Entry
- Walk-throughs
- Unit testing
- Debugging (trouble-shooting)
Releasing Your Game
Reference
- The Language File
- List of settings
- Scope
- The Output Queue
- Security
- Implementation notes (initialisation order, data structures)
- Files
- Code guidelines
- Save/load
- UNDO
- The editor
- The Cloak of Darkness
- Versions
- Quest 6 or QuestJS
- The other Folders
- Choose your own adventure