/** Draws the boundaries of the current scene so collisions against the boundaries can be detected.
 */
void Level_1::set_boundaries()
{
    //Create pens to designate "type" of boundary
    QPen losing_boundary_pen = QPen(Qt::red);
    QPen side_boundary_pen = QPen(Qt::blue);

    //Draw top and bottom boundaries of scene
    QLineF top_line(scene->sceneRect().topLeft(), scene->sceneRect().topRight());
    QLineF bottom_line(scene->sceneRect().bottomLeft(), scene->sceneRect().bottomRight());

    scene->addLine(top_line, losing_boundary_pen);
    scene->addLine(bottom_line, losing_boundary_pen);

    //Draw left and right sides of scene
    QLineF left_line(scene->sceneRect().topLeft(), scene->sceneRect().bottomLeft());
    QLineF right_line(scene->sceneRect().topRight(), scene->sceneRect().bottomRight());

    scene->addLine(left_line, side_boundary_pen);
    scene->addLine(right_line, side_boundary_pen);

}
Exemple #2
0
outta_memory()
{
top_line("Out of Memory");
}
Exemple #3
0
too_many_frames()
{
top_line("Too Many Frames");
}