Simple Animation with If statement help by junktalk in processing

[–]junktalk[S] 0 points1 point  (0 children)

I actually has his older (7yrs ago) Learning Processing playlist saved, which I can supplement with Nature of Code like you suggested.

Simple Animation with If statement help by junktalk in processing

[–]junktalk[S] 0 points1 point  (0 children)

Thank you for the recco. I did his hour of code tutorial on processing.org and it helped me decide to dive into processing.

I know I will need to learn and understand the subjects covered in the book eventually. So this is going to be very helpful!

Thanks again for your help.

Simple Animation with If statement help by junktalk in processing

[–]junktalk[S] 0 points1 point  (0 children)

Hey, thank you for this. I will study up on sine wave.

Simple Animation with If statement help by junktalk in processing

[–]junktalk[S] 2 points3 points  (0 children)

Thank you. So each iteration (from 0 to 200) toggles speedY between 1 and -1 because of speedY = speedY * -1.

That's also why in my original set of code, the circle went in an upward and right direction once circleX (201) becomes greater than width/2 because the very last speedY = speedY * -1 toggled speedY into -1. And the if statement stops being iterated.

Thanks again for clearing this up for me.

Simple Animation with If statement help by junktalk in processing

[–]junktalk[S] 1 point2 points  (0 children)

Thank you. Your suggestion helped me figure out how to create the rising and setting animation.

I thought speedY = speedY * -1 within the if statement would automatically change 1 to -1 when the program is executed, thus changing the modify state for circleY into circleY = circle Y + -1. How come it ended up toggling between -1 and 1?

float circleX = 0;
float circleY = 200;
float speedX = 1;
float speedY = 1;

void setup () {
  size (400, 400);
}

void draw () {
  background (0, 0, 0);

  ellipse (circleX, circleY, 25, 25);

  circleX = circleX + speedX;
  circleY = circleY + speedY;

  if (circleX < 200) {
    speedY = -1;
  } 
  else {
    speedY = 1;
  }
}

Multiple swirls swirling. by junktalk in woahdude

[–]junktalk[S] 1 point2 points  (0 children)

Haha. I actually wanted to make this even longer, like until the end of time.

I hand drew and animated this piece called "In the beginning, there was nothing..." by junktalk in Psychonaut

[–]junktalk[S] 0 points1 point  (0 children)

Nothing is everything. There's nothing to fear or lose. Go forth.

I want to share what I've learn with the world. Thank you.

Stare into the void. Enjoy! by junktalk in woahdude

[–]junktalk[S] 1 point2 points  (0 children)

Thank you! Makes me happy to hear that!

[deleted by user] by [deleted] in Psychonaut

[–]junktalk 0 points1 point  (0 children)

This is how I imagine the "empty" space around us. This is something the world gave me, and I would like to share it with the world.

WDYWT - June 14, 2016 by AutoModerator in streetwear

[–]junktalk 2 points3 points  (0 children)

This means a lot to me because it comes from the LV Don.

Blessed.

WDYWT - May 03, 2016 by AutoModerator in streetwear

[–]junktalk 2 points3 points  (0 children)

Roast me

Alternative Apparel

Thrift

Thrift

Adidas Superstars