Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
mohammed saleh
mohammed saleh's Profile
1
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
HEElp i dont understand this code well can someone give explaind it ??
[5 Replies]
28-Sep-2013 01:15 PM
Forum:
General Discussion
int x=0; int y=0; int z=0; float rot=0; int velocidad=25; void setup() { size(800,500); smooth(); frameRate(8); } void draw() { background(#213454); fill(255,255,0); if(z==0) { z=1; arc(200+x,200+y,100,100,QUARTER_PI+rot,TWO_PI-QUARTER_PI+rot); } else if(z==1) { z=2; arc(200+x,200+y,100,100,QUARTER_PI-0.4+rot,TWO_PI-QUARTER_PI+0.4+rot); } else { z=0; arc(200+x,200+y,100,100,0+rot,TWO_PI+rot); } { x=-200; } if(200+x) { x=width-200; } if(200+y) { y=height-200; } { y=-200; } //fill(0); //arc(185+x,185+y,10,25,0+rot,TWO_PI-HALF_PI+rot); } void keyPressed() { if(keyCode==RIGHT) { x=x+velocidad; rot=0; } if(keyCode==LEFT) { x=x-velocidad; rot=PI; } if(keyCode==UP) { y=y-velocidad; rot=-HALF_PI; } if(keyCode==DOWN) { y=y+velocidad; rot=HALF_PI; } }
«Prev
Next »
Moderate user : mohammed saleh
Forum