- const Font* font = 0;
- bool center = true;
- switch(line[0])
- {
- case ' ': font = small_font; break;
- case '\t': font = normal_font; break;
- case '-': font = heading_font; break;
- case '*': font = reference_font; break;
- case '#': font = normal_font; center = false; break;
- default:
- std::cerr << "Warning: text contains an unformated line.\n";
- font = normal_font;
- center = false;
- break;
- }
-
- if(center) {
- context.draw_text(font,
- line.substr(1, line.size()-1),
- Vector(SCREEN_WIDTH/2, SCREEN_HEIGHT + y - scroll),
- CENTER_ALLIGN, LAYER_FOREGROUND1);
- } else {
- context.draw_text(font,
- line.substr(1, line.size()-1),
- Vector(left_border, SCREEN_HEIGHT + y - scroll),
- LEFT_ALLIGN, LAYER_FOREGROUND1);
- }
-
- y += font->get_height() + ITEMS_SPACE;
+ if(main_controller->hold(Controller::UP)) {
+ speed = -defaultspeed*5;
+ } else if(main_controller->hold(Controller::DOWN)) {
+ speed = defaultspeed*5;
+ } else {
+ speed = defaultspeed;
+ }
+ if(main_controller->pressed(Controller::JUMP)
+ || main_controller->pressed(Controller::ACTION)
+ || main_controller->pressed(Controller::MENU_SELECT))
+ scroll += SCROLL;
+ if(main_controller->pressed(Controller::PAUSE_MENU))
+ done = true;
+
+ /* draw the credits */
+ context.draw_surface(background, Vector(0,0), 0);
+
+ float y = 0;
+ for(size_t i = 0; i < lines.size(); i++) {
+ const std::string& line = lines[i];
+ if(line.size() == 0) {
+ y += normal_font->get_height() + ITEMS_SPACE;
+ continue;