VIẾT BĂNG SVG HỆ THỐNG PHÒNG THỦ
ROCKET CHỐNG ĐẠN
<html xmlns="http://www.w3.org/1999/xhtml">
<svg xmlns="http://www.w3.org/2000/svg" width="5000" height="3000">
<g id="bullet" transform="translate(250,150)">
<circle cx="0" cy="30" r="15" stroke="green" fill="blue">
<animate attributeName="cx" dur="2" from="290" to ="50" begin="B.click" end="S.click" repeatCount="indefinite"/>
</circle></g> // enemy’s bullet
<g id="radar" transform="translate(175,150)">
<ellipse cx="0" cy="0" rx="40" ry="35" stroke="red" fill="yellow">
<animateTransform attributeName="transform" type="rotate"
dur="1" from="0" to ="360" begin="B.click" end="S.click" repeatCount="indefinite"/>
</ellipse> //máy phát sóng
<line x1="0" y1="0" x2="150" y2="0" stroke="red" stroke-width="2">
<animateTransform attributeName="transform" type="rotate"
dur="2" from="0" to ="360" begin="B.click" end="S.click" repeatCount="indefinite"/>
</line> // sóng của radar
<g id="B">
<text x="-40" y="10" font-size="20">START</g>
<g id="S">
<text x="35" y="15" font-size="20">STOP</g>
// rocket chận
phi đạn của địch
<image x= "45" y="100" xlink:href="rocket1.gif" width="45" height="40">
<animateMotion dur="1" from ="45,100" to
="50,-80" begin="B.click" end="S.click"
repeatCount="indefinite"/> //
lấy hình đã vẽ tồn trử trong document
</image>
</g> </g>
</svg></html>
By Henry duong/2010-----------------------------