hi, I was working on updating my code for my tictactoe, I’m only a beginner and thought this would be a good place to start, the game used to work, but when I added the minim library and set up a song to play in the background, all hell came loose. The version you have here is one where i disabled all elements of minim, whether it was enabled or disabled, it would still do 2 things, when I clicked, it would not produce X/O or print in the console and when it was enabled no song would play. The size of the canvas is the same as the XOB (XO board)
/*import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.signals.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;
import ddf.minim.*;
Minim minim;
AudioPlayer player;*/
PImage X;
PImage O;
PImage XOB;
boolean Xb = true;
boolean Ob = false;
void setup() {
size(800,600);
X = loadImage("X.png");
O = loadImage("O.png");
XOB = loadImage("XOB.png");
image(XOB,0,0);
/* minim = new Minim(this);
player = minim.loadFile("RetroVision.mp3", 1000);
player.play();
player.loop();*/
}
void mousePressed() {
if (Xb == true) {image(X,mouseX,mouseY,120,120); Xb = false; Ob = true; println("X");}
else if (Ob == true) {image(O,mouseX,mouseY,120,120); Ob = false; Xb = true; println("O");}
}
void keyPressed() {
if (key == 'r' || key == 'R') {background(255); image(XOB,0,0);}
/*else if (player.isPlaying() && key == 'p' || key == 'P') {player.pause(); };
if (key == 'o') {player.play();}*/
}
please dont go too hard on me if it is obvious as I am not experienced in processing