Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
nautist
nautist's Profile
1
Posts
0
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
Pac Man Blinky code
[1 Reply]
22-Sep-2011 12:07 PM
Forum:
Programming Questions
Can someone post the code to make Blinky look left and right by clicking the mouse? Here's what I have so far.
int look = 2;
void setup(){
size(200,200);
noStroke();
}
void draw(){
fill(255,0,0);
rect(50,70,10,90); // from left, bar 1
rect(60,40,10,130); // from left, bar 2
rect(70,30,10,140); // from left, bar 3
rect(80,20,10,140); // from left, bar 4
rect(90,20,10,130); // from left, bar 5
rect(100,10,10,150); // from left, bar 6
rect(110,10,10,160); // from left, bar 7
rect(120,10,10,160); // from left, bar 8
rect(130,10,10,150); // from left, bar 9
rect(140,20,10,130); // from left, bar 10
rect(150,20,10,140); // from left, bar 11
rect(160,30,10,140); // from left, bar 12
rect(170,40,10,130); // from left, bar 13
rect(180,70,10,90); // from left, bar 14
// eyes
fill(255,255,255);
rect(60+look*10,50,10,30);
rect(70+look*10,40,10,50);
rect(80+look*10,40,10,50);
rect(90+look*10,50,10,30);
rect(120+look*10,50,10,30);
rect(130+look*10,40,10,50);
rect(140+look*10,40,10,50);
rect(150+look*10,50,10,30);
fill(0,0,255);
rect(60+look*20,60,20,20); // left pupil
rect(120+look*20,60,20,20); // right pupil
}
«Prev
Next »
Moderate user : nautist
Forum