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 {
2020 textAlign ( LEFT ) ;
2121 fill ( 255 , 255 , 255 ) ;
2222 textSize ( 15 ) ;
23- text ( "Show Video" , 30 , 85 ) ;
23+ // text("Show Video", 30, 85);
2424 pop ( ) ;
2525 } else {
2626 showVideoCheckbox . hide ( ) ;
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ class MusicPlayer{
3232 if ( ! currentTrack . isPlaying ( ) ) {
3333 currentTrack = null ;
3434 }
35+ /*
3536 if(currentTrack==null){
3637 if(this.isFirstTimePickingMusic){
3738 currentTrack = music_Cages; //this is always the first track played
@@ -50,6 +51,22 @@ class MusicPlayer{
5051 });
5152 }
5253 }
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+ }
5370 }
5471
5572 static pickRandomTrack ( ) {
Original file line number Diff line number Diff line change @@ -258,9 +258,9 @@ function setup() {
258258 //this is specifically chose to fit the hand detection and for gameplay balance; changing may break things
259259 createCanvas ( 1000 , 480 ) ; //this should come before anything that uses height/width
260260
261- showVideoCheckbox = createCheckbox ( ) ;
261+ showVideoCheckbox = createCheckbox ( "Show Video" ) ;
262262 //@ts -ignore
263- showVideoCheckbox . position ( 10 , 70 ) ;
263+ // showVideoCheckbox.position(10, 70);
264264 //@ts -ignore
265265 showVideoCheckbox . checked ( false ) ;
266266
Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ html, body {
55 color : white;
66}
77
8+ input {
9+
10+ }
11+
812canvas {
913 display : block;
1014}
You can’t perform that action at this time.
0 commit comments