# Processing

**URL:** https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=55

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 56

---

## [Any game engine that support Processing Java](https://discourse.processing.org/t/any-game-engine-that-support-processing-java/21035)

<div class="topic-metadata">

**Author:** [@WolfRaj](https://discourse.processing.org/u/WolfRaj)\
**Replies:** 9\
**Last updated:** [December 11, 2022, 7:55pm UTC](https://discourse.processing.org/t/any-game-engine-that-support-processing-java/21035 "2022-12-11T19:55:58Z")

</div>

please format code with \</\> button \* homework policy \* asking questions please reply

---

## [How to Change Image RBG value when image hits x or y axis](https://discourse.processing.org/t/how-to-change-image-rbg-value-when-image-hits-x-or-y-axis/40114)

<div class="topic-metadata">

**Author:** [@Mikella](https://discourse.processing.org/u/Mikella)\
**Replies:** 2\
**Last updated:** [December 11, 2022, 6:22pm UTC](https://discourse.processing.org/t/how-to-change-image-rbg-value-when-image-hits-x-or-y-axis/40114 "2022-12-11T18:22:51Z")

</div>

Hi so I’m brand new to coding, just started maybe a week ago for a class. I’m trying to code the “dvd logo.png” image to hit a random RGB value when it hits the x and y borders of the window. So far it will load a random…

---

## [Converting JS (DTwitter) code into Processing](https://discourse.processing.org/t/converting-js-dtwitter-code-into-processing/40083)

<div class="topic-metadata">

**Author:** [@funnyrectangles](https://discourse.processing.org/u/funnyrectangles)\
**Replies:** 8\
**Last updated:** [December 11, 2022, 4:43pm UTC](https://discourse.processing.org/t/converting-js-dtwitter-code-into-processing/40083 "2022-12-11T16:43:34Z")

</div>

Hi, is it possible to convert this JS (Dtwitter) code into regular Processing code? function u(t) { T(\[0,0,c.width|=T=(A,i=0,z,p=S(t++)/3+.5)=\>i++\>12?x.strokeRect(...A):T(A=\[...A\],i,z=A\[2+i%2\]\*=p,T(A,i),A\[i%=2\]+=z,A\[2+…

---

## [Save as video from sketch](https://discourse.processing.org/t/save-as-video-from-sketch/40072)

<div class="topic-metadata">

**Author:** [@vrtx](https://discourse.processing.org/u/vrtx)\
**Replies:** 1\
**Last updated:** [December 11, 2022, 11:25am UTC](https://discourse.processing.org/t/save-as-video-from-sketch/40072 "2022-12-11T11:25:27Z")

</div>

Hi, i have being searching for days and i can not save my sketch as a video. Any help, please! here is the code: the sound has about 20 seconds. and there is a lots of lines as coment and code i’ve been tryed… I can …

---

## [ERROR: The constructor "......" does not exist](https://discourse.processing.org/t/error-the-constructor-does-not-exist/40116)

<div class="topic-metadata">

**Author:** [@onosecond](https://discourse.processing.org/u/onosecond)\
**Replies:** 3\
**Last updated:** [December 11, 2022, 3:06am UTC](https://discourse.processing.org/t/error-the-constructor-does-not-exist/40116 "2022-12-11T03:06:00Z")

</div>

Question \[\] questions; PImage \[\] bg; int nr\_img=10; int counter=0; void setup(){ size(600,600); String \[\] text=loadStrings("questions.txt");//load the file questions=new Question\[text.length\]; for(int i=0;i\<q…

---

## [The Processing doesn't Run the sketches in my new laptop](https://discourse.processing.org/t/the-processing-doesnt-run-the-sketches-in-my-new-laptop/40099)

<div class="topic-metadata">

**Author:** [@Anki](https://discourse.processing.org/u/Anki)\
**Replies:** 6\
**Last updated:** [December 11, 2022, 2:53am UTC](https://discourse.processing.org/t/the-processing-doesnt-run-the-sketches-in-my-new-laptop/40099 "2022-12-11T02:53:04Z")

</div>

please format code with \</\> button \* homework policy \* asking questions The Processing doesn’t Run the sketches in my new laptop, That tiny window that shows what you did doesn’t run in my new laptop although there’…

---

## [Updating stacked circles drawn with curveVertex() and for-loop](https://discourse.processing.org/t/updating-stacked-circles-drawn-with-curvevertex-and-for-loop/40097)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 2\
**Last updated:** [December 10, 2022, 2:00am UTC](https://discourse.processing.org/t/updating-stacked-circles-drawn-with-curvevertex-and-for-loop/40097 "2022-12-10T02:00:06Z")

</div>

Hello! :nerd\_face: In the current approach update() accesses only part of the circle’s vertices. But I need the last three vertices outside of the for-loop to complete the circle shape (I believe…). How can get all of …

---

## [Using multiple outputs in Minim - speaker output gets disabled](https://discourse.processing.org/t/using-multiple-outputs-in-minim-speaker-output-gets-disabled/40093)

<div class="topic-metadata">

**Author:** [@jcowhie](https://discourse.processing.org/u/jcowhie)\
**Replies:** 0\
**Last updated:** [December 9, 2022, 2:28pm UTC](https://discourse.processing.org/t/using-multiple-outputs-in-minim-speaker-output-gets-disabled/40093 "2022-12-09T14:28:02Z")

</div>

Hi, First time posting… Im a beginner but Im using minim library to create multiple outputs. I have the usb port working with speakers and the speakers on my Mac working. But when I plug a second set of speakers into…

---

## [Snake Game Code](https://discourse.processing.org/t/snake-game-code/1725)

<div class="topic-metadata">

**Author:** [@nofil7](https://discourse.processing.org/u/nofil7)\
**Replies:** 25\
**Last updated:** [December 9, 2022, 11:15am UTC](https://discourse.processing.org/t/snake-game-code/1725 "2022-12-09T11:15:14Z")

</div>

Snake Code assignment

---

## [Sort of a snake game problem with code](https://discourse.processing.org/t/sort-of-a-snake-game-problem-with-code/40076)

<div class="topic-metadata">

**Author:** [@taco1](https://discourse.processing.org/u/taco1)\
**Replies:** 4\
**Last updated:** [December 9, 2022, 8:33am UTC](https://discourse.processing.org/t/sort-of-a-snake-game-problem-with-code/40076 "2022-12-09T08:33:41Z")

</div>

Hello all, For school i have to make a kind of snake game. The game has the following rules: Rules of game: 1 player needs to make as many points before all particles of body dissapeared. game should be a field of 16…

---

## [Collision Detection Help / Once-over](https://discourse.processing.org/t/collision-detection-help-once-over/40059)

<div class="topic-metadata">

**Author:** [@moffmix](https://discourse.processing.org/u/moffmix)\
**Replies:** 2\
**Last updated:** [December 8, 2022, 6:52pm UTC](https://discourse.processing.org/t/collision-detection-help-once-over/40059 "2022-12-08T18:52:06Z")

</div>

Hi again! This is for a school assignment, but I was wondering if anyone could give my code a once-over for me / help me figure out the bug in the system. I’ve been following a wonderful tutorial by Long Nguyen (Tutorial…

---

## [Yolov5 into Processing Library](https://discourse.processing.org/t/yolov5-into-processing-library/37297)

<div class="topic-metadata">

**Author:** [@Clifford](https://discourse.processing.org/u/Clifford)\
**Replies:** 4\
**Last updated:** [December 8, 2022, 3:23pm UTC](https://discourse.processing.org/t/yolov5-into-processing-library/37297 "2022-12-08T15:23:02Z")

</div>

Hi Ive been using processing for sometime now one thing that interest me is the open cv application . is there is some way to incorporate ultralytics Yolo5v Vision AI into Processing and make it simple to implement . l…

---

## [The exported exe format does not work！](https://discourse.processing.org/t/the-exported-exe-format-does-not-work/40069)

<div class="topic-metadata">

**Author:** [@bile](https://discourse.processing.org/u/bile)\
**Replies:** 3\
**Last updated:** [December 8, 2022, 2:37pm UTC](https://discourse.processing.org/t/the-exported-exe-format-does-not-work/40069 "2022-12-08T14:37:17Z")

</div>

When I run the code in processing, it works, but when I export it to an executable file in exe format, it opens a gray window

---

## [HashMap Workaround](https://discourse.processing.org/t/hashmap-workaround/40018)

<div class="topic-metadata">

**Author:** [@moffmix](https://discourse.processing.org/u/moffmix)\
**Replies:** 5\
**Last updated:** [December 8, 2022, 4:48am UTC](https://discourse.processing.org/t/hashmap-workaround/40018 "2022-12-08T04:48:53Z")

</div>

Hello again! I’ve got another question for my Processing class. I found a great example in another forum on how to make a Choose Your Own Adventure game; I’m currently dissecting it and trying to make it my own, with the…

---

## [Using dist(); for collision detection](https://discourse.processing.org/t/using-dist-for-collision-detection/40050)

<div class="topic-metadata">

**Author:** [@LeckereKrokette](https://discourse.processing.org/u/LeckereKrokette)\
**Replies:** 6\
**Last updated:** [December 8, 2022, 2:12am UTC](https://discourse.processing.org/t/using-dist-for-collision-detection/40050 "2022-12-08T02:12:46Z")

</div>

Hello processing community. I want to make a mini game where you control a ellipse and have to avoid other ellipse. I first wanted the “opponents” to repel each other. For this I initialized 10 ellipses in an array. But …

---

## [Cannot find a class or type named “Enemy” -- How to Initialize an Array of Objects](https://discourse.processing.org/t/cannot-find-a-class-or-type-named-enemy-how-to-initialize-an-array-of-objects/40043)

<div class="topic-metadata">

**Author:** [@C2014](https://discourse.processing.org/u/C2014)\
**Replies:** 3\
**Last updated:** [December 7, 2022, 2:32pm UTC](https://discourse.processing.org/t/cannot-find-a-class-or-type-named-enemy-how-to-initialize-an-array-of-objects/40043 "2022-12-07T14:32:28Z")

</div>

int spawnTime=180; Enemy\[\] zombieArray; int zombiecount; int maxzombie=8; int i; void setup() { maxzombie=8; size(500,300); zombieArray = new Enemy\[maxzombie\]; } void draw(){ background (100); for ( Enemy zomb…

---

## [Snake game: start screen and two players](https://discourse.processing.org/t/snake-game-start-screen-and-two-players/39962)

<div class="topic-metadata">

**Author:** [@ALAL](https://discourse.processing.org/u/ALAL)\
**Replies:** 10\
**Last updated:** [December 7, 2022, 1:06pm UTC](https://discourse.processing.org/t/snake-game-start-screen-and-two-players/39962 "2022-12-07T13:06:38Z")

</div>

Heyy!! this is my first time and I’m a beginner. I have questions about sank game in processing. I have an exam next week so I hoop to found someone to help me. my question is how can I make a home start en a another s…

---

## [Convert camera from 3:2 to 16:9](https://discourse.processing.org/t/convert-camera-from-3-2-to-16-9/40041)

<div class="topic-metadata">

**Author:** [@illus](https://discourse.processing.org/u/illus)\
**Replies:** 14\
**Last updated:** [December 7, 2022, 12:57pm UTC](https://discourse.processing.org/t/convert-camera-from-3-2-to-16-9/40041 "2022-12-07T12:57:39Z")

</div>

Hi, I’m trying to convert an live camera image of 640x480 (3:2)to 640x360 (16:9) only to display it at a size of 1126x633 (still 16:9). Clearly it needs cropping, which is fine. But how? I have: if (cam.available() ) {…

---

## [Balls wait problem](https://discourse.processing.org/t/balls-wait-problem/40047)

<div class="topic-metadata">

**Author:** [@SYN1810](https://discourse.processing.org/u/SYN1810)\
**Replies:** 1\
**Last updated:** [December 7, 2022, 10:54am UTC](https://discourse.processing.org/t/balls-wait-problem/40047 "2022-12-07T10:54:56Z")

</div>

Hello, now I am making a game of hunting a ball, what happens is that the balls do not stay on the screen, but new ones are written continuously, I wanted to do it by myself but I have not succeeded, the objective is tha…

---

## [How to use Google calendar API with Processing desktop (Mac)](https://discourse.processing.org/t/how-to-use-google-calendar-api-with-processing-desktop-mac/39884)

<div class="topic-metadata">

**Author:** [@dehyde](https://discourse.processing.org/u/dehyde)\
**Replies:** 3\
**Last updated:** [December 6, 2022, 10:17pm UTC](https://discourse.processing.org/t/how-to-use-google-calendar-api-with-processing-desktop-mac/39884 "2022-12-06T22:17:25Z")

</div>

Hay all! I’m quite rusty with programming, processing and Java, hope somebody could help here: I’m trying to use google calendar’s API, but it’s using something called “gradle” to build and everything’s quite confusing…

---

## ['Rotate' gradient background](https://discourse.processing.org/t/rotate-gradient-background/39989)

<div class="topic-metadata">

**Author:** [@Erif](https://discourse.processing.org/u/Erif)\
**Replies:** 11\
**Last updated:** [December 6, 2022, 8:48pm UTC](https://discourse.processing.org/t/rotate-gradient-background/39989 "2022-12-06T20:48:23Z")

</div>

Hi, Quick simple question I’m sure but somehow I can’t manage to make it work. This code below shows a green to red gradient background from bottom left to top right. How can I make it go from bottom right to top left…

---

## [P3D: Window doesn't open](https://discourse.processing.org/t/p3d-window-doesnt-open/39965)

<div class="topic-metadata">

**Author:** [@martin1](https://discourse.processing.org/u/martin1)\
**Replies:** 4\
**Last updated:** [December 6, 2022, 4:12pm UTC](https://discourse.processing.org/t/p3d-window-doesnt-open/39965 "2022-12-06T16:12:01Z")

</div>

Whenever I open a P3D sketch and try to run it, a window opens as usual. However once I edit the sketch and try to run it, no window appears. There is a window icon on the task bar, however clicking on it doesn’t open …

---

## [Drawing Fibonacci Spiral with SVG that Changes Angles](https://discourse.processing.org/t/drawing-fibonacci-spiral-with-svg-that-changes-angles/40038)

<div class="topic-metadata">

**Author:** [@DDe](https://discourse.processing.org/u/DDe)\
**Replies:** 4\
**Last updated:** [December 6, 2022, 4:09pm UTC](https://discourse.processing.org/t/drawing-fibonacci-spiral-with-svg-that-changes-angles/40038 "2022-12-06T16:09:57Z")

</div>

Hey hey, obviously I’m new to proccessing but long story short, I am trying to replace the line/points drawn out for a Fibonnaci Spiral with an svg file of my design, but I’m struggling to make that work. I have some cod…

---

## [Bug? shapes in P2D](https://discourse.processing.org/t/bug-shapes-in-p2d/39976)

<div class="topic-metadata">

**Author:** [@zzabel8](https://discourse.processing.org/u/zzabel8)\
**Replies:** 1\
**Last updated:** [December 6, 2022, 8:53am UTC](https://discourse.processing.org/t/bug-shapes-in-p2d/39976 "2022-12-06T08:53:28Z")

</div>

When you run this code it draws a linear line and a ball that jumps around with ‘a’ and ‘d’. The line is drawn in the for loop. Running this works just fine, but if you change the conditional in the for loop to 1250 inst…

---

## [Calculation the color density of an image](https://discourse.processing.org/t/calculation-the-color-density-of-an-image/40021)

<div class="topic-metadata">

**Author:** [@jaspervb](https://discourse.processing.org/u/jaspervb)\
**Replies:** 5\
**Last updated:** [December 6, 2022, 1:11am UTC](https://discourse.processing.org/t/calculation-the-color-density-of-an-image/40021 "2022-12-06T01:11:14Z")

</div>

Hi There, Is there a way to calculate the percentages of the colors in an image, for example in a logo. If it is possible i want to translate those color percentage values into rectangles. I hope to hear from you. Ki…

---

## [Sort method of the Table Class doesn’t work correctly](https://discourse.processing.org/t/sort-method-of-the-table-class-doesn-t-work-correctly/40031)

<div class="topic-metadata">

**Author:** [@Schiffmann](https://discourse.processing.org/u/Schiffmann)\
**Replies:** 1\
**Last updated:** [December 5, 2022, 1:43pm UTC](https://discourse.processing.org/t/sort-method-of-the-table-class-doesn-t-work-correctly/40031 "2022-12-05T13:43:30Z")

</div>

Hello, I wrote a program that should sort a table according a column with int values that were initialised in descending order, starting with 100000. Unfortunately the result is wrong while by excel or numbers it can be…

---

## [Coding Train Tutorial 6.2 while loop question](https://discourse.processing.org/t/coding-train-tutorial-6-2-while-loop-question/40020)

<div class="topic-metadata">

**Author:** [@Siyue](https://discourse.processing.org/u/Siyue)\
**Replies:** 3\
**Last updated:** [December 4, 2022, 6:01pm UTC](https://discourse.processing.org/t/coding-train-tutorial-6-2-while-loop-question/40020 "2022-12-04T18:01:28Z")

</div>

float y=0; float x=0; void setup() { size(800, 800); } void draw() { background(200, 20, 90); y=0; while (y\<height) { if (mouseY\<1) { y=y+1; } else { y=mouseY+y; } } …

---

## [How can I rotate all of this](https://discourse.processing.org/t/how-can-i-rotate-all-of-this/40015)

<div class="topic-metadata">

**Author:** [@returng](https://discourse.processing.org/u/returng)\
**Replies:** 1\
**Last updated:** [December 3, 2022, 10:57pm UTC](https://discourse.processing.org/t/how-can-i-rotate-all-of-this/40015 "2022-12-03T22:57:25Z")

</div>

I want to rotate my snowflake with mouseX, here is the full code; float angle = 0; float cx; float cy; void setup() { size(640, 480); cx = 50; cy = height/2; noLoop(); } void draw() { background(255); …

---

## [PDF of P3D Processing sketch](https://discourse.processing.org/t/pdf-of-p3d-processing-sketch/39996)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 13\
**Last updated:** [December 4, 2022, 1:32am UTC](https://discourse.processing.org/t/pdf-of-p3d-processing-sketch/39996 "2022-12-04T01:32:41Z")

</div>

I’m finding it difficult to create a PDF from the PDF library when my sketch specifies P2D or P3D. What am I doing wrong? import processing.pdf.\*; boolean record; void setup(){ size(1500,800,P3D); frameRate(1); …

---

## [Does anyone know what is wrong with this program?](https://discourse.processing.org/t/does-anyone-know-what-is-wrong-with-this-program/40012)

<div class="topic-metadata">

**Author:** [@add](https://discourse.processing.org/u/add)\
**Replies:** 2\
**Last updated:** [December 3, 2022, 8:45pm UTC](https://discourse.processing.org/t/does-anyone-know-what-is-wrong-with-this-program/40012 "2022-12-03T20:45:44Z")

</div>

int h,m; void setup(){ size (800,600); frameRate(10); } void draw (){ // if (framec==0){ background (180); stroke (0); fill(255); rect (0,500,width,height);//chenar jos h=nf(hits); m=nf(misses); f…

[Previous page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=54)

[Next page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=56)
