Exemple #1
0
 public CannonField(QWidget parent) : base(parent)
 {
     currentAngle       = 45;
     currentForce       = 0;
     Palette            = new QPalette(new QColor(250,250,200));
     AutoFillBackground = true;
 }
Exemple #2
0
    QPainter painter = new QPainter();     // should be new QPainter(this) and be put in PaintEvent()

    public CannonField(QWidget parent) : base(parent)
    {
        currentAngle   = 45;
        currentForce   = 0;
        timerCount     = 0;
        autoShootTimer = new QTimer(this);
        Connect(autoShootTimer, SIGNAL("timeout()"), this, SLOT("moveShot()"));
        shootAngle         = 0;
        shootForce         = 0;
        Palette            = new QPalette(new QColor(250, 250, 200));
        AutoFillBackground = true;
    }
Exemple #3
0
 public CannonField(QWidget parent) : base(parent)
 {
     currentAngle   = 45;
     currentForce   = 0;
     timerCount     = 0;
     autoShootTimer = new QTimer(this);
     Connect(autoShootTimer, SIGNAL("timeout()"), this, SLOT("MoveShot()"));
     shootAngle         = 0;
     shootForce         = 0;
     target             = new QPoint(0, 0);
     gameEnded          = false;
     barrelPressed      = false;
     Palette            = new QPalette(new QColor(250, 250, 200));
     AutoFillBackground = true;
     NewTarget();
 }