Как настроить обработку в Windows?

Опубликовано: 6 Сентября, 2022

Processing — это программное обеспечение с открытым исходным кодом, которое используется для сообществ Electronic Arts и визуального дизайна. Мы можем создавать различные виды искусства, используя наши навыки кодирования, такие как игры, анимация, физический движок и т. д.

Чтобы настроить обработку, выполните следующие действия:

Шаг 1: Загрузите обработку для Windows отсюда.

Шаг 2: Извлеките Zip-файл в любую папку и откройте файл обработки .exe.

Шаг 3: Откроется Processing IDE, где вы сможете написать свой код.

Пример :

Java




// Program to show moving Ball.
 
// Set up variable position,colour and velocity.
PVector pos;
PVector vel;
int col;
 
// Function to set up size of canvas
// and position,velocity and colour.
void setup(){
  size(600, 600);
  pos = new PVector(width/2, height/2);
  vel = new PVector(random(-4, 4), random(-4, 4));
  col = floor(random(0, 255));
}
 
// Function to draw eclipse.
void draw(){
  background(col);
  fill(231);
  checkValid();
  fill(204, 102, 0);
  ellipse(pos.x, pos.y, 50, 50);
  pos.add(vel);
}
 
// Function to check the position
// of ball must be within screen.
void checkValid(){
  if(pos.x <= 25 || pos.x >= width - 25){
    vel.x *= -1;
     
    // Change in colour when it hit the wall.
    col = floor(random(0 ,255));
  }
  if(pos.y <=25 || pos.y >= height - 25){
    vel.y *= -1;
     
    // Change in colour when it hit the wall.
    col = floor(random(0 ,255));
  }
   
}

Выход: