File tree Expand file tree Collapse file tree 4 files changed +24
-3
lines changed Expand file tree Collapse file tree 4 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class VideoFeed extends GUIObject {
20
20
textAlign ( LEFT ) ;
21
21
fill ( 255 , 255 , 255 ) ;
22
22
textSize ( 15 ) ;
23
- text ( "Show Video" , 30 , 85 ) ;
23
+ // text("Show Video", 30, 85);
24
24
pop ( ) ;
25
25
} else {
26
26
showVideoCheckbox . hide ( ) ;
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ class MusicPlayer{
32
32
if ( ! currentTrack . isPlaying ( ) ) {
33
33
currentTrack = null ;
34
34
}
35
+ /*
35
36
if(currentTrack==null){
36
37
if(this.isFirstTimePickingMusic){
37
38
currentTrack = music_Cages; //this is always the first track played
@@ -50,6 +51,22 @@ class MusicPlayer{
50
51
});
51
52
}
52
53
}
54
+ */
55
+
56
+ if ( currentTrack == null ) {
57
+ currentTrack = MusicPlayer . pickRandomTrack ( ) ;
58
+ console . log ( "picking new track" ) ;
59
+ currentTrack . setVolume ( 0.4 ) ;
60
+ var response = currentTrack . play ( ) ;
61
+ if ( response !== undefined ) {
62
+ response . then ( _ => {
63
+ //the sound should start playing
64
+ this . isFirstTimePickingMusic = false ;
65
+ } ) . catch ( error => {
66
+ //simply handle the rror
67
+ } ) ;
68
+ }
69
+ }
53
70
}
54
71
55
72
static pickRandomTrack ( ) {
Original file line number Diff line number Diff line change @@ -258,9 +258,9 @@ function setup() {
258
258
//this is specifically chose to fit the hand detection and for gameplay balance; changing may break things
259
259
createCanvas ( 1000 , 480 ) ; //this should come before anything that uses height/width
260
260
261
- showVideoCheckbox = createCheckbox ( ) ;
261
+ showVideoCheckbox = createCheckbox ( "Show Video" ) ;
262
262
//@ts -ignore
263
- showVideoCheckbox . position ( 10 , 70 ) ;
263
+ // showVideoCheckbox.position(10, 70);
264
264
//@ts -ignore
265
265
showVideoCheckbox . checked ( false ) ;
266
266
Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ html, body {
5
5
color : white;
6
6
}
7
7
8
+ input {
9
+
10
+ }
11
+
8
12
canvas {
9
13
display : block;
10
14
}
You can’t perform that action at this time.
0 commit comments