Characters
These are special commands created specifically for your interactive story app. They control characters, backgrounds, and other visual elements.
Show/Update Character
Displays a character sprite on the screen with a specific emotion and position.
Syntax:
<<set_char "[CharacterName]" "emotion:[Emotion];pos:[Position];face:[Direction]">>
Parameters:
| Parameter | Type | Options | Description |
|---|---|---|---|
| CharacterName | text | any character name | The character you want to show |
| Emotion | text | any emotion state | What emotion the character displays (like "happy", "sad", "angry") |
| Position | text | "left", "right", or "center" | Which side of the screen the character appears on |
| Direction | text | "left" or "right" | Which direction the character is facing |
How it finds the sprite: The command automatically looks for an image named charactername_emotion (all lowercase). For example, <<show_char "Alice" "emotion:smile;pos:left;face:right">> will change to the sprite named alice_smile.
Examples:
<<set_char "Alice" "emotion:happy;pos:left;face:right">>
Alice: Good morning! How are you today?
Shows Alice on the left side of the screen using the alice_happy sprite, facing toward the right.
<<set_char "Bob" "emotion:angry;pos:right;face:left">>
Bob: I can't believe you did that!
Shows Bob on the right side using the bob_angry sprite, facing toward the left.
<<set_char "Sarah" "emotion:nervous;pos:left;face:right">>
<<set_char "Marcus" "emotion:smile;pos:right;face:left">>
Sarah: Um... I have something to tell you.
Marcus: What is it?
Shows both characters on opposite sides: sarah_nervous on the left and marcus_smile on the right, facing each other.
Hide Character
Removes a character from the screen.
Syntax:
<<hide_char "[CharacterName]">>
Parameters:
| Parameter | Type | Description |
|---|---|---|
| CharacterName | text | The character you want to remove from the scene |
Examples:
<<show_char "Alice" "happy" "pos:left;face:right">>
Alice: I have to go now. See you later!
<<hide_char "Alice">>
Narrator: Alice left the room.
Alice appears on screen, says goodbye, then disappears.
<<show_char "Tom" "neutral" "pos:left;face:right">>
<<show_char "Jerry" "smile" "pos:right;face:left">>
Tom: I'm heading out.
<<hide_char "Tom">>
Jerry: Finally, some peace and quiet!
Tom leaves the conversation while Jerry stays on screen.
Image suggestion: Simple diagram showing a character sprite fading out or disappearing from the game screen.