# Processing

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

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

**Page:** 226

---

## [Verbose code (how to shorten)](https://discourse.processing.org/t/verbose-code-how-to-shorten/19018)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 4\
**Last updated:** [March 28, 2020, 1:37am UTC](https://discourse.processing.org/t/verbose-code-how-to-shorten/19018 "2020-03-28T01:37:43Z")

</div>

I have this sketch (see below). Everything works, the green balls are healthy, the red balls are sick, if a green ball and a red ball collide the red ball infects the green ball and they both end up sick. After a while a…

---

## [Rotating images without interfering with translation (new to coding!)](https://discourse.processing.org/t/rotating-images-without-interfering-with-translation-new-to-coding/19003)

<div class="topic-metadata">

**Author:** [@semi\_cologne](https://discourse.processing.org/u/semi_cologne)\
**Replies:** 4\
**Last updated:** [March 27, 2020, 11:13pm UTC](https://discourse.processing.org/t/rotating-images-without-interfering-with-translation-new-to-coding/19003 "2020-03-27T23:13:14Z")

</div>

Hey coders, I’m working on a clock using a png image. every second the image moves vertically, but every minute I am trying to make the image rotate. That said even with experimenting with push and pop matrixes, I still …

---

## [Trying to write a simple snake game with arrays but I run into an error](https://discourse.processing.org/t/trying-to-write-a-simple-snake-game-with-arrays-but-i-run-into-an-error/19065)

<div class="topic-metadata">

**Author:** [@creedin](https://discourse.processing.org/u/creedin)\
**Replies:** 2\
**Last updated:** [March 27, 2020, 8:25pm UTC](https://discourse.processing.org/t/trying-to-write-a-simple-snake-game-with-arrays-but-i-run-into-an-error/19065 "2020-03-27T20:25:11Z")

</div>

float\[\] xpos; float\[\] ypos; void setup() { size(500,500); } void draw() { background(255); for (int i = 0; i \< xpos.length - 1; i++) { xpos\[i\] = xpos\[i + 1\]; ypos\[i\] = ypos\[i + 1\]; } xpos\[xpos.lengt…

---

## [Square with resizeable rectangles inside](https://discourse.processing.org/t/square-with-resizeable-rectangles-inside/14482)

<div class="topic-metadata">

**Author:** [@BooWseR](https://discourse.processing.org/u/BooWseR)\
**Replies:** 8\
**Last updated:** [March 27, 2020, 8:21pm UTC](https://discourse.processing.org/t/square-with-resizeable-rectangles-inside/14482 "2020-03-27T20:21:27Z")

</div>

Hi Guys, i’m pretty new with processing and have a problem: I need a square with different squares in it. These should be changeable in size, but not smaller than a certain minimum size. I have tried different approach…

---

## [How to delete an object in a class?](https://discourse.processing.org/t/how-to-delete-an-object-in-a-class/19067)

<div class="topic-metadata">

**Author:** [@Cybernet](https://discourse.processing.org/u/Cybernet)\
**Replies:** 7\
**Last updated:** [March 27, 2020, 5:32pm UTC](https://discourse.processing.org/t/how-to-delete-an-object-in-a-class/19067 "2020-03-27T17:32:15Z")

</div>

So I have a class that is a bullet. And if the bullet is out of bound, then it will delete the object. But how do I do this? Here is my code. class Bullet { if (xpos \> 500 || ypos \> 500) delete object // how…

---

## [Instantiate variable of outside class](https://discourse.processing.org/t/instantiate-variable-of-outside-class/19088)

<div class="topic-metadata">

**Author:** [@Dennis](https://discourse.processing.org/u/Dennis)\
**Replies:** 3\
**Last updated:** [March 27, 2020, 5:30pm UTC](https://discourse.processing.org/t/instantiate-variable-of-outside-class/19088 "2020-03-27T17:30:43Z")

</div>

GoodMorning, I have a question about of usage this parameter in contructor class. My minimal code is: import processing.video.\*; class MediaLoad { File file; Movie mov; MediaLoad (File \_file) { \_file = file; …

---

## [Switching from keypressed to using an array](https://discourse.processing.org/t/switching-from-keypressed-to-using-an-array/19053)

<div class="topic-metadata">

**Author:** [@MichelO](https://discourse.processing.org/u/MichelO)\
**Replies:** 1\
**Last updated:** [March 26, 2020, 8:39pm UTC](https://discourse.processing.org/t/switching-from-keypressed-to-using-an-array/19053 "2020-03-26T20:39:54Z")

</div>

I have code that draws a multi-colored spiral pattern with different line lengths and colors depending on which number keys are pressed. I would like to change this to reading the numbers from an array, but I am having s…

---

## [My decimal is too small](https://discourse.processing.org/t/my-decimal-is-too-small/19041)

<div class="topic-metadata">

**Author:** [@Cybernet](https://discourse.processing.org/u/Cybernet)\
**Replies:** 8\
**Last updated:** [March 27, 2020, 9:06am UTC](https://discourse.processing.org/t/my-decimal-is-too-small/19041 "2020-03-27T09:06:12Z")

</div>

Here is my example of my code: value = -1 / (value1 - value2); println(xdirection); It is very simple. I am trying to take the negative reciprocal of a value. But the number is too small, and when I try to print the v…

---

## [Processing 3 : two windows at time , one 2d and one 3d](https://discourse.processing.org/t/processing-3-two-windows-at-time-one-2d-and-one-3d/19019)

<div class="topic-metadata">

**Author:** [@Bob63](https://discourse.processing.org/u/Bob63)\
**Replies:** 2\
**Last updated:** [March 27, 2020, 2:17am UTC](https://discourse.processing.org/t/processing-3-two-windows-at-time-one-2d-and-one-3d/19019 "2020-03-27T02:17:26Z")

</div>

Hi, I’m quite new of Processing 3,and is my first post in the forum. I’m working on a project that require two windows , one 2D and one 3d. The 2D window will be used to display a series of fata coming from a serial por…

---

## [Plotting Parametric Equations](https://discourse.processing.org/t/plotting-parametric-equations/18947)

<div class="topic-metadata">

**Author:** [@rubbs](https://discourse.processing.org/u/rubbs)\
**Replies:** 3\
**Last updated:** [March 26, 2020, 11:04pm UTC](https://discourse.processing.org/t/plotting-parametric-equations/18947 "2020-03-26T23:04:06Z")

</div>

Hello, I believe that I have almost correctly drawn-out a hyperbolic helicoid: (https://mathworld.wolfram.com/HyperbolicHelicoid.html). But there is some odd behavior, I think it’s because I am not calculating torsion…

---

## [Game speed after certain score is reached](https://discourse.processing.org/t/game-speed-after-certain-score-is-reached/19043)

<div class="topic-metadata">

**Author:** [@Banana132](https://discourse.processing.org/u/Banana132)\
**Replies:** 4\
**Last updated:** [March 26, 2020, 10:16pm UTC](https://discourse.processing.org/t/game-speed-after-certain-score-is-reached/19043 "2020-03-26T22:16:28Z")

</div>

Hi there, I am creating a game where the player has to avoid some asteriods, and gain a good score. After going past a certain score, the game speed increases. At the moment i have this playerScore.countUp(); textAl…

---

## [ArrayIndexOutOfBoundsException: 168270](https://discourse.processing.org/t/arrayindexoutofboundsexception-168270/19057)

<div class="topic-metadata">

**Author:** [@jojo1515](https://discourse.processing.org/u/jojo1515)\
**Replies:** 2\
**Last updated:** [March 26, 2020, 10:07pm UTC](https://discourse.processing.org/t/arrayindexoutofboundsexception-168270/19057 "2020-03-26T22:07:06Z")

</div>

Hey guys I have been trying to manipulate pixels on an image, following the youtube tutorial: https://www.youtube.com/watch?v=j-ZLDEnhT3Q by the Coding Train. I can’t seem to get it to work. Error code reads… ArrayInde…

---

## [If statements within an array of digits](https://discourse.processing.org/t/if-statements-within-an-array-of-digits/18507)

<div class="topic-metadata">

**Author:** [@MichelO](https://discourse.processing.org/u/MichelO)\
**Replies:** 6\
**Last updated:** [March 26, 2020, 7:54pm UTC](https://discourse.processing.org/t/if-statements-within-an-array-of-digits/18507 "2020-03-26T19:54:40Z")

</div>

I am trying to have different things happen depending on what digit is called in an array–in this case, different colored lines. I am not sure how to code the if statement to recognize a particular digit. This is what I …

---

## [How to draw a continuous line with sensor values from Arduino](https://discourse.processing.org/t/how-to-draw-a-continuous-line-with-sensor-values-from-arduino/19033)

<div class="topic-metadata">

**Author:** [@Gbouna](https://discourse.processing.org/u/Gbouna)\
**Replies:** 2\
**Last updated:** [March 26, 2020, 2:23pm UTC](https://discourse.processing.org/t/how-to-draw-a-continuous-line-with-sensor-values-from-arduino/19033 "2020-03-26T14:23:46Z")

</div>

Hello; I’m so new to processing and I need help with my code. Basically i have a sensor connected to Arduino that sends out data of an array of data. I’m able to send the data to processing and gets them converted to i…

---

## [Circles that will disappear when the mouse hovers](https://discourse.processing.org/t/circles-that-will-disappear-when-the-mouse-hovers/19035)

<div class="topic-metadata">

**Author:** [@lozozo](https://discourse.processing.org/u/lozozo)\
**Replies:** 1\
**Last updated:** [March 26, 2020, 1:31pm UTC](https://discourse.processing.org/t/circles-that-will-disappear-when-the-mouse-hovers/19035 "2020-03-26T13:31:16Z")

</div>

Hi, I am new to coding, I’ve only just starting being taught it. I need to create a project - I have an idea for it but am unsure how to create it. Essentially I want to create a line of circles going vertically down t…

---

## [Fade Effect - What's with the ghost?](https://discourse.processing.org/t/fade-effect-whats-with-the-ghost/18891)

<div class="topic-metadata">

**Author:** [@Tomfoolery](https://discourse.processing.org/u/Tomfoolery)\
**Replies:** 14\
**Last updated:** [March 26, 2020, 8:57am UTC](https://discourse.processing.org/t/fade-effect-whats-with-the-ghost/18891 "2020-03-26T08:57:21Z")

</div>

My intention is to create a fade effect for thousands of shapes on the canvas (They appear, and then fade into blackness). This is the solution I came up with, and have found other people using. void draw() { fill(…

---

## [Is there a way to set an "internal" timer?](https://discourse.processing.org/t/is-there-a-way-to-set-an-internal-timer/19022)

<div class="topic-metadata">

**Author:** [@Cybernet](https://discourse.processing.org/u/Cybernet)\
**Replies:** 1\
**Last updated:** [March 26, 2020, 1:47am UTC](https://discourse.processing.org/t/is-there-a-way-to-set-an-internal-timer/19022 "2020-03-26T01:47:57Z")

</div>

So I’m making a game where a character shoots. And I need a delay between bullet shots. However, I don’t want to use delay(x) since that will affect the entire game. Can I set a delay inside my void ShootBullet() functi…

---

## [Crackling Noise Bug](https://discourse.processing.org/t/crackling-noise-bug/18021)

<div class="topic-metadata">

**Author:** [@LordCacops](https://discourse.processing.org/u/LordCacops)\
**Replies:** 15\
**Last updated:** [March 25, 2020, 3:58am UTC](https://discourse.processing.org/t/crackling-noise-bug/18021 "2020-03-25T03:58:33Z")

</div>

Hello, I am working on a sketch that activates sound files, but after a while I get a crackling noise that then won’t go away. I believe this happens when too many files are attempted to be played at once. Instead of th…

---

## [How do I make mouse controlled paddle stop glitching](https://discourse.processing.org/t/how-do-i-make-mouse-controlled-paddle-stop-glitching/18922)

<div class="topic-metadata">

**Author:** [@WeeBoEtte](https://discourse.processing.org/u/WeeBoEtte)\
**Replies:** 4\
**Last updated:** [March 25, 2020, 1:12am UTC](https://discourse.processing.org/t/how-do-i-make-mouse-controlled-paddle-stop-glitching/18922 "2020-03-25T01:12:55Z")

</div>

I’m am trying to make a pong game where one player controls with the mouse and the other controls with the keyboard. I got my mouse to move the paddle, but it keeps glitching to different places on the screen. Any ideas? …

---

## [PGraphics behaving unexpectedly](https://discourse.processing.org/t/pgraphics-behaving-unexpectedly/18710)

<div class="topic-metadata">

**Author:** [@hamoid](https://discourse.processing.org/u/hamoid)\
**Replies:** 6\
**Last updated:** [March 25, 2020, 1:02am UTC](https://discourse.processing.org/t/pgraphics-behaving-unexpectedly/18710 "2020-03-25T01:02:14Z")

</div>

Hi there, This is no longer behaving as it used to. If I’m not too sleepy, this program should draw a black screen, but I see it magenta. If inside draw() I remove everything except image(...) then it’s black. PGraphic…

---

## [Trigger animation effect after object collision](https://discourse.processing.org/t/trigger-animation-effect-after-object-collision/18811)

<div class="topic-metadata">

**Author:** [@codingcomplexity](https://discourse.processing.org/u/codingcomplexity)\
**Replies:** 14\
**Last updated:** [March 24, 2020, 11:42pm UTC](https://discourse.processing.org/t/trigger-animation-effect-after-object-collision/18811 "2020-03-24T23:42:36Z")

</div>

I want to create a “pulse” effect after objects collide with each other. The intended effect in this example is that when the particles collide (come within a certain distance from each other) an ellipse appears, grows t…

---

## [KeyPressed() for multiple keys pressed at the same time](https://discourse.processing.org/t/keypressed-for-multiple-keys-pressed-at-the-same-time/18892)

<div class="topic-metadata">

**Author:** [@graysonh](https://discourse.processing.org/u/graysonh)\
**Replies:** 7\
**Last updated:** [March 24, 2020, 9:47pm UTC](https://discourse.processing.org/t/keypressed-for-multiple-keys-pressed-at-the-same-time/18892 "2020-03-24T21:47:35Z")

</div>

Hi everyone, I’m running into a confusing issue with the keyPressed() function when I have multiple keys pressed at the same time. It seems like after two or more keys are pressed the keyPressed() functionality no longe…

---

## [Draw shape performance drop when iterating over children](https://discourse.processing.org/t/draw-shape-performance-drop-when-iterating-over-children/18972)

<div class="topic-metadata">

**Author:** [@LuisFerreira](https://discourse.processing.org/u/LuisFerreira)\
**Replies:** 3\
**Last updated:** [March 24, 2020, 4:59pm UTC](https://discourse.processing.org/t/draw-shape-performance-drop-when-iterating-over-children/18972 "2020-03-24T16:59:34Z")

</div>

Hi, i have a question regarding the way Processing draws 3D shapes. I have a complex 3D model (121521 polygons), where the “top level” shape is a group and all children are triangles. When i draw this model with the bui…

---

## [Help with Shapes (Smiley Face)](https://discourse.processing.org/t/help-with-shapes-smiley-face/18978)

<div class="topic-metadata">

**Author:** [@tengtengloves](https://discourse.processing.org/u/tengtengloves)\
**Replies:** 2\
**Last updated:** [March 24, 2020, 4:12pm UTC](https://discourse.processing.org/t/help-with-shapes-smiley-face/18978 "2020-03-24T16:12:03Z")

</div>

Hi all, I’m lost with my assignment. I would like to create this flower petal with smiley face but I not sure how to process. I need someone to help, thanks!

---

## [Processing and Max Msp - Send data from Processing to Max Msp](https://discourse.processing.org/t/processing-and-max-msp-send-data-from-processing-to-max-msp/3364)

<div class="topic-metadata">

**Author:** [@Davide](https://discourse.processing.org/u/Davide)\
**Replies:** 4\
**Last updated:** [March 24, 2020, 3:16pm UTC](https://discourse.processing.org/t/processing-and-max-msp-send-data-from-processing-to-max-msp/3364 "2020-03-24T15:16:27Z")

</div>

Hello everyone, it’s been a few weeks since I’m trying to send the values of some variables from Processing to Max Msp through the Oscp5 library. Being a newcomer in programming with java and processing, and not being a…

---

## [VIDEO IP (NewTek NDI)](https://discourse.processing.org/t/video-ip-newtek-ndi/16037)

<div class="topic-metadata">

**Author:** [@Romain](https://discourse.processing.org/u/Romain)\
**Replies:** 15\
**Last updated:** [March 24, 2020, 2:27pm UTC](https://discourse.processing.org/t/video-ip-newtek-ndi/16037 "2020-03-24T14:27:07Z")

</div>

Hi ! Is there any new solutions for ip video in Processing 3 ? I know the good library “ip capture” but only for receiving video, is there now the possibility to integrate the very good new tech NDI in processing for ex…

---

## [Order of using mult(0) & add() for vectors in processing](https://discourse.processing.org/t/order-of-using-mult-0-add-for-vectors-in-processing/18925)

<div class="topic-metadata">

**Author:** [@Ruchi](https://discourse.processing.org/u/Ruchi)\
**Replies:** 3\
**Last updated:** [March 24, 2020, 8:31am UTC](https://discourse.processing.org/t/order-of-using-mult-0-add-for-vectors-in-processing/18925 "2020-03-24T08:31:45Z")

</div>

I am sorry in advance if this is a trivial question as I am confused with the output displayed. void setup(){ size(800,800); } void draw(){ background(0); //PVector v = PVector.fromAngle(PI); PVector v = new …

---

## [Dijkstra Algorithm - Could not run sketch](https://discourse.processing.org/t/dijkstra-algorithm-could-not-run-sketch/18943)

<div class="topic-metadata">

**Author:** [@Aloxion](https://discourse.processing.org/u/Aloxion)\
**Replies:** 3\
**Last updated:** [March 23, 2020, 11:11pm UTC](https://discourse.processing.org/t/dijkstra-algorithm-could-not-run-sketch/18943 "2020-03-23T23:11:07Z")

</div>

Full ERROR code: IndexOutOfBoundsException: Index: 109, Size: 88 Could not run the sketch (Target VM failed to initialize). So im having a problem with my program/project. I am a bit new, so if you have any other su…

---

## [Processing Kotlin Syphon Gradle](https://discourse.processing.org/t/processing-kotlin-syphon-gradle/18927)

<div class="topic-metadata">

**Author:** [@membranobruno](https://discourse.processing.org/u/membranobruno)\
**Replies:** 5\
**Last updated:** [March 23, 2020, 7:37pm UTC](https://discourse.processing.org/t/processing-kotlin-syphon-gradle/18927 "2020-03-23T19:37:58Z")

</div>

Hi. I’m experimenting with Kotlin and Processing. So, I have made the project with gradle and kotlin and the processing as the library. Also I use the shadowJar plugin to bundle the fatJar for distribution. Everything wo…

---

## [Ip5 Error Check event (solved)](https://discourse.processing.org/t/ip5-error-check-event-solved/18932)

<div class="topic-metadata">

**Author:** [@robdin](https://discourse.processing.org/u/robdin)\
**Replies:** 1\
**Last updated:** [March 23, 2020, 3:45pm UTC](https://discourse.processing.org/t/ip5-error-check-event-solved/18932 "2020-03-23T15:45:44Z")

</div>

Hello Guys, I’m making an interactive menu, but i have problem reading the event of the menu. I have 2 accordion menu and one scrollable list. When i select stuff from scrollable list i have no problem, when i open acc…

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

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