Loading...
Logo
Processing Forum
antonioferreira85's Profile
2 Posts
4 Responses
0 Followers

Activity Trend

Last 30 days
Show:
Private Message
    Hey guys,

    I'm learning about easing in processing, but I'm getting terrible headaches to make this work, with something that might be simple to do.. so, with this exercise, how can I make the ball slow down the velocity while it goes to the stage width lenght??

    1. float x = 0;
    2. float speed = 5;

    3. void setup(){
    4.   size(200,200);
    5.   smooth();
    6.   frameRate(30);
    7. }

    8. void draw() {
    9.   background(255);
    10.   x = x + speed;
    11.   
    12.   if (x>width){
    13.     x = width;
    14.   }
    15.   //display circle at X location
    16.   stroke(0);
    17.   fill(175);
    18.   ellipse(x,100,32,32);
    19. }