-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
28 lines (27 loc) · 838 Bytes
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<canvas width="500" height="500"></canvas>
<script type="text/javascript">
var canvas = document.getElementsByTagName("canvas")[0];
var context = canvas.getContext("2d");
(function game(){
context.fillStyle = "black";
context.fillRect(0, 0, 500, 500);
colorArr = ["blue", "red", "orange", "yellow", "white"]
context.fillStyle =
context.beginPath();
// context.lineTo(pxloc, pxloc);
context.closePath();
// var gradient = context.createLinearGradient(px,px,px,px);
// canvas needs to be redrawn so put this in the recursive
//
var audio = new Audio();
if( audio.canPlayType("audio/mp3") ){
// 2 second sound files
audio.src = "file name.mp3";
}else{
audio.src = "file name.mp3";
}
sfx.play();
})()
</script>
<!-- this is a test -->