Bullet hell test 2
by Trung Tran
HTML
<script src="https://cdn.rawgit.com/daishihmr/bulletml.js/master/build/bulletml.min.js"></script>
<canvas id="demo"></canvas>
CSS
#demo {
image-rendering: optimizeSpeed; /* Older versions of FF */
image-rendering: -moz-crisp-edges; /* FF 6.0+ */
image-rendering: -webkit-optimize-contrast; /* Safari */
image-rendering: -o-crisp-edges; /* OS X & Windows Opera (12.02+) */
image-rendering: pixelated; /* Awesome future-browsers */
-ms-interpolation-mode: nearest-neighbor; /* IE */
}
JavaScript
window.addEventListener("keydown", function(e) {
// space and arrow keys
if([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {
e.preventDefault();
}
}, false);
var danmaku0 = bulletml.buildXML(
/*"<bulletml>" +
"<action label='top'>" +
"<repeat>" +
"<times>999</times>" +
"<action>" +
"<repeat>" +
"<times>30</times>" +
"<action>" +
"<fire>" +
"<direction type='sequence'>12</direction>" +
"<speed>5</speed>" +
"<bullet>" +
"<actionRef label='b'/>" +
"</bullet>" +
"</fire>" +
"<repeat>" +
"<times>9-1</times>" +
"<action>" +
"<fire>" +
"<direction type='sequence'>360/9</direction>" +
"<speed>5</speed>" +
"<bullet>" +
"<actionRef label='b'/>" +
"</bullet>" +
"</fire>" +
"</action>" +
"</repeat>" +
"<wait>2</wait>" +
"</action>" +
"</repeat>" +
"<wait>30</wait>" +
"<repeat>" +
"<times>30</times>" +
"<action>" +
"<fire>" +
"<direction type='sequence'>-12</direction>" +
"<speed>5</speed>" +
"<bullet>" +
...