Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
bencakir
bencakir's Profile
2
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Unexpected token help
[5 Replies]
29-Oct-2012 02:43 PM
Forum:
Programming Questions
I was messing around with switch statements when this occurred:
void setup() {
size(800, 800);
smooth();
background(255, 204, 0);
textFont(createFont("Serif", 25));
int iden = 0;
text("Press up to draw a shape, right to draw a name, and left to drag a name", 75, 75);
}
void keyPressed() {
if (key == CODED) {
if (keyCode == UP) {
int iden = 1;
}
else if (keyCode == RIGHT) {
int iden == 2;
}
else if (keyCode == LEFT) {
int iden == 3;
}
else {
int iden == 4;
}
}
void draw() {
switch(iden)
{
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
default:
println("WORK!!");
break;
}
}
I am getting a "unexpected token: int" at "int iden = 2"
Any suggestions?
have some shapes drawn, how to consolidate them into one?
[1 Reply]
18-Oct-2012 03:06 PM
Forum:
Programming Questions
I drew my name out of lines and shape as follows
size(830, 620);
strokeWeight(6);
smooth();
strokeCap(ROUND);
strokeJoin(ROUND);
//the B
rect(50, 120, 1, 200);
endShape();
arc(51, 270, 110, 110, PI+HALF_PI, TWO_PI+QUARTER_PI+QUARTER_PI);
arc(51, 162, 90, 90, PI+HALF_PI, TWO_PI+QUARTER_PI+QUARTER_PI);
noFill();
// the E
arc(185, 260, 120, 120, HALF_PI, HALF_PI+PI);
line(125, 260, 185, 260);
// the N
rect(220, 200, 1, 120);
arc(220, 270, 150, 150, PI+HALF_PI, TWO_PI+QUARTER_PI);
// the C
arc(375, 435, 150, 150, HALF_PI, PI+HALF_PI);
// the A
triangle(435, 370, 460, 440, 410, 440);
line(460, 440, 475, 500);
line(410, 440, 390, 500);
beginShape();// the K
vertex(500, 370);
vertex(500, 440);
vertex(540, 370);
vertex(500, 440);
vertex(540, 520);
vertex(500, 440);
vertex(500, 520);
endShape();
// the I
quad(570, 370, 570.5, 370, 570.5, 520, 570, 520);
// the R
quad(610, 370, 610.5, 370, 610.5, 520, 610, 520);
triangle(610, 370, 610, 450, 660, 410);
line(610, 450, 660, 520);
Now for a separate project, I want to turn all these things into one individual shape so that i can move it around with the mouse. (which needs to be with ifs)
«Prev
Next »
Moderate user : bencakir
Forum