-
Notifications
You must be signed in to change notification settings - Fork 5
Tasks
jcechak edited this page Oct 19, 2015
·
19 revisions
Tasks are defined in tasks/fixtures/tasks.xml.
Changes can be transferred from the fixture to the DB using make db-load-data command.
You can preview tasks on http://localhost:8000/task-preview url (after calling ./manage.py gruntserver).
<?xml version="1.0" encoding="utf-8"?>
<django-objects version="1.0">
<!-- definition of one task -->
<object model="practice.taskmodel">
<field name="maze_settings">
// maze settings in JSON
</field>
<field name="workspace_settings">
// workspace settings in JSON
</field>
</object>
<!-- definition of another task -->
<object model="practice.taskmodel">
<field name="maze_settings">
// maze settings in JSON
</field>
<field name="workspace_settings">
// workspace settings in JSON
</field>
</object>
<!-- ... -->
</django-objects>{
"grid": "2D array of square types: 0 = free space, 1 = wall, 2 = goal",
"hero": {
"position": "[x, y], indexed from zero",
"direction": "0 = east, 1 = north, 2 = west, 3 = south"
}
}Example:
{
"grid": [
[1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 2, 1, 1, 1],
[1, 1, 1, 1, 0, 1, 1, 1],
[1, 0, 0, 0, 0, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1]],
"hero": {
"position": [1, 4],
"direction": 0
}
}{
"toolbox": "list of blocks/categories names"
}Example:
{
"toolbox": ["maze_move_forward", "maze_turn_left", "maze_turn_right"]
}- colored fields, overwriting colors of the fields by blocks
- multiple goals
- tokens placed around the maze - you have to catch them all before go to the goal
- concept of enemies and guns