# Coding Questions

**URL:** https://discourse.processing.org/c/processing/processing-questions/15.md?page=103

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

**Page:** 104

---

## [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…

---

## [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…

---

## [Where am I going wrong in my loop structure?](https://discourse.processing.org/t/where-am-i-going-wrong-in-my-loop-structure/18923)

<div class="topic-metadata">

**Author:** [@abc](https://discourse.processing.org/u/abc)\
**Replies:** 1\
**Last updated:** [March 23, 2020, 11:33am UTC](https://discourse.processing.org/t/where-am-i-going-wrong-in-my-loop-structure/18923 "2020-03-23T11:33:47Z")

</div>

I’m trying to make this if statement repeat, but each time it fails. I tried using a while statement instead, that didn’t even run? I’m not sure why only if statements work in my programs and just where I’m generally goi…

---

## [Gioco Mondrian in lavorazione](https://discourse.processing.org/t/gioco-mondrian-in-lavorazione/18896)

<div class="topic-metadata">

**Author:** [@marika20](https://discourse.processing.org/u/marika20)\
**Replies:** 2\
**Last updated:** [March 23, 2020, 9:07am UTC](https://discourse.processing.org/t/gioco-mondrian-in-lavorazione/18896 "2020-03-23T09:07:43Z")

</div>

Eccomi qua! Sto procedendo con l’ideazione del gioco dei rettangoli in movimento, il mio tentativo è quello di far in modo che i rettangoli si muovano in autonomia per far in modo che l’immagine ho inserito si possa spo…

---

## [Faint separation line between svgs on a diagonal path](https://discourse.processing.org/t/faint-separation-line-between-svgs-on-a-diagonal-path/18636)

<div class="topic-metadata">

**Author:** [@Ruchi](https://discourse.processing.org/u/Ruchi)\
**Replies:** 4\
**Last updated:** [March 23, 2020, 7:09am UTC](https://discourse.processing.org/t/faint-separation-line-between-svgs-on-a-diagonal-path/18636 "2020-03-23T07:09:08Z")

</div>

import processing.svg.\*; PShape svg1; float size; float sizeD; void setup() { size(1440, 1240); shapeMode(CENTER); svg1=loadShape("1.svg"); size = 150; sizeD = sqrt(pow(size, 2) + pow(size, 2)); } void draw…

---

## [How do I detect if two ellipses are colliding?](https://discourse.processing.org/t/how-do-i-detect-if-two-ellipses-are-colliding/18603)

<div class="topic-metadata">

**Author:** [@Yorunoshi](https://discourse.processing.org/u/Yorunoshi)\
**Replies:** 7\
**Last updated:** [March 23, 2020, 3:44am UTC](https://discourse.processing.org/t/how-do-i-detect-if-two-ellipses-are-colliding/18603 "2020-03-23T03:44:38Z")

</div>

Hi I tried using the distance command and the coordinates of 2 ellipses to detect if they are colliding. But the programm uses the start coordinates and not the coordinates after they moved. Is there another possibilit…

---

## [Initial interface of a game](https://discourse.processing.org/t/initial-interface-of-a-game/18639)

<div class="topic-metadata">

**Author:** [@marika20](https://discourse.processing.org/u/marika20)\
**Replies:** 3\
**Last updated:** [March 23, 2020, 3:31am UTC](https://discourse.processing.org/t/initial-interface-of-a-game/18639 "2020-03-23T03:31:04Z")

</div>

Hello everyone! I’m planning a game and I was wondering how it was done once the design was finished to create the home screen with a minimum of player interactivity: I was thinking of a “welcome to the game” and the pu…

---

## [colorMode throws nullPointerException (java - eclipse)](https://discourse.processing.org/t/colormode-throws-nullpointerexception-java-eclipse/18581)

<div class="topic-metadata">

**Author:** [@leo.nerd](https://discourse.processing.org/u/leo.nerd)\
**Replies:** 3\
**Last updated:** [March 23, 2020, 2:41am UTC](https://discourse.processing.org/t/colormode-throws-nullpointerexception-java-eclipse/18581 "2020-03-23T02:41:49Z")

</div>

Hello. I’m coding my project in Eclipse. I’m trying to change the colorMode to HSB: import processing.core.PApplet; public void settings(){ public class mySketch extends PApplet{ public static void main(String\[\] args)…

---

## [Help with Interactive Periodic Table](https://discourse.processing.org/t/help-with-interactive-periodic-table/18898)

<div class="topic-metadata">

**Author:** [@HumanoidX](https://discourse.processing.org/u/HumanoidX)\
**Replies:** 3\
**Last updated:** [March 23, 2020, 2:27am UTC](https://discourse.processing.org/t/help-with-interactive-periodic-table/18898 "2020-03-23T02:27:24Z")

</div>

Hi? I’m working on an interactive periodic table, and I want the elements to show their data when my mouse hover over it. This is what I have: When I hover over Hydrogen, it appear, and when I continue to hover to …

---

## [Update screen during draw() without thread?](https://discourse.processing.org/t/update-screen-during-draw-without-thread/18599)

<div class="topic-metadata">

**Author:** [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Replies:** 4\
**Last updated:** [March 23, 2020, 1:39am UTC](https://discourse.processing.org/t/update-screen-during-draw-without-thread/18599 "2020-03-23T01:39:43Z")

</div>

It’s a long running question here but I just wanted to make sure: Is it possible Update screen during draw() without using thread?? Maybe we can make this a feature request? I got a very deep recursion running and I…

---

## [Plotting (x,y,z) for helicoid](https://discourse.processing.org/t/plotting-x-y-z-for-helicoid/18910)

<div class="topic-metadata">

**Author:** [@rubbs](https://discourse.processing.org/u/rubbs)\
**Replies:** 6\
**Last updated:** [March 22, 2020, 10:51pm UTC](https://discourse.processing.org/t/plotting-x-y-z-for-helicoid/18910 "2020-03-22T22:51:29Z")

</div>

Hello, I’m trying to render a helicoid in java by making an array list of vectors and then plotting the shape. Not entirely confident that my approach is a particularly good one but would appreciate any feedback and/or …

---

## [Bouncing A Ball Off Keyboard Controlled Paddle](https://discourse.processing.org/t/bouncing-a-ball-off-keyboard-controlled-paddle/18879)

<div class="topic-metadata">

**Author:** [@Mylakka](https://discourse.processing.org/u/Mylakka)\
**Replies:** 4\
**Last updated:** [March 22, 2020, 8:25pm UTC](https://discourse.processing.org/t/bouncing-a-ball-off-keyboard-controlled-paddle/18879 "2020-03-22T20:25:53Z")

</div>

Hi, everyone - Hopefully someone is able to direct me. I’m writing a program that has proven to be annoying several times over, and at this point am just sort of tearing my hair out. It’s similar to pong except with a b…

---

## [Shading a trapezoid with points](https://discourse.processing.org/t/shading-a-trapezoid-with-points/18589)

<div class="topic-metadata">

**Author:** [@eltrem](https://discourse.processing.org/u/eltrem)\
**Replies:** 15\
**Last updated:** [March 22, 2020, 3:12pm UTC](https://discourse.processing.org/t/shading-a-trapezoid-with-points/18589 "2020-03-22T15:12:19Z")

</div>

Hi all! I’ve been working lately on some generative drawing tools that generate SVG files for plotting with the Axidraw pen plotter. For a (fake 2D) isometric drawing tool i’m doing (https://twitter.com/sntvlnv/status/…

---

## [Help with moving vertical lines](https://discourse.processing.org/t/help-with-moving-vertical-lines/18848)

<div class="topic-metadata">

**Author:** [@alejo\_rgb](https://discourse.processing.org/u/alejo_rgb)\
**Replies:** 11\
**Last updated:** [March 22, 2020, 11:39am UTC](https://discourse.processing.org/t/help-with-moving-vertical-lines/18848 "2020-03-22T11:39:55Z")

</div>

Hi, i want to make a code that allows me to control the number of lines, the width, and other parameters beacuse im planing to import this code to resolume arena later. This is what i have so far. I made an animation of …

---

## [Programme works until there are 2 or more particles](https://discourse.processing.org/t/programme-works-until-there-are-2-or-more-particles/18541)

<div class="topic-metadata">

**Author:** [@Xetrocs](https://discourse.processing.org/u/Xetrocs)\
**Replies:** 4\
**Last updated:** [March 22, 2020, 10:51am UTC](https://discourse.processing.org/t/programme-works-until-there-are-2-or-more-particles/18541 "2020-03-22T10:51:20Z")

</div>

So i tried to make the gravitation simulation in processing and it worked really well unti i tried to add more than 1 particle. here is my code: PVector attract; int count = 0; particle par\[\] = new particle\[100\]; void s…

---

## [3 digit code problem](https://discourse.processing.org/t/3-digit-code-problem/18839)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.processing.org/u/abcde)\
**Replies:** 22\
**Last updated:** [March 21, 2020, 8:07pm UTC](https://discourse.processing.org/t/3-digit-code-problem/18839 "2020-03-21T20:07:37Z")

</div>

Hello there! i’m trying to make an escape game and therefore i need to make a 3 digit code. I want to work with arrays to make it a lot shorter but i don’t know to let it work. Also i want to work with a key input for t…

---

## [Color gradient on imported points (Perlin Noise)](https://discourse.processing.org/t/color-gradient-on-imported-points-perlin-noise/18858)

<div class="topic-metadata">

**Author:** [@mrbro](https://discourse.processing.org/u/mrbro)\
**Replies:** 2\
**Last updated:** [March 21, 2020, 1:44pm UTC](https://discourse.processing.org/t/color-gradient-on-imported-points-perlin-noise/18858 "2020-03-21T13:44:30Z")

</div>

Hello community! I am using Processing the third day, and it doesn’t let me sleep! xD I have a task to assign RGB values affected by Perlin Noise to a cloud of imported points. I managed to import the points, and I u…

---

## [Ellipse array moving](https://discourse.processing.org/t/ellipse-array-moving/18866)

<div class="topic-metadata">

**Author:** [@marika20](https://discourse.processing.org/u/marika20)\
**Replies:** 2\
**Last updated:** [March 21, 2020, 1:39pm UTC](https://discourse.processing.org/t/ellipse-array-moving/18866 "2020-03-21T13:39:33Z")

</div>

Ciao a tutti :occhiolino: nuovo imput progetto: sto cercando di far in modo che la ellipse(); si muova nelle mie caselle del’array utilizzando keyPressed() facendo in modo che il mio ipotetico personaggio non esca mai …

---

## [Comparing Arrays](https://discourse.processing.org/t/comparing-arrays/18864)

<div class="topic-metadata">

**Author:** [@yes](https://discourse.processing.org/u/yes)\
**Replies:** 1\
**Last updated:** [March 21, 2020, 9:21am UTC](https://discourse.processing.org/t/comparing-arrays/18864 "2020-03-21T09:21:02Z")

</div>

I want to compare all of two array’s data to compare the two.

---

## [How do I convert a file to unsigned?](https://discourse.processing.org/t/how-do-i-convert-a-file-to-unsigned/18663)

<div class="topic-metadata">

**Author:** [@yes](https://discourse.processing.org/u/yes)\
**Replies:** 2\
**Last updated:** [March 21, 2020, 9:06am UTC](https://discourse.processing.org/t/how-do-i-convert-a-file-to-unsigned/18663 "2020-03-21T09:06:44Z")

</div>

I am converting all file bytes to unsigned and put them in an array. How can I do this without errors? I have been getting errors when trying to do this.

---

## [Need assistance with timing! \[millis()\]](https://discourse.processing.org/t/need-assistance-with-timing-millis/18854)

<div class="topic-metadata">

**Author:** [@Mythikal](https://discourse.processing.org/u/Mythikal)\
**Replies:** 4\
**Last updated:** [March 21, 2020, 12:56am UTC](https://discourse.processing.org/t/need-assistance-with-timing-millis/18854 "2020-03-21T00:56:54Z")

</div>

Hey! Thanks for coming to help me out. Today I’m completely stumped on how to get a timer mechanism to work. I’m making a clicker type game and I cant figure out how to add money every second. my goal is this: for each…

---

## [Frogger Offset Help!](https://discourse.processing.org/t/frogger-offset-help/18842)

<div class="topic-metadata">

**Author:** [@Burgs](https://discourse.processing.org/u/Burgs)\
**Replies:** 1\
**Last updated:** [March 20, 2020, 4:13pm UTC](https://discourse.processing.org/t/frogger-offset-help/18842 "2020-03-20T16:13:56Z")

</div>

hello, I’m doing an exercise to practice offset. I’m currently working on a game of frogger to apply this but dont know where to start. how should i apply apply the offset to make the object move in a direction and then …

---

## [A quirky problem with string arrays and Null Pointer Exception](https://discourse.processing.org/t/a-quirky-problem-with-string-arrays-and-null-pointer-exception/18819)

<div class="topic-metadata">

**Author:** [@RetProf](https://discourse.processing.org/u/RetProf)\
**Replies:** 8\
**Last updated:** [March 20, 2020, 4:11pm UTC](https://discourse.processing.org/t/a-quirky-problem-with-string-arrays-and-null-pointer-exception/18819 "2020-03-20T16:11:56Z")

</div>

I am not a Processing Pro but have a fair amount of experience with Processing sketches quite a bit more complex than the one below. As an exercise, I was trying to read strings from a text file (3 tab separated elements…

---

## [Key Pressed to Change text](https://discourse.processing.org/t/key-pressed-to-change-text/18810)

<div class="topic-metadata">

**Author:** [@arianzz](https://discourse.processing.org/u/arianzz)\
**Replies:** 2\
**Last updated:** [March 20, 2020, 3:44pm UTC](https://discourse.processing.org/t/key-pressed-to-change-text/18810 "2020-03-20T15:44:10Z")

</div>

Hello! I am trying to add text with every keypressed. So if key is pressed, words “I BET” show up, then when key pressed again, “YOU DIDN’T”… and so on. So far this is what I have: it shows all the text at once when key…

---

## [\[SOLVED\] Strings in .txt file won't display the same as in the program](https://discourse.processing.org/t/solved-strings-in-txt-file-wont-display-the-same-as-in-the-program/12273)

<div class="topic-metadata">

**Author:** [@kartibrown](https://discourse.processing.org/u/kartibrown)\
**Replies:** 13\
**Last updated:** [July 2, 2019, 6:03pm UTC](https://discourse.processing.org/t/solved-strings-in-txt-file-wont-display-the-same-as-in-the-program/12273 "2019-07-02T18:03:59Z")

</div>

Hello! I’m new to programming in java Processing. I made my first game that actually works, but I can’t get the leaderboard to work. The strings in the .txt file looks like this: Bubblegum 654 Hello 765 looooo…

---

## [Changing the size of a triangle depending on mouseY](https://discourse.processing.org/t/changing-the-size-of-a-triangle-depending-on-mousey/18841)

<div class="topic-metadata">

**Author:** [@PixelVolt38](https://discourse.processing.org/u/PixelVolt38)\
**Replies:** 2\
**Last updated:** [March 20, 2020, 3:29pm UTC](https://discourse.processing.org/t/changing-the-size-of-a-triangle-depending-on-mousey/18841 "2020-03-20T15:29:02Z")

</div>

Hey, So I was trying to do a program that, among other things, changed the size of a triangle depending on how high the mouse was. What I wanted to do is start with the triangle at size 0 at a point and gradually make i…

---

## [Making my 'bird' flappy fly](https://discourse.processing.org/t/making-my-bird-flappy-fly/18749)

<div class="topic-metadata">

**Author:** [@bry\_pk](https://discourse.processing.org/u/bry_pk)\
**Replies:** 6\
**Last updated:** [March 19, 2020, 10:01am UTC](https://discourse.processing.org/t/making-my-bird-flappy-fly/18749 "2020-03-19T10:01:16Z")

</div>

Here is my code for this game I’m making, it is a knockoff flappy birds. My Bird just disappears off-screen and will not return even when I press my key(s). int x = 0; void setup() { PImage tubeImg = loadImage("TUBE.p…

---

## [Lavoro con le Classi](https://discourse.processing.org/t/lavoro-con-le-classi/18769)

<div class="topic-metadata">

**Author:** [@marika20](https://discourse.processing.org/u/marika20)\
**Replies:** 4\
**Last updated:** [March 18, 2020, 5:32pm UTC](https://discourse.processing.org/t/lavoro-con-le-classi/18769 "2020-03-18T17:32:13Z")

</div>

Ciao a tutti! Sto lavorando per creare un’interfaccia per un gioco in modo che si attivo (cliccando su Play Game inizia il gioco), questo è il codice che dovrebbe risultare all’interno del gioco: int state = 0; PImage …

[Previous page](https://discourse.processing.org/c/processing/processing-questions/15.md?page=102)

[Next page](https://discourse.processing.org/c/processing/processing-questions/15.md?page=104)
