function p.__get_is_solid() return false end
function p.__get_tex() return "" end

function p.__main()
    set_default_block("e")

    set_pos(10,7,0,"s")
    local msg_str = "Read the file tut2_movement.lua "
        .. "to understand how movement works. "
        .. "Pressing and releasing various keys causes "
        .. "\"^x00ff00game_input^!\" commands to be executed "
        .. "(as specified by the file ^x00ff00binds.txt^!). "
        .. "The game_input command is processed in the file "
        .. "^x00ff00top.lua^! by \"^x00ff00top.game_input^!\". "
        .. "That function sees if the input string starts "
        .. "with \"move\", and if so tut2_movement.input is called "
        .. "(and that function sets environment variables). "
    h.txt(10,7,4,msg_str)

    msg_str = "The function ^x00ff00top.update_discrete^! "
        .. "is called by the engine every 0.04 seconds, and "
        .. "that function calls tut2_movement.update_discrete. "
        .. "That second function creates a translation vector "
        .. "that we would like to translate the player's "
        .. "position by, and then the engine performs the "
        .. "translation as best possible, "
        .. "colliding the player against the world. "
        .. "We tell the engine the translation vector "
        .. "by calling the lua function "
        .. "^x00ff00ga_move_set_desired_travel^!. "
    h.txt(10,7,2,msg_str)

    --Stairs
    msg_str = "The function ^x00ff00ga_move_get_on_sure_footing^! "
        .. "is provided by the engine. "
        .. "Notice how it is called in "
        .. "tut2_movement.update_discrete.\n\n"
        .. "The \"on sure footing\" function tells you "
        .. "when the bottom of the player is just above "
        .. "the up surface of a cube (more or less). "
        .. "The purpose of this function is so you can "
        .. "write lua code for movement such that\n\n"
        .. "1) jumping is only allowed when on sure footing,\n"
        .. "2) planar (xy) acceleration is greater when on sure footing,\n"
        .. "3) planar (xy) drag is greater when on sure footing.\n\n"
        .. "The function has been designed so that going up stairs is "
        .. "less tedious. Try going up these stairs now (space = jump). "
    h.txt(1,1,3,msg_str)
    set_pos(0,1,0,"s")
    set_pos(0,2,1,"s")
    set_pos(0,3,2,"s")
    set_pos(0,4,3,"s")
    set_pos(0,5,4,"s")
    set_pos(0,6,5,"s")
    set_pos(0,7,6,"s")
    set_pos(0,8,7,"s")
    set_pos(0,9,8,"s")
    set_pos(0,10,9,"s")
    set_pos(0,11,10,"s")
    set_pos(0,12,11,"s")
    set_pos(0,13,12,"s")

    --Ledge.
    set_pos(1,13,12,"s")
    set_pos(2,13,12,"s")
    set_pos(3,13,12,"s")
    set_pos(4,13,12,"s")
    set_pos(5,13,12,"s")
    msg_str = "Holding down the ^x0000ffG^! key "
        .. "enables \"ledge guards\", "
        .. "which are invisible bumpers to keep you "
        .. "from falling over the edge of a cliff. "
        .. "You can still go down stairs with ledge guards enabled.\n\n"
        .. "You enable ledge guards by calling\n"
        .. "^x00ff00ga_move_set_ledge_guards^!\n"
        .. "just before calling\n"
        .. "^x00ff00ga_move_set_desired_travel^!.\n\n"
        .. "Note: we allow the player to liberally "
        .. "stick their head out over the edge of a cliff. "
        .. "However, turning off ledge guards "
        .. "after doing so may cause the player to fall. "
        .. "That is, the ledge guards have "
        .. "invisible platforms to stand on. "
    h.txt(8,13,14,msg_str)
    set_pos(5,12,12,"s")
    set_pos(5,11,12,"s")
    set_pos(5,10,12,"s")
    set_pos(5,9,12,"s")
    set_pos(5,8,12,"s")
    set_pos(5,7,12,"s")
    set_pos(5,6,12,"s")
    set_pos(5,5,12,"s")
    set_pos(5,4,12,"s")
    set_pos(5,3,12,"s")
    set_pos(5,2,12,"s")
    set_pos(5,1,12,"s")
    set_pos(5,0,12,"s")

    --Testing player height.
    set_pos(0,10,2,"s")
    set_pos(1,10,2,"s")
    set_pos(1,10,1,"s")
    set_pos(1,10,0,"s")
    msg_str = "The default package (^x00ff00xar^!) "
        .. "uses ^x00ff00fly^! mode for movement. "
        .. "The package you are in right now uses "
        .. "^x00ff00ground^! mode. "
        .. "In ground mode,\n"
        .. "1) the player is modeled as a cylinder and\n"
        .. "2) moving the mouse moves the "
        .. "player's head in a different way.\n\n"
        .. "There are also special movement functions "
        .. "availible for ground mode, "
        .. "such as ^x00ff00ga_move_get_on_sure_footing^! "
        .. "and ^x00ff00ga_move_set_ledge_guards^!. "
    h.txt(1,10,4,msg_str)

    create_rect("s", 0,14,0, 8,15,1)
    set_pos(9,15,0, "s")
end
