I'm making somewhat of a clone of
clicktagon in Processing.js. I'm writing in PDE so when I run it in normal Java mode, it runs fine, but when I export it to processing.js, the screen is static and when I open the console in Chrome I get this error:
Uncaught TypeError: boolean is not a function
First of all, it points to line 148, where I call display(). Maybe I'm looking at the wrong file? What's going on?!
P.S. I was working on an XML import/export thing, but I don't think it's the problem. Ignoring it might be a better option.
/* @pjs font="Impact.ttf"; */
/*
[ ] Framerate
[ ] Mouse collision
[x] Equalize lengths
[ ] Win screen
*/
ArrayList<Poly> polys = new ArrayList<Poly>();
int score = 0;
int highscore = 0;
float padding = 100;
int currentBatch = 0;
ArrayList<ArrayList<Poly>> batches = new ArrayList<ArrayList<Poly>>();
In the reference there is a
page, that refers to a clear() function for PGraphics. But when I try to use it on a simple PGraphics instance, it says that "The function clear() does not exist." My problem is as simple as that.
If this function does turnout to be nonexistent, then what would an alternative be? I've tried the things that were mentioned in
this post.
I have a class called Bubble. I want to replace "i" in the "for" statement in my draw function with bubble size. Also I don't know what is supposed to be in the pair of parentheses in "Bubble myBubble = new Bubble();". As you can tell I don't really know anything: help!
I am trying to make a starting screen for a game with Object-Oriented Programming. It is pretty much my first shot at OOP so I am obviously having some problems. Processing highlights the yellow area and says "Syntax error, maybe a missing semicolon?" What's the problem? There is a semicolon there so...
PFont f;
class Button{
int X1; //Coordinates for rectangle.
int Y1;
int X2 = X1+200;
int Y2 = Y1+30;
int XB = X1+10; //Coordinates for text in rectangle
int YB = Y1+10;
String buttonText; //String for actual text of button
Button(){ //Constructor method
rect(X1,Y1,X2,Y2); //Outline of Button
textFont(f,24); //Establishing font and text
fill(0);
text(buttonText,XB,YB);
}
}
void setup(){
size(400,400); //Screen size
f = loadFont("Dialog-48.vlw"); //Loading font
Button startGame = new Button; //New "Start Game" Button.
I am making a simple game where you pop bubbles as a mouse for a little beginners project.
When I try to run it I get an error saying "unexpected token: {". I highlights the code I have made yellow below. Why is this, and more importantly, how can I fix it?
I am a real noobie at programming, so don't kill me for this.
I am trying to make a simple game where you click expanding bubbles and they disappear. I am having trouble with writing a conditional where the condition is that the 1) the mouse has to be pressed and 2) it has to be within the bubble.