Skip to content

Commit ba1dbce

Browse files
committed
fixed show video checkbox going invisible
1 parent 5cdf396 commit ba1dbce

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

gameobjects/videofeed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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();

musicplayer.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff 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(){

sketch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ html, body {
55
color: white;
66
}
77

8+
input {
9+
10+
}
11+
812
canvas {
913
display: block;
1014
}

0 commit comments

Comments
 (0)