InitialObjectDescriptor {
 objectDescriptorID 1
 audioProfileLevelIndication 1
 visualProfileLevelIndication 1
 sceneProfileLevelIndication 1
 graphicsProfileLevelIndication 1
 ODProfileLevelIndication 1
 esDescr [
  ES_Descriptor {
   ES_ID 1
   decConfigDescr DecoderConfigDescriptor {
    objectTypeIndication 2
    streamType 3
    bufferSizeDB 50000
    decSpecificInfo BIFSv2Config {
     nodeIDbits 10
     routeIDbits 10
     isCommandStream true
     pixelMetric true
     pixelWidth 400
     pixelHeight 400
    }
   }
   slConfigDescr SLConfigDescriptor {
    useAccessUnitStartFlag true
    useAccessUnitEndFlag true
    useTimeStampsFlag true
    timeStampResolution 1000
    timeStampLength 32
   }
  }
 ]
}

OrderedGroup {
 children [
  Background2D {
   backColor 1 1 1
  }
  WorldInfo {
   info [
   "This game was translated from" 
   "the site http://javascript.internet.com'"
    "Written and designed by Peter Occil (poccil@yahoo.com)" 
    "Translated and adapted by " 
    "Cyril Concolato (cyril.concolato@enst.fr), June 2003"
    "GPAC Regression Tests" "$Date: 2007-07-27 09:46:09 $ - $Revision: 1.2 $" "(C) 2002-2004 GPAC Team"
]
   title "Winmine using MPEG-4 BIFS and Javascript"
  }
  Transform2D {
   translation 0 175
   children [
    Shape {
     appearance Appearance {
      material Material2D {
       emissiveColor 0 0 0
       filled TRUE
      }
     }
     geometry Text {
      string ["MineSweeper using" "MPEG-4 BIFS and Javascript"]
      fontStyle FontStyle {
       justify ["MIDDLE" "MIDDLE"]
       size 20
       style "BOLD"
      }
     }
    }
   ]
  }
  Transform2D {
   scale 1.5 1.5
   children [
    DEF N0 TimeSensor {
     enabled FALSE
     loop TRUE
    }
    Switch {
     choice [
      DEF N1 Transform2D {
       children [
        DEF N2 Shape {
         appearance Appearance {
          material Material2D {
           emissiveColor 0.3 0.3 0.3
           filled TRUE
          }
         }
         geometry DEF N3 Rectangle {
          size 16 16
         }
        }
       ]
      }
      DEF N4 Transform2D {
       children [
        USE N2
        Shape {
         appearance Appearance {
          material Material2D {
           emissiveColor 1 0 0
           filled TRUE
          }
         }
         geometry Rectangle {
          size 4 4
         }
        }
       ]
      }
      DEF N5 Transform2D {
       children [
        USE N2
        Shape {
         appearance Appearance {
          material Material2D {
           emissiveColor 0 0 1
           filled TRUE
          }
         }
         geometry Text {
          string ["?"]
          fontStyle FontStyle {
           justify ["MIDDLE" "MIDDLE"]
           size 10
          }
         }
        }
       ]
      }
      DEF N6 Transform2D {
       children [
        USE N2
        DEF N7 Shape {
         appearance Appearance {
          material Material2D {
           emissiveColor 0.4 0.4 0.4
           filled TRUE
          }
         }
         geometry Rectangle {
          size 15 15
         }
        }
        Shape {
         appearance DEF N9 Appearance {
          material Material2D {
           emissiveColor 0 1 0
           filled TRUE
          }
         }
         geometry Text {
          string [""]
          fontStyle DEF N8 FontStyle {
           justify ["MIDDLE" "MIDDLE"]
           size 15
          }
         }
        }
       ]
      }
      DEF N10 Transform2D {
       children [
        USE N2
        USE N7
        Shape {
         appearance USE N9
         geometry Text {
          string ["1"]
          fontStyle USE N8
         }
        }
       ]
      }
      DEF N11 Transform2D {
       children [
        USE N2
        USE N7
        Shape {
         appearance USE N9
         geometry Text {
          string ["2"]
          fontStyle USE N8
         }
        }
       ]
      }
      DEF N12 Transform2D {
       children [
        USE N2
        USE N7
        Shape {
         appearance USE N9
         geometry Text {
          string ["3"]
          fontStyle USE N8
         }
        }
       ]
      }
      DEF N13 Transform2D {
       children [
        USE N2
        USE N7
        Shape {
         appearance USE N9
         geometry Text {
          string ["4"]
          fontStyle USE N8
         }
        }
       ]
      }
      DEF N14 Transform2D {
       children [
        USE N2
        USE N7
        Shape {
         appearance USE N9
         geometry Text {
          string ["5"]
          fontStyle USE N8
         }
        }
       ]
      }
      DEF N15 Transform2D {
       children [
        USE N2
        USE N7
        Shape {
         appearance USE N9
         geometry Text {
          string ["6"]
          fontStyle USE N8
         }
        }
       ]
      }
      DEF N16 Transform2D {
       children [
        USE N2
        USE N7
        Shape {
         appearance USE N9
         geometry Text {
          string ["7"]
          fontStyle USE N8
         }
        }
       ]
      }
      DEF N17 Transform2D {
       children [
        USE N2
        USE N7
        Shape {
         appearance USE N9
         geometry Text {
          string ["8"]
          fontStyle USE N8
         }
        }
       ]
      }
      DEF N18 Transform2D {
       children [
        USE N2
        USE N7
        Shape {
         appearance Appearance {
          material Material2D {
           emissiveColor 0 0 0
           filled TRUE
          }
         }
         geometry Circle {
          radius 6
         }
        }
       ]
      }
      DEF N19 Transform2D {
       children [
        USE N2
        USE N7
       ]
      }
      DEF N20 Transform2D {
       children [
        USE N2
        USE N7
        Shape {
         appearance Appearance {
          material Material2D {
           emissiveColor 1 0 0
           filled TRUE
          }
         }
         geometry Text {
          string ["x"]
          fontStyle USE N8
         }
        }
       ]
      }
      DEF N21 Transform2D {
       children [
        Shape {
         appearance Appearance {
          material Material2D {
           emissiveColor 1 0 1
           filled TRUE
          }
         }
         geometry Circle {
          radius 10
         }
        }
       ]
      }
      DEF N22 Transform2D {
       children [
        Shape {
         appearance Appearance {
          material Material2D {
           emissiveColor 0 1 1
           filled TRUE
          }
         }
         geometry Circle {
          radius 10
         }
        }
       ]
      }
     ]
    }
    Transform2D {
     translation -40 80
     children [
      Shape {
       appearance Appearance {
        material Material2D {
         emissiveColor 0 0 0
         filled TRUE
        }
       }
       geometry Rectangle {
        size 35 21
       }
      }
      Shape {
       appearance Appearance {
        material Material2D {
         emissiveColor 1 0 0
         filled TRUE
        }
       }
       geometry DEF N23 Text {
        string ["010"]
        fontStyle USE N8
       }
      }
     ]
    }
    DEF N24 Transform2D {
     translation 0 80
     children [
      DEF N25 TouchSensor {}
      USE N22
     ]
    }
    Transform2D {
     translation 40 80
     children [
      Shape {
       appearance Appearance {
        material Material2D {
         emissiveColor 0 0 0
         filled TRUE
        }
       }
       geometry Rectangle {
        size 35 21
       }
      }
      Shape {
       appearance Appearance {
        material Material2D {
         emissiveColor 1 0 0
         filled TRUE
        }
       }
       geometry DEF N26 Text {
        string ["000"]
        fontStyle USE N8
       }
      }
     ]
    }
    DEF N27 Form {
     size 128 128
     groups [1 -1 2 -1 3 -1 4 -1 5 -1 6 -1 7 -1 8 -1 9 -1 10 -1 11 -1 12 -1 13 -1 14 -1 15 -1 16 -1 17 -1 18 -1 19 -1 20 -1 21 -1 22 -1 23 -1 24 -1 25 -1 26 -1 27 -1 28 -1 29 -1 30 -1 31 -1 32 -1 33 -1 34 -1 35 -1 36 -1 37 -1 38 -1 39 -1 40 -1 41 -1 42 -1 43 -1 44 -1 45 -1 46 -1 47 -1 48 -1 49 -1 50 -1 51 -1 52 -1 53 -1 54 -1 55 -1 56 -1 57 -1 58 -1 59 -1 60 -1 61 -1 62 -1 63 -1 64 -1 1 2 3 4 5 6 7 8 -1 9 10 11 12 13 14 15 16 -1 17 18 19 20 21 22 23 24 -1 25 26 27 28 29 30 31 32 -1 33 34 35 36 37 38 39 40 -1 41 42 43 44 45 46 47 48 -1 49 50 51 52 53 54 55 56 -1 57 58 59 60 61 62 63 64 -1]
     constraints ["SHin" "SHin" "SHin" "SHin" "SHin" "SHin" "SHin" "SHin" "SVin"]
     groupsIndex [1 2 3 4 5 6 7 8 -1 9 10 11 12 13 14 15 16 -1 17 18 19 20 21 22 23 24 -1 25 26 27 28 29 30 31 32 -1 33 34 35 36 37 38 39 40 -1 41 42 43 44 45 46 47 48 -1 49 50 51 52 53 54 55 56 -1 57 58 59 60 61 62 63 64 -1 65 66 67 68 69 70 71 72 -1]
     children [
      Transform2D {
       children [
        DEF N28 TouchSensor {}
        USE N1
        DEF N29 Valuator {}
        DEF N30 Conditional {
         buffer {
          REPLACE N29.inSFVec2f BY 0 0
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N31 TouchSensor {}
        USE N1
        DEF N32 Valuator {}
        DEF N33 Conditional {
         buffer {
          REPLACE N32.inSFVec2f BY 0 1
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N34 TouchSensor {}
        USE N1
        DEF N35 Valuator {}
        DEF N36 Conditional {
         buffer {
          REPLACE N35.inSFVec2f BY 0 2
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N37 TouchSensor {}
        USE N1
        DEF N38 Valuator {}
        DEF N39 Conditional {
         buffer {
          REPLACE N38.inSFVec2f BY 0 3
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N40 TouchSensor {}
        USE N1
        DEF N41 Valuator {}
        DEF N42 Conditional {
         buffer {
          REPLACE N41.inSFVec2f BY 0 4
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N43 TouchSensor {}
        USE N1
        DEF N44 Valuator {}
        DEF N45 Conditional {
         buffer {
          REPLACE N44.inSFVec2f BY 0 5
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N46 TouchSensor {}
        USE N1
        DEF N47 Valuator {}
        DEF N48 Conditional {
         buffer {
          REPLACE N47.inSFVec2f BY 0 6
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N49 TouchSensor {}
        USE N1
        DEF N50 Valuator {}
        DEF N51 Conditional {
         buffer {
          REPLACE N50.inSFVec2f BY 0 7
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N52 TouchSensor {}
        USE N1
        DEF N53 Valuator {}
        DEF N54 Conditional {
         buffer {
          REPLACE N53.inSFVec2f BY 1 0
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N55 TouchSensor {}
        USE N1
        DEF N56 Valuator {}
        DEF N57 Conditional {
         buffer {
          REPLACE N56.inSFVec2f BY 1 1
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N58 TouchSensor {}
        USE N1
        DEF N59 Valuator {}
        DEF N60 Conditional {
         buffer {
          REPLACE N59.inSFVec2f BY 1 2
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N61 TouchSensor {}
        USE N1
        DEF N62 Valuator {}
        DEF N63 Conditional {
         buffer {
          REPLACE N62.inSFVec2f BY 1 3
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N64 TouchSensor {}
        USE N1
        DEF N65 Valuator {}
        DEF N66 Conditional {
         buffer {
          REPLACE N65.inSFVec2f BY 1 4
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N67 TouchSensor {}
        USE N1
        DEF N68 Valuator {}
        DEF N69 Conditional {
         buffer {
          REPLACE N68.inSFVec2f BY 1 5
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N70 TouchSensor {}
        USE N1
        DEF N71 Valuator {}
        DEF N72 Conditional {
         buffer {
          REPLACE N71.inSFVec2f BY 1 6
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N73 TouchSensor {}
        USE N1
        DEF N74 Valuator {}
        DEF N75 Conditional {
         buffer {
          REPLACE N74.inSFVec2f BY 1 7
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N76 TouchSensor {}
        USE N1
        DEF N77 Valuator {}
        DEF N78 Conditional {
         buffer {
          REPLACE N77.inSFVec2f BY 2 0
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N79 TouchSensor {}
        USE N1
        DEF N80 Valuator {}
        DEF N81 Conditional {
         buffer {
          REPLACE N80.inSFVec2f BY 2 1
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N82 TouchSensor {}
        USE N1
        DEF N83 Valuator {}
        DEF N84 Conditional {
         buffer {
          REPLACE N83.inSFVec2f BY 2 2
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N85 TouchSensor {}
        USE N1
        DEF N86 Valuator {}
        DEF N87 Conditional {
         buffer {
          REPLACE N86.inSFVec2f BY 2 3
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N88 TouchSensor {}
        USE N1
        DEF N89 Valuator {}
        DEF N90 Conditional {
         buffer {
          REPLACE N89.inSFVec2f BY 2 4
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N91 TouchSensor {}
        USE N1
        DEF N92 Valuator {}
        DEF N93 Conditional {
         buffer {
          REPLACE N92.inSFVec2f BY 2 5
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N94 TouchSensor {}
        USE N1
        DEF N95 Valuator {}
        DEF N96 Conditional {
         buffer {
          REPLACE N95.inSFVec2f BY 2 6
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N97 TouchSensor {}
        USE N1
        DEF N98 Valuator {}
        DEF N99 Conditional {
         buffer {
          REPLACE N98.inSFVec2f BY 2 7
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N100 TouchSensor {}
        USE N1
        DEF N101 Valuator {}
        DEF N102 Conditional {
         buffer {
          REPLACE N101.inSFVec2f BY 3 0
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N103 TouchSensor {}
        USE N1
        DEF N104 Valuator {}
        DEF N105 Conditional {
         buffer {
          REPLACE N104.inSFVec2f BY 3 1
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N106 TouchSensor {}
        USE N1
        DEF N107 Valuator {}
        DEF N108 Conditional {
         buffer {
          REPLACE N107.inSFVec2f BY 3 2
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N109 TouchSensor {}
        USE N1
        DEF N110 Valuator {}
        DEF N111 Conditional {
         buffer {
          REPLACE N110.inSFVec2f BY 3 3
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N112 TouchSensor {}
        USE N1
        DEF N113 Valuator {}
        DEF N114 Conditional {
         buffer {
          REPLACE N113.inSFVec2f BY 3 4
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N115 TouchSensor {}
        USE N1
        DEF N116 Valuator {}
        DEF N117 Conditional {
         buffer {
          REPLACE N116.inSFVec2f BY 3 5
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N118 TouchSensor {}
        USE N1
        DEF N119 Valuator {}
        DEF N120 Conditional {
         buffer {
          REPLACE N119.inSFVec2f BY 3 6
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N121 TouchSensor {}
        USE N1
        DEF N122 Valuator {}
        DEF N123 Conditional {
         buffer {
          REPLACE N122.inSFVec2f BY 3 7
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N124 TouchSensor {}
        USE N1
        DEF N125 Valuator {}
        DEF N126 Conditional {
         buffer {
          REPLACE N125.inSFVec2f BY 4 0
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N127 TouchSensor {}
        USE N1
        DEF N128 Valuator {}
        DEF N129 Conditional {
         buffer {
          REPLACE N128.inSFVec2f BY 4 1
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N130 TouchSensor {}
        USE N1
        DEF N131 Valuator {}
        DEF N132 Conditional {
         buffer {
          REPLACE N131.inSFVec2f BY 4 2
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N133 TouchSensor {}
        USE N1
        DEF N134 Valuator {}
        DEF N135 Conditional {
         buffer {
          REPLACE N134.inSFVec2f BY 4 3
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N136 TouchSensor {}
        USE N1
        DEF N137 Valuator {}
        DEF N138 Conditional {
         buffer {
          REPLACE N137.inSFVec2f BY 4 4
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N139 TouchSensor {}
        USE N1
        DEF N140 Valuator {}
        DEF N141 Conditional {
         buffer {
          REPLACE N140.inSFVec2f BY 4 5
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N142 TouchSensor {}
        USE N1
        DEF N143 Valuator {}
        DEF N144 Conditional {
         buffer {
          REPLACE N143.inSFVec2f BY 4 6
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N145 TouchSensor {}
        USE N1
        DEF N146 Valuator {}
        DEF N147 Conditional {
         buffer {
          REPLACE N146.inSFVec2f BY 4 7
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N148 TouchSensor {}
        USE N1
        DEF N149 Valuator {}
        DEF N150 Conditional {
         buffer {
          REPLACE N149.inSFVec2f BY 5 0
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N151 TouchSensor {}
        USE N1
        DEF N152 Valuator {}
        DEF N153 Conditional {
         buffer {
          REPLACE N152.inSFVec2f BY 5 1
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N154 TouchSensor {}
        USE N1
        DEF N155 Valuator {}
        DEF N156 Conditional {
         buffer {
          REPLACE N155.inSFVec2f BY 5 2
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N157 TouchSensor {}
        USE N1
        DEF N158 Valuator {}
        DEF N159 Conditional {
         buffer {
          REPLACE N158.inSFVec2f BY 5 3
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N160 TouchSensor {}
        USE N1
        DEF N161 Valuator {}
        DEF N162 Conditional {
         buffer {
          REPLACE N161.inSFVec2f BY 5 4
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N163 TouchSensor {}
        USE N1
        DEF N164 Valuator {}
        DEF N165 Conditional {
         buffer {
          REPLACE N164.inSFVec2f BY 5 5
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N166 TouchSensor {}
        USE N1
        DEF N167 Valuator {}
        DEF N168 Conditional {
         buffer {
          REPLACE N167.inSFVec2f BY 5 6
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N169 TouchSensor {}
        USE N1
        DEF N170 Valuator {}
        DEF N171 Conditional {
         buffer {
          REPLACE N170.inSFVec2f BY 5 7
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N172 TouchSensor {}
        USE N1
        DEF N173 Valuator {}
        DEF N174 Conditional {
         buffer {
          REPLACE N173.inSFVec2f BY 6 0
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N175 TouchSensor {}
        USE N1
        DEF N176 Valuator {}
        DEF N177 Conditional {
         buffer {
          REPLACE N176.inSFVec2f BY 6 1
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N178 TouchSensor {}
        USE N1
        DEF N179 Valuator {}
        DEF N180 Conditional {
         buffer {
          REPLACE N179.inSFVec2f BY 6 2
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N181 TouchSensor {}
        USE N1
        DEF N182 Valuator {}
        DEF N183 Conditional {
         buffer {
          REPLACE N182.inSFVec2f BY 6 3
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N184 TouchSensor {}
        USE N1
        DEF N185 Valuator {}
        DEF N186 Conditional {
         buffer {
          REPLACE N185.inSFVec2f BY 6 4
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N187 TouchSensor {}
        USE N1
        DEF N188 Valuator {}
        DEF N189 Conditional {
         buffer {
          REPLACE N188.inSFVec2f BY 6 5
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N190 TouchSensor {}
        USE N1
        DEF N191 Valuator {}
        DEF N192 Conditional {
         buffer {
          REPLACE N191.inSFVec2f BY 6 6
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N193 TouchSensor {}
        USE N1
        DEF N194 Valuator {}
        DEF N195 Conditional {
         buffer {
          REPLACE N194.inSFVec2f BY 6 7
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N196 TouchSensor {}
        USE N1
        DEF N197 Valuator {}
        DEF N198 Conditional {
         buffer {
          REPLACE N197.inSFVec2f BY 7 0
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N199 TouchSensor {}
        USE N1
        DEF N200 Valuator {}
        DEF N201 Conditional {
         buffer {
          REPLACE N200.inSFVec2f BY 7 1
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N202 TouchSensor {}
        USE N1
        DEF N203 Valuator {}
        DEF N204 Conditional {
         buffer {
          REPLACE N203.inSFVec2f BY 7 2
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N205 TouchSensor {}
        USE N1
        DEF N206 Valuator {}
        DEF N207 Conditional {
         buffer {
          REPLACE N206.inSFVec2f BY 7 3
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N208 TouchSensor {}
        USE N1
        DEF N209 Valuator {}
        DEF N210 Conditional {
         buffer {
          REPLACE N209.inSFVec2f BY 7 4
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N211 TouchSensor {}
        USE N1
        DEF N212 Valuator {}
        DEF N213 Conditional {
         buffer {
          REPLACE N212.inSFVec2f BY 7 5
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N214 TouchSensor {}
        USE N1
        DEF N215 Valuator {}
        DEF N216 Conditional {
         buffer {
          REPLACE N215.inSFVec2f BY 7 6
         }
        }
       ]
      }
      Transform2D {
       children [
        DEF N217 TouchSensor {}
        USE N1
        DEF N218 Valuator {}
        DEF N219 Conditional {
         buffer {
          REPLACE N218.inSFVec2f BY 7 7
         }
        }
       ]
      }
     ]
    }
   ]
  }
  DEF N220 Script {
   eventIn SFTime timeOut
   eventIn SFBool startGame
   eventIn SFVec2f click
   eventIn SFInt32 keyPressed
   eventIn SFInt32 keyReleased
   field SFNode timer USE N0
   field MFNode sqtimages [
    USE N1
    USE N4
    USE N5
   ]
   field MFNode sqimages [
     USE N6
     USE N10
     USE N11
     USE N12
     USE N13
     USE N14
     USE N15
     USE N16
     USE N17
   ]
   field SFNode mineImage USE N18
   field SFNode noMineImage USE N20
   field SFNode mineredImage USE N19
   field SFNode flagsNode USE N23
   field SFNode conditionNode USE N24
   field SFNode elapsedNode USE N26
   field SFNode board USE N27
   field SFNode btndead USE N21
   field SFNode btncool USE N22
   url ["javascript:  
function initialize() {
 gridx=8;
 gridy=8;
 mines=new Array(gridx) ;
 shown=new Array(gridy) ;
 maxmines=10;
 squaresleft=0;
 flagsleft=0;
 elapsedtime=0;
 playing=0;
 placeflag=0;
 clicked=0;
 gridSq=gridx*16;
 grid8=gridSq-128;
 grid16=gridx-8;
 grid32=grid16*8;
 grid64=grid16*16;
 topBarWidth=8+grid64;
 menuBarWidth=86+grid64;
 wideWidth=gridx*16;
 highHeight=gridy*16;
 cplLeft=6+grid32;
 cplRight=4+grid32;
 totalWidth=gridSq+32;
 tW6=totalWidth-6;
 ww2=wideWidth+2;
 newgame(0);
}
function keyPressed(value) {
 print('keyPressed:'+value);
 if (value) {
  placeflag=true;
  setStatus();
 }
}
function keyReleased(value) {
 print('keyReleased'+value);
 if (value) {
  placeflag=false;
  setStatus();
 }
}
function startGame(value,timestamp) {
 if (value) {
  newgame(timestamp);
 }
}
function newgame(timestamp) {
 for (y=0;y<gridy;++y){
  mines[y]=new Array(gridx) ;
  shown[y]=new Array(gridx) ;
  for (x=0;x<gridx;x++){
   mines[y][x]=false;
   shown[y][x]=0;
   board.children[x*gridx+y].children[1]=sqtimages[0];
  }
 }
 conditionNode.children[1]=btncool;
 for (m=0;m<maxmines;++m){
  x=Math.floor(Math.random()*gridx);
  y=Math.floor(Math.random()*gridy);
  while (mines[y][x]){
   x=Math.floor(Math.random()*gridx);
   y=Math.floor(Math.random()*gridy);
  }
  mines[y][x]=true;
 }
 squaresleft=gridy*gridx;
 flagsleft=maxmines;
 elapsedtime=0;
 playing=true;
 clicked=false;
 placeflag=false;
 timer.startTime=timestamp;
 timer.enabled=true;
}
function timeOut(value,timestamp) {
 ticker();
}
function ticker() {
 if (playing) {
  if (clicked) {
   elapsedtime++;
   setStatus();
  }
 }
}
function setStatus() {
 elapsedNode.string[0]=''+elapsedtime;
 flagsNode.string[0]=''+flagsleft;
}
function surrounding(y,x) {
 count=0;
 if (y>0&&x>0&&mines[y-1][x-1]) count++;
 if (y>0&&mines[y-1][x]) count++;
 if (y>0&&x<gridx-1&&mines[y-1][x+1]) count++;
 if (x>0&&mines[y][x-1]) count++;
 if (x<gridx-1&&mines[y][x+1]) count++;
 if (y<gridy-1&&x>0&&mines[y+1][x-1]) count++;
 if (y<gridy-1&&mines[y+1][x]) count++;
 if (y<gridy-1&&x<gridx-1&&mines[y+1][x+1]) count++;
 return count;

}
function rollback(y,x) {
 if (y>=0&&y<gridy&&x>=0&&x<gridx) {
  if (shown[y][x]!=3) {
   c=surrounding(y,x);
   shown[y][x]=3;
   squaresleft--;
   board.children[x*gridx+y].children[1]=sqimages[c];
   if (c==0) {
    rollback(y-1,x-1);
    rollback(y-1,x);
    rollback(y-1,x+1);
    rollback(y,x-1);
    rollback(y,x+1);
    rollback(y+1,x-1);
    rollback(y+1,x);
    rollback(y+1,x+1);
   }
  }
 }
}
function dead() {
 for (y=0;y<gridy;++y){
  for (x=0;x<gridx;++x){
   if (mines[y][x]) {
    if (shown[y][x]!=1) {
     board.children[x*gridx+y].children[1]=mineImage;
    }
   }
   else if (shown[y][x]==1) {
    board.children[x*gridx+y].children[1]=noMineImage;
   }
  }
 }
 conditionNode.children[1]=btndead;
 playing=false;
 clicked=false;
}
function click(value) {
 gridclick(value.y,value.x);
}
function gridclick(y,x) {
 if (playing) {
  clicked=true;
  if (placeflag) {
   if (shown[y][x]<3) {
    s=shown[y][x];
    change=true;
    if (s==1) {
     flagsleft++;
     squaresleft++;
    }
    if (flagsleft==0&&s==0) {
     change=false;
    }
    else {
     if (s==2) s=0;
     else s++;
     if (s==1) {
      flagsleft--;
      squaresleft--;
     }
    }
    if (change) {
     shown[y][x]=s;
     board.children[x*gridx+y].children[1]=sqtimages[s];
     setStatus();
    }
    if (squaresleft==0) {
     conditionNode.children[1]=btncool;
     playing=false;
    }
   }
  }
  else if (shown[y][x]!=1) {
   if (mines[y][x]) {
    board.children[x*gridx+y].children[1]=mineredImage;
    dead();
   }
   else {
    rollback(y,x);
   }
  }
 }
}
     "
   ]
  }
 ]
}

ROUTE N25.isActive TO N220.startGame
ROUTE N0.cycleTime TO N220.timeOut
ROUTE N28.isActive TO N30.activate
ROUTE N29.outSFVec2f TO N220.click
ROUTE N31.isActive TO N33.activate
ROUTE N32.outSFVec2f TO N220.click
ROUTE N34.isActive TO N36.activate
ROUTE N35.outSFVec2f TO N220.click
ROUTE N37.isActive TO N39.activate
ROUTE N38.outSFVec2f TO N220.click
ROUTE N40.isActive TO N42.activate
ROUTE N41.outSFVec2f TO N220.click
ROUTE N43.isActive TO N45.activate
ROUTE N44.outSFVec2f TO N220.click
ROUTE N46.isActive TO N48.activate
ROUTE N47.outSFVec2f TO N220.click
ROUTE N49.isActive TO N51.activate
ROUTE N50.outSFVec2f TO N220.click
ROUTE N52.isActive TO N54.activate
ROUTE N53.outSFVec2f TO N220.click
ROUTE N55.isActive TO N57.activate
ROUTE N56.outSFVec2f TO N220.click
ROUTE N58.isActive TO N60.activate
ROUTE N59.outSFVec2f TO N220.click
ROUTE N61.isActive TO N63.activate
ROUTE N62.outSFVec2f TO N220.click
ROUTE N64.isActive TO N66.activate
ROUTE N65.outSFVec2f TO N220.click
ROUTE N67.isActive TO N69.activate
ROUTE N68.outSFVec2f TO N220.click
ROUTE N70.isActive TO N72.activate
ROUTE N71.outSFVec2f TO N220.click
ROUTE N73.isActive TO N75.activate
ROUTE N74.outSFVec2f TO N220.click
ROUTE N76.isActive TO N78.activate
ROUTE N77.outSFVec2f TO N220.click
ROUTE N79.isActive TO N81.activate
ROUTE N80.outSFVec2f TO N220.click
ROUTE N82.isActive TO N84.activate
ROUTE N83.outSFVec2f TO N220.click
ROUTE N85.isActive TO N87.activate
ROUTE N86.outSFVec2f TO N220.click
ROUTE N88.isActive TO N90.activate
ROUTE N89.outSFVec2f TO N220.click
ROUTE N91.isActive TO N93.activate
ROUTE N92.outSFVec2f TO N220.click
ROUTE N94.isActive TO N96.activate
ROUTE N95.outSFVec2f TO N220.click
ROUTE N97.isActive TO N99.activate
ROUTE N98.outSFVec2f TO N220.click
ROUTE N100.isActive TO N102.activate
ROUTE N101.outSFVec2f TO N220.click
ROUTE N103.isActive TO N105.activate
ROUTE N104.outSFVec2f TO N220.click
ROUTE N106.isActive TO N108.activate
ROUTE N107.outSFVec2f TO N220.click
ROUTE N109.isActive TO N111.activate
ROUTE N110.outSFVec2f TO N220.click
ROUTE N112.isActive TO N114.activate
ROUTE N113.outSFVec2f TO N220.click
ROUTE N115.isActive TO N117.activate
ROUTE N116.outSFVec2f TO N220.click
ROUTE N118.isActive TO N120.activate
ROUTE N119.outSFVec2f TO N220.click
ROUTE N121.isActive TO N123.activate
ROUTE N122.outSFVec2f TO N220.click
ROUTE N124.isActive TO N126.activate
ROUTE N125.outSFVec2f TO N220.click
ROUTE N127.isActive TO N129.activate
ROUTE N128.outSFVec2f TO N220.click
ROUTE N130.isActive TO N132.activate
ROUTE N131.outSFVec2f TO N220.click
ROUTE N133.isActive TO N135.activate
ROUTE N134.outSFVec2f TO N220.click
ROUTE N136.isActive TO N138.activate
ROUTE N137.outSFVec2f TO N220.click
ROUTE N139.isActive TO N141.activate
ROUTE N140.outSFVec2f TO N220.click
ROUTE N142.isActive TO N144.activate
ROUTE N143.outSFVec2f TO N220.click
ROUTE N145.isActive TO N147.activate
ROUTE N146.outSFVec2f TO N220.click
ROUTE N148.isActive TO N150.activate
ROUTE N149.outSFVec2f TO N220.click
ROUTE N151.isActive TO N153.activate
ROUTE N152.outSFVec2f TO N220.click
ROUTE N154.isActive TO N156.activate
ROUTE N155.outSFVec2f TO N220.click
ROUTE N157.isActive TO N159.activate
ROUTE N158.outSFVec2f TO N220.click
ROUTE N160.isActive TO N162.activate
ROUTE N161.outSFVec2f TO N220.click
ROUTE N163.isActive TO N165.activate
ROUTE N164.outSFVec2f TO N220.click
ROUTE N166.isActive TO N168.activate
ROUTE N167.outSFVec2f TO N220.click
ROUTE N169.isActive TO N171.activate
ROUTE N170.outSFVec2f TO N220.click
ROUTE N172.isActive TO N174.activate
ROUTE N173.outSFVec2f TO N220.click
ROUTE N175.isActive TO N177.activate
ROUTE N176.outSFVec2f TO N220.click
ROUTE N178.isActive TO N180.activate
ROUTE N179.outSFVec2f TO N220.click
ROUTE N181.isActive TO N183.activate
ROUTE N182.outSFVec2f TO N220.click
ROUTE N184.isActive TO N186.activate
ROUTE N185.outSFVec2f TO N220.click
ROUTE N187.isActive TO N189.activate
ROUTE N188.outSFVec2f TO N220.click
ROUTE N190.isActive TO N192.activate
ROUTE N191.outSFVec2f TO N220.click
ROUTE N193.isActive TO N195.activate
ROUTE N194.outSFVec2f TO N220.click
ROUTE N196.isActive TO N198.activate
ROUTE N197.outSFVec2f TO N220.click
ROUTE N199.isActive TO N201.activate
ROUTE N200.outSFVec2f TO N220.click
ROUTE N202.isActive TO N204.activate
ROUTE N203.outSFVec2f TO N220.click
ROUTE N205.isActive TO N207.activate
ROUTE N206.outSFVec2f TO N220.click
ROUTE N208.isActive TO N210.activate
ROUTE N209.outSFVec2f TO N220.click
ROUTE N211.isActive TO N213.activate
ROUTE N212.outSFVec2f TO N220.click
ROUTE N214.isActive TO N216.activate
ROUTE N215.outSFVec2f TO N220.click
ROUTE N217.isActive TO N219.activate
ROUTE N218.outSFVec2f TO N220.click

