Table of Contents
To add the sample code, first double-click the Hero Placeholder and navigate to their programming.Programmable
component. Navigate through the component's tree:
- programming.Programmable
- programmableMethods
- plan
- languages
- This is where the alternate language sample code will be filled in. Python is the important one!
- source
- This is the Javascript sample code.
- i18n
- Add this field after creating comments so Diplomats can add translations.
- Comments
- This is where replacement comments will go.
- languages
- plan
- programmableMethods
When filling in the sample code for a level, there are a few neat tips to keep in mind.
- Comments are always given a space between their commenting symbol and the comment itself.
// This is a comment!
# This is a Python comment.
-- <%= commentDeclaration %>
Hint Arrow
If the level is attempting to teach a concept or guide players through writing code, it is important to direct the player's attention to where the code should be inserted. In each blank area below a comment, an arrow will display.
- Note: CodeCombat allows for one block of comments at the start of the sample code before adding an arrow below all comments with an empty space below them.
Change Arrow
There are some levels where the player is given a hint in the form of pre-existing code. Often times this code is wrong, or, generally should be changed or removed if the user is to progress. Use the ∆
(delta) symbol on the same line as the code and a hint arrow will point to the line until it has been changed.
i18n Strings
Simply writing your sample code doesn't provide the Diplomats with access to the strings for translation. You will need to use a special string replacement structure to pull these comments out for translation.
- Home
- Archmage Home
- Artisan Home
- Adventurer Home
- Scribe Home
- Diplomat Home
- Ambassador Home
- Archmage General
- Mission statement
- Coco Models
- Coding Guidelines
- Cookbook
- File system
- JSON Schema
- Technical overview
- Testing
- Third party software and services
- Artisan General
- Building A Level
- Coding Guidelines for Artisans
- Editing Thang Components
- Important Artisan Concepts
- Keyboard Shortcuts
- Artisan How-To Index
- Adventurer General
- Scribe General
- Diplomat General
- i18n
- i18n Glossary nb
- i18n Glossary ru
- i18n Glossary es-419
- Ambassador General
- Dev Setup
- Dev Setup: Linux
- Dev Setup: Windows
- Dev Setup: Mac
- Dev Setup: Vagrant
- Dev Setup: Issues
- Game Engine
- Component
- Multiplayer
- Surface
- System
- Thang
- Thang Component System
- Tome
- World
- Artisan Tabs
- Components And Systems
- Scripts
- Settings
- Thangs
- Other
- Aether
- Client models
- Developer organization
- Educational Standards
- Events, subscriptions, shortcuts
- Chat Room
- Chat Room Rules
- Permissions
- Project Ideas List
- Treema
- Versioning
- Views
CodeCombat | Home | Blog | Forum | Teachers | Legal | Contribute