anchor.diff:    (if parent
         (new instance parent)
         (new instance))
  -  (let ((quit (#_new QPushButton "&Quit"))
  -        (shoot (#_new QPushButton "&Shoot"))
  -        (new-game (#_new QPushButton "&New Game"))
  -        (font (#_new QFont (qstring "Times") 18 (#_Bold "QFont"))))
  -    (#_setFont quit font)
  -    (#_setFont shoot font)
  -    (#_setFont new-game font)
  -    (#_connect "QObject"
  -                new-game
  -                (QSIGNAL "clicked()")
  -                instance
  -                (QSLOT "newGame()"))
  -    (#_connect "QObject"
  -                quit
  -                (QSIGNAL "clicked()")
  -                (#_QCoreApplication::instance)
  -                (QSLOT "quit()"))
  -    (let ((angle (make-instance 'lcd-range :text "ANGLE"))
  -          (force (make-instance 'lcd-range :text "FORCE"))
  -          (hits (#_new QLCDNumber 2))
  -          (shots-left (#_new QLCDNumber 2))
  -          (hits-label (#_new QLabel "HITS"))
  -          (shots-left-label (#_new QLabel "SHOTS LEFT"))
  -          (cf (make-instance 'cannon-field))
  -          (cannon-box (#_new QFrame)))
  -      (#_setFrameStyle cannon-box
  -                       (logior (primitive-value (#_WinPanel "QFrame"))
  -                               (primitive-value (#_Sunken "QFrame"))))
  -      (#_new QShortcut
  -             (#_new QKeySequence (#_Key_Enter "Qt"))
  -             instance
  -             (QSLOT "fire()"))
  -      (#_new QShortcut
  -             (#_new QKeySequence (#_Key_Return "Qt"))
  -             instance
  -             (QSLOT "fire()"))
  -      (#_new QShortcut
  -             (#_new QKeySequence (#_CTRL "Qt") (#_Key_Q "Qt"))
  -             instance
  -             (QSLOT "close()"))
  -      (setf (cannon-field instance) cf)
  -      (setf (hits instance) hits)
  -      (setf (shots-left instance) shots-left)
  -      (#_setSegmentStyle hits (#_Filled "QLCDNumber"))
  -      (#_setSegmentStyle shots-left (#_Filled "QLCDNumber"))
  +  (with-objects ((font (#_new QFont (qstring "Times") 18 (#_Bold "QFont"))))
  +    (let ((quit (#_new QPushButton "&Quit"))
  +          (shoot (#_new QPushButton "&Shoot"))
  +          (new-game (#_new QPushButton "&New Game")))
  +      (#_setFont quit font)
  +      (#_setFont shoot font)
  +      (#_setFont new-game font)
         (#_connect "QObject"
  -                 shoot
  +                 new-game
                    (QSIGNAL "clicked()")
                    instance
  -                 (QSLOT "fire()"))
  +                 (QSLOT "newGame()"))
         (#_connect "QObject"
  -                 cf
  -                 (QSIGNAL "hit()")
  -                 instance
  -                 (QSLOT "hit()"))
  -      (#_connect "QObject"
  -                 cf
  -                 (QSIGNAL "missed()")
  -                 instance
  -                 (QSLOT "missed()"))
  -      (#_connect "QObject"
  -                 cf
  -                 (QSIGNAL "canShoot(bool)")
  -                 shoot
  -                 (QSLOT "setEnabled(bool)"))
  -      (set-range angle 5 70)
  -      (set-range force 10 50)
  -      (#_connect "QObject"
  -                  angle
  -                  (QSIGNAL "valueChanged(int)")
  -                  cf
  -                  (QSLOT "setAngle(int)"))
  -      (#_connect "QObject"
  -                  cf
  -                  (QSIGNAL "angleChanged(int)")
  -                  angle
  -                  (QSLOT "setValue(int)"))
  -      (#_connect "QObject"
  -                  force
  -                  (QSIGNAL "valueChanged(int)")
  -                  cf
  -                  (QSLOT "setForce(int)"))
  -      (#_connect "QObject"
  -                  cf
  -                  (QSIGNAL "forceChanged(int)")
  -                  force
  -                  (QSLOT "setValue(int)"))
  -      (let ((left-layout (#_new QVBoxLayout))
  -            (top-layout (#_new QHBoxLayout))
  -            (grid (#_new QGridLayout)))
  -        (#_addWidget left-layout angle)
  -        (#_addWidget left-layout force)
  -
  -        (#_addWidget top-layout shoot)
  -        (#_addWidget top-layout hits)
  -        (#_addWidget top-layout hits-label)
  -        (#_addWidget top-layout shots-left)
  -        (#_addWidget top-layout shots-left-label)
  -        (#_addStretch top-layout 1)
  -        (#_addWidget top-layout new-game)
  -
  -        (#_addWidget grid quit 0 0)
  -        (#_addLayout grid top-layout 0 1)
  -        (#_addLayout grid left-layout 1 0)
  -        (#_addWidget grid cannon-box 1 1 2 1)
  -        (#_addWidget grid cf 1 1 2 1)
  -        (#_setColumnStretch grid 1 10)
  -        (#_setLayout instance grid))
  -      (setf (value angle) 60)
  -      (setf (value force) 25)
  -      (#_setFocus angle)
  -      (new-game instance))))
  +                 quit
  +                 (QSIGNAL "clicked()")
  +                 (#_QCoreApplication::instance)
  +                 (QSLOT "quit()"))
  +      (let ((angle (make-instance 'lcd-range :text "ANGLE"))
  +            (force (make-instance 'lcd-range :text "FORCE"))
  +            (hits (#_new QLCDNumber 2))
  +            (shots-left (#_new QLCDNumber 2))
  +            (hits-label (#_new QLabel "HITS"))
  +            (shots-left-label (#_new QLabel "SHOTS LEFT"))
  +            (cf (make-instance 'cannon-field))
  +            (cannon-box (#_new QFrame)))
  +        (#_setFrameStyle cannon-box
  +                         (logior (primitive-value (#_WinPanel "QFrame"))
  +                                 (primitive-value (#_Sunken "QFrame"))))
  +        (with-objects ((key (#_new QKeySequence (#_Key_Enter "Qt"))))
  +          (#_new QShortcut key instance (QSLOT "fire()")))
  +        (with-objects ((key (#_new QKeySequence (#_Key_Return "Qt"))))
  +          (#_new QShortcut key instance (QSLOT "fire()")))
  +        (with-objects ((key (#_new QKeySequence (#_CTRL "Qt") (#_Key_Q "Qt"))))
  +          (#_new QShortcut key instance (QSLOT "close()")))
  +        (setf (cannon-field instance) cf)
  +        (setf (hits instance) hits)
  +        (setf (shots-left instance) shots-left)
  +        (#_setSegmentStyle hits (#_Filled "QLCDNumber"))
  +        (#_setSegmentStyle shots-left (#_Filled "QLCDNumber"))
  +        (#_connect "QObject"
  +                   shoot
  +                   (QSIGNAL "clicked()")
  +                   instance
  +                   (QSLOT "fire()"))
  +        (#_connect "QObject"
  +                   cf
  +                   (QSIGNAL "hit()")
  +                   instance
  +                   (QSLOT "hit()"))
  +        (#_connect "QObject"
  +                   cf
  +                   (QSIGNAL "missed()")
  +                   instance
  +                   (QSLOT "missed()"))
  +        (#_connect "QObject"
  +                   cf
  +                   (QSIGNAL "canShoot(bool)")
  +                   shoot
  +                   (QSLOT "setEnabled(bool)"))
  +        (set-range angle 5 70)
  +        (set-range force 10 50)
  +        (#_connect "QObject"
  +                   angle
  +                   (QSIGNAL "valueChanged(int)")
  +                   cf
  +                   (QSLOT "setAngle(int)"))
  +        (#_connect "QObject"
  +                   cf
  +                   (QSIGNAL "angleChanged(int)")
  +                   angle
  +                   (QSLOT "setValue(int)"))
  +        (#_connect "QObject"
  +                   force
  +                   (QSIGNAL "valueChanged(int)")
  +                   cf
  +                   (QSLOT "setForce(int)"))
  +        (#_connect "QObject"
  +                   cf
  +                   (QSIGNAL "forceChanged(int)")
  +                   force
  +                   (QSLOT "setValue(int)"))
  +        (let ((left-layout (#_new QVBoxLayout))
  +              (top-layout (#_new QHBoxLayout))
  +              (grid (#_new QGridLayout)))
  +          (#_addWidget left-layout angle)
  +          (#_addWidget left-layout force)
  +          
  +          (#_addWidget top-layout shoot)
  +          (#_addWidget top-layout hits)
  +          (#_addWidget top-layout hits-label)
  +          (#_addWidget top-layout shots-left)
  +          (#_addWidget top-layout shots-left-label)
  +          (#_addStretch top-layout 1)
  +          (#_addWidget top-layout new-game)
  +          
  +          (#_addWidget grid quit 0 0)
  +          (#_addLayout grid top-layout 0 1)
  +          (#_addLayout grid left-layout 1 0)
  +          (#_addWidget grid cannon-box 1 1 2 1)
  +          (#_addWidget grid cf 1 1 2 1)
  +          (#_setColumnStretch grid 1 10)
  +          (#_setLayout instance grid))
  +        (setf (value angle) 60)
  +        (setf (value force) 25)
  +        (#_setFocus angle)
  +        (new-game instance)))))
   
   (defmethod fire ((game game-board))
     (with-slots (cannon-field shots-left) game
  
positive.code:   (#_new QRect 145 (- (#_height instance) 100) 15 99))
  
  (defun barrel-hit-p (instance pos)
    (let ((matrix (#_new QMatrix)))
      (#_translate matrix 0 (#_height instance))
      (#_rotate matrix (- (current-angle instance)))
      (#_contains (barrel-rect) (#_map (#_inverted matrix) pos))))
  
  (defun target-rect (instance)
    (let ((result (#_new QRect 0 0 20 10)))
      (#_moveCenter result (#_new QPoint
                                  (#_x (target instance))
                                  (- (#_height instance)
                                     1
                                     (#_y (target instance)))))
      result))
  
  (defun barrel-rect ()
    (#_new QRect 30 -5 20 10))
  
  (defun shot-rect (instance)
    (let* ((gravity 4.0d0)
           (time (/ (timer-count instance) 20.0d0))
           (velocity (shoot-force instance))
           (radians (* (shoot-angle instance) (/ pi 180.0d0)))
           (velx (* velocity (cos radians)))
           (vely (* velocity (sin radians)))
           (barrelRect (barrel-rect))
           (x0 (* (+ (#_right barrelRect) 5.0d0) (cos radians)))
           (y0 (* (+ (#_right barrelRect) 5.0d0) (sin radians)))
           (x (+ x0 (* velx time)))
           (y (+ y0 (* vely time) (- (* 0.5d0 gravity time time))))
           (result (#_new QRect 0 0 6 6)))
      (#_moveCenter result (#_new QPoint
                                (round x)
                                (- (#_height instance) 1 (round y))))
      result))
  
  (defun is-shooting-p (instance)
    (#_isActive (auto-shoot-timer instance)))
  
negative.code:                   :accessor shoot-angle)
       (shoot-force :initform 0
                    :accessor shoot-force)
       (target :initform nil
               :accessor target)
       (game-ended-p :initform nil
                     :accessor game-ended-p)
       (barrel-pressed-p :initform nil
  