Example #1
0
void renderEnemies(App *app)
{
  int i = 0;
  for(; i < ENEMY_COUNT; i++) {
    if(app->game.board.enemies[i].alive){
		if(app->game.winner){
			app->game.board.enemies[i].body.action = ACTION_DEATH;
			app->game.board.enemies[i].body.frame += 0.3;
		}

		if(app->game.board.enemies[i].body.action != ACTION_DEATH) {
			float frame = app->game.board.enemies[i].body.frame;
			
			frame += 0.1;

			if(frame < app->enemy_frame_count * app->game.board.enemies[i].variation
			|| frame >= app->enemy_frame_count * (app->game.board.enemies[i].variation+1) ) {
				app->game.board.enemies[i].body.action = ACTION_MOVE;
				frame = app->enemy_frame_count * app->game.board.enemies[i].variation;
			}

			app->game.board.enemies[i].body.frame = frame;
		}

		renderBody(app, &app->game.board.enemies[i].body);
	}
  }
}
Example #2
0
QString reports::ReportTable::renderHTML(QWidget* widget,
    const QByteArray& encoding, const QString& title, bool includeCSS)
{

  m_encoding = encoding;

  //this render the HEAD tag and sets the correct css file
  QString html = renderHeader(title, includeCSS);

  try {
    //this method is implemented by each concrete class
    html += renderBody();
  } catch (const MyMoneyException &e) {
    kDebug(2) << "reports::ReportTable::renderHTML(): ERROR " << e.what();

    QString error = i18n("There was an error creating your report: \"%1\".\nPlease report this error to the developer's list: [email protected]", e.what());

    KMessageBox::error(widget, error, i18n("Critical Error"));

    html += "<h1>" + i18n("Unable to generate report") + "</h1><p>" + error + "</p>";
  }

  //this renders a common footer
  html += renderFooter();

  return html;
}
Example #3
0
void Player::render(SDL_Renderer *renderer)
{
	_head.render(renderer);
	renderBody(renderer);
}
Example #4
0
/*!\brief Nur den HTML-Body erstellen
 *
 * \desc
 * Mit dieser Funktion wird nur der Wiki-Quelltext in HTML übersetzt, es wird kein
 * HTML-Header oder Stylesheet eingebaut.
 *
 * @param[in] Source String mit dem Wiki Quelltext
 * @return Die Funktion gibt einen String mit der HTML-Übersetzung zurück
 */
String WikiParser::renderBody(const String &Source)
{
	String res;
	renderBody(Source,res);
	return res;
}