<offset>: Parse, evaluate, and example test case. (Fixes issue #3)
[python-bulletml.git] / examples / normal / threefire-offset.xml
diff --git a/examples/normal/threefire-offset.xml b/examples/normal/threefire-offset.xml
new file mode 100644 (file)
index 0000000..5ecb2b1
--- /dev/null
@@ -0,0 +1,55 @@
+<?xml version="1.0" ?>\r
+<!DOCTYPE bulletml SYSTEM "http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/bulletml.dtd">\r
+\r
+<bulletml xmlns="http://www.asahi-net.or.jp/~cs8k-cyu/bulletml"\r
+         xmlns:py="http://code.google.com/p/python-bulletml/">\r
+  <action label="top">\r
+    <actionRef label="threefire">\r
+      <param>10 + 20 * $rank * $rand</param>\r
+    </actionRef>\r
+  </action>\r
+\r
+  <action label="threefire">\r
+    <fire>\r
+      <bulletRef label="dropper">\r
+       <param>$1</param>\r
+       <param>0</param>\r
+      </bulletRef>\r
+      <direction>0</direction>\r
+    </fire>\r
+    <fire>\r
+      <bulletRef label="dropper">\r
+       <param>$1</param>\r
+      </bulletRef>\r
+      <py:offset><py:x>5</py:x><py:y>-5</py:y></py:offset>\r
+    </fire>\r
+    <fire>\r
+      <bulletRef label="dropper">\r
+       <param>$1</param>\r
+      </bulletRef>\r
+      <py:offset><py:x>-5</py:x><py:y>-5</py:y></py:offset>\r
+    </fire>\r
+  </action>\r
+\r
+  <bullet label="dropper">\r
+    <speed>0</speed>\r
+    <action>\r
+      <repeat>\r
+       <times>$1</times>\r
+       <action>\r
+         <fire>\r
+           <bullet>\r
+             <direction type="relative">0</direction>\r
+             <speed type="absolute">1</speed>\r
+           </bullet>\r
+         </fire>\r
+         <wait>4</wait>\r
+       </action>\r
+      </repeat>\r
+      <changeSpeed>\r
+       <term>1</term>\r
+       <speed>1</speed>\r
+      </changeSpeed>\r
+    </action>\r
+  </bullet>\r
+</bulletml>\r