# Coding Questions

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

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

**Page:** 141

---

## [Need help with arrays](https://discourse.processing.org/t/need-help-with-arrays/10749)

<div class="topic-metadata">

**Author:** [@abigail](https://discourse.processing.org/u/abigail)\
**Replies:** 5\
**Last updated:** [May 7, 2019, 10:53am UTC](https://discourse.processing.org/t/need-help-with-arrays/10749 "2019-05-07T10:53:41Z")

</div>

Hi :slight\_smile: Sun sun1; Hill hill1; Hill hill2; Star\[\] stars = new Star\[2\]; float r = 0; float g = 0; float b = 200; void setup() { size(600, 400); sun1 = new Sun(); hill1 = new Hill(0); hill2 = new Hi…

---

## [NPE on a synchronized(this) statement?](https://discourse.processing.org/t/npe-on-a-synchronized-this-statement/10904)

<div class="topic-metadata">

**Author:** [@LoliProcessor](https://discourse.processing.org/u/LoliProcessor)\
**Replies:** 6\
**Last updated:** [May 7, 2019, 8:33am UTC](https://discourse.processing.org/t/npe-on-a-synchronized-this-statement/10904 "2019-05-07T08:33:16Z")

</div>

Tanctikon is an enclosing instance of the class this synchronized statement is called from. Hmmm…

---

## [Background() causing weirdness with get()](https://discourse.processing.org/t/background-causing-weirdness-with-get/4959)

<div class="topic-metadata">

**Author:** [@P-Joe-S](https://discourse.processing.org/u/P-Joe-S)\
**Replies:** 10\
**Last updated:** [November 3, 2018, 9:53pm UTC](https://discourse.processing.org/t/background-causing-weirdness-with-get/4959 "2018-11-03T21:53:22Z")

</div>

I’m trying to use get() to make patterns using the previous frame, so I’m calling get() at the start of draw(). If I use background() after that to clear the frame, I find that what get() has given me is not the previou…

---

## [Change rectangles seperately in for loop](https://discourse.processing.org/t/change-rectangles-seperately-in-for-loop/10908)

<div class="topic-metadata">

**Author:** [@M19](https://discourse.processing.org/u/M19)\
**Replies:** 12\
**Last updated:** [May 6, 2019, 1:01pm UTC](https://discourse.processing.org/t/change-rectangles-seperately-in-for-loop/10908 "2019-05-06T13:01:13Z")

</div>

Hi, I wanted to make a screen full of rectangles which if you hover over them with your mouse, start to rotate (I’m not done with the rotating part yet). Right now I have the rectangles but if you hover over them with y…

---

## [I Need Help! (Exam)](https://discourse.processing.org/t/i-need-help-exam/10841)

<div class="topic-metadata">

**Author:** [@Oiwaz](https://discourse.processing.org/u/Oiwaz)\
**Replies:** 6\
**Last updated:** [May 6, 2019, 8:31am UTC](https://discourse.processing.org/t/i-need-help-exam/10841 "2019-05-06T08:31:22Z")

</div>

I’m making a simplified game, were the cirkel has to collect trash. (It’s simplified a lot) But there is a challenge and that is that the cirkel cannot be hit by the cars. BUT here’s my problem. I can’t spawn infinite…

---

## [Select Folder in the Second Sketch？？](https://discourse.processing.org/t/select-folder-in-the-second-sketch/10911)

<div class="topic-metadata">

**Author:** [@stan\_11](https://discourse.processing.org/u/stan_11)\
**Replies:** 1\
**Last updated:** [May 6, 2019, 8:34am UTC](https://discourse.processing.org/t/select-folder-in-the-second-sketch/10911 "2019-05-06T08:34:41Z")

</div>

I am looking for pop up a window from my sketch like this, So when people click the select , the window to choose folder will pop up. So usually we call the selectFolder() to pop up this window. However, the SelectFol…

---

## [How do I implement push() and pop() to multiple objects of a class?](https://discourse.processing.org/t/how-do-i-implement-push-and-pop-to-multiple-objects-of-a-class/10896)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 15\
**Last updated:** [May 5, 2019, 10:14pm UTC](https://discourse.processing.org/t/how-do-i-implement-push-and-pop-to-multiple-objects-of-a-class/10896 "2019-05-05T22:14:20Z")

</div>

There are 2 jellybean objects. I want each to: 1. appear in a different location. 2. spin at a different rate (I know how to do this via non-OOP coding. But once I reformat as OOP I can’t figure out how to implement …

---

## [How to Drop Popups with given info](https://discourse.processing.org/t/how-to-drop-popups-with-given-info/10922)

<div class="topic-metadata">

**Author:** [@elangit](https://discourse.processing.org/u/elangit)\
**Replies:** 3\
**Last updated:** [May 5, 2019, 6:46pm UTC](https://discourse.processing.org/t/how-to-drop-popups-with-given-info/10922 "2019-05-05T18:46:24Z")

</div>

I get confused on this step of the homework and the function is supposed to: “The behavior of this method should be as follows: Given data on one earthquake, and the x, y coordinates of the center of its corresponding …

---

## [How to reset a loop and better edge detection](https://discourse.processing.org/t/how-to-reset-a-loop-and-better-edge-detection/10927)

<div class="topic-metadata">

**Author:** [@blu](https://discourse.processing.org/u/blu)\
**Replies:** 2\
**Last updated:** [May 5, 2019, 11:09am UTC](https://discourse.processing.org/t/how-to-reset-a-loop-and-better-edge-detection/10927 "2019-05-05T11:09:04Z")

</div>

Trying to make my game where all the balls go into the bottom right "basket then their x,y cord is reset 0. Or maybe the loop restarts, I’m really not sure how to approach it. Also, my collision is based on the distance …

---

## [16bit grayscale images](https://discourse.processing.org/t/16bit-grayscale-images/10795)

<div class="topic-metadata">

**Author:** [@Cerald](https://discourse.processing.org/u/Cerald)\
**Replies:** 6\
**Last updated:** [May 5, 2019, 9:27am UTC](https://discourse.processing.org/t/16bit-grayscale-images/10795 "2019-05-05T09:27:44Z")

</div>

As I understand it right now Processing uses a 32bit value for each pixel in an image, devided into 8bits for each color plus an alpha channel. However I would like load, modify and save grayscale images with a single 1…

---

## [Changing the Color](https://discourse.processing.org/t/changing-the-color/10925)

<div class="topic-metadata">

**Author:** [@elangit](https://discourse.processing.org/u/elangit)\
**Replies:** 4\
**Last updated:** [May 5, 2019, 4:05am UTC](https://discourse.processing.org/t/changing-the-color/10925 "2019-05-05T04:05:23Z")

</div>

I’m trying to change the color of each circle depending on the magnitude. However, they all remain blue. This is the assignment: Determine what color the circle for this earthquake should be: If the magnitude is less…

---

## [More rows of eyes, with rectangle pupils](https://discourse.processing.org/t/more-rows-of-eyes-with-rectangle-pupils/10905)

<div class="topic-metadata">

**Author:** [@Mikalaen](https://discourse.processing.org/u/Mikalaen)\
**Replies:** 18\
**Last updated:** [May 4, 2019, 7:18pm UTC](https://discourse.processing.org/t/more-rows-of-eyes-with-rectangle-pupils/10905 "2019-05-04T19:18:20Z")

</div>

Hey guys, I want to make this code more advanced. I would like to have more rows of eyes both the horisontal and vertical way. How do i do that? Should i use the “for (int …)” ?? And then i want the pupils in the eye t…

---

## [Processing pool game bug](https://discourse.processing.org/t/processing-pool-game-bug/10559)

<div class="topic-metadata">

**Author:** [@mrblue216](https://discourse.processing.org/u/mrblue216)\
**Replies:** 4\
**Last updated:** [May 4, 2019, 9:25am UTC](https://discourse.processing.org/t/processing-pool-game-bug/10559 "2019-05-04T09:25:44Z")

</div>

Hello guys, I need help for a processing project. Here my code: When i shoot with tail the ball do not go straight and make a curve. I want to stop the ball Thanks ! //VARIABLES float y = 0; float w = 150; float h = …

---

## [Issue on my Sketch](https://discourse.processing.org/t/issue-on-my-sketch/10877)

<div class="topic-metadata">

**Author:** [@realmeteo](https://discourse.processing.org/u/realmeteo)\
**Replies:** 1\
**Last updated:** [May 3, 2019, 9:11pm UTC](https://discourse.processing.org/t/issue-on-my-sketch/10877 "2019-05-03T21:11:33Z")

</div>

I resolved by myself: Because the screen is updated only at the end of draw() Hello, I’m newbie on processung: I start my processing job from a fine working example that is this: Gauge second, minute, hour; int secol…

---

## [How to take input in the canvas drawn by the user](https://discourse.processing.org/t/how-to-take-input-in-the-canvas-drawn-by-the-user/10829)

<div class="topic-metadata">

**Author:** [@Procoder](https://discourse.processing.org/u/Procoder)\
**Replies:** 4\
**Last updated:** [May 3, 2019, 9:07pm UTC](https://discourse.processing.org/t/how-to-take-input-in-the-canvas-drawn-by-the-user/10829 "2019-05-03T21:07:50Z")

</div>

How can i use an input like a drawing as an object drawn by the user

---

## [Using a PVector](https://discourse.processing.org/t/using-a-pvector/10866)

<div class="topic-metadata">

**Author:** [@Process321](https://discourse.processing.org/u/Process321)\
**Replies:** 18\
**Last updated:** [May 3, 2019, 4:47pm UTC](https://discourse.processing.org/t/using-a-pvector/10866 "2019-05-03T16:47:45Z")

</div>

Looking to adapt the code below

---

## [Conditional inside an IF](https://discourse.processing.org/t/conditional-inside-an-if/10790)

<div class="topic-metadata">

**Author:** [@chaps421](https://discourse.processing.org/u/chaps421)\
**Replies:** 4\
**Last updated:** [May 3, 2019, 2:15pm UTC](https://discourse.processing.org/t/conditional-inside-an-if/10790 "2019-05-03T14:15:49Z")

</div>

is there a way to put a conditional inside an of stament? for for (int i=0; i\<10; i++){ if(i==col(i).size ){//col1 or col2... col 9 depending on the i //whatever you want } } what i am currently using is t…

---

## [Game Error (NullPointerException)](https://discourse.processing.org/t/game-error-nullpointerexception/10856)

<div class="topic-metadata">

**Author:** [@hannieways](https://discourse.processing.org/u/hannieways)\
**Replies:** 6\
**Last updated:** [May 3, 2019, 12:56am UTC](https://discourse.processing.org/t/game-error-nullpointerexception/10856 "2019-05-03T00:56:58Z")

</div>

I’m currently trying to create a game for my computer science class and I’m having a bit of a rocky start, to be honest. What I have below is the basis of the game but I’m running into a problem when I run the code. It d…

---

## [Pixel distortion](https://discourse.processing.org/t/pixel-distortion/10783)

<div class="topic-metadata">

**Author:** [@Avishay](https://discourse.processing.org/u/Avishay)\
**Replies:** 4\
**Last updated:** [May 2, 2019, 9:33pm UTC](https://discourse.processing.org/t/pixel-distortion/10783 "2019-05-02T21:33:59Z")

</div>

Hey! I’m trying to understand which code was used on this work: Someone has an idea? :slight\_smile:

---

## [Why is the result fo the shader black?](https://discourse.processing.org/t/why-is-the-result-fo-the-shader-black/10850)

<div class="topic-metadata">

**Author:** [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Replies:** 1\
**Last updated:** [May 2, 2019, 8:41pm UTC](https://discourse.processing.org/t/why-is-the-result-fo-the-shader-black/10850 "2019-05-02T20:41:25Z")

</div>

I try to port: https://www.shadertoy.com/view/XssSzN Here is the sketch: PShader shader; void setup() { size(800, 600, P2D); shader = loadShader("metaballs.frag"); } void draw() { shader.set("iTime", (…

---

## [Help with data.csv code](https://discourse.processing.org/t/help-with-data-csv-code/10763)

<div class="topic-metadata">

**Author:** [@Seyfi](https://discourse.processing.org/u/Seyfi)\
**Replies:** 11\
**Last updated:** [May 2, 2019, 2:53pm UTC](https://discourse.processing.org/t/help-with-data-csv-code/10763 "2019-05-02T14:53:07Z")

</div>

Hello I am trying to run the code which is from processing.org and using data.csv file, but I am getting the following error: This tabel has no column named x. The code is as following Table table; Bubble\[\] bubbles; …

---

## [Arraylist full of functions?](https://discourse.processing.org/t/arraylist-full-of-functions/10786)

<div class="topic-metadata">

**Author:** [@DerekCresswell](https://discourse.processing.org/u/DerekCresswell)\
**Replies:** 6\
**Last updated:** [May 2, 2019, 2:14pm UTC](https://discourse.processing.org/t/arraylist-full-of-functions/10786 "2019-05-02T14:14:22Z")

</div>

I need to store a list of functions that I can execute from said array. I also need to be able to pass them as variables. Lambda doesn’t seem to work in processing. How can I do this? Thanks!

---

## [How to ask a question and receive and answer](https://discourse.processing.org/t/how-to-ask-a-question-and-receive-and-answer/10814)

<div class="topic-metadata">

**Author:** [@MichaelGuillet](https://discourse.processing.org/u/MichaelGuillet)\
**Replies:** 2\
**Last updated:** [May 2, 2019, 10:59am UTC](https://discourse.processing.org/t/how-to-ask-a-question-and-receive-and-answer/10814 "2019-05-02T10:59:27Z")

</div>

I am coming from a background in coding in scratch i know how lame that sounds but i have a couple of questions on how to ask a question like you can in scratch and set the answer to a variable. Also how to make clickabl…

---

## [If hovering over? pic paste, rotate friendly (detects if over transparent parts of img)](https://discourse.processing.org/t/if-hovering-over-pic-paste-rotate-friendly-detects-if-over-transparent-parts-of-img/10662)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 4\
**Last updated:** [May 2, 2019, 2:43am UTC](https://discourse.processing.org/t/if-hovering-over-pic-paste-rotate-friendly-detects-if-over-transparent-parts-of-img/10662 "2019-05-02T02:43:57Z")

</div>

Hi, i’ve been wondering how to detect if mouse (or just X and Y cords) is hovering over an image, and if the image is transparent at x y it isnt hovering over. So if you r hovering over transparent part of img it returns…

---

## [Animation (Link Isn't Showing!)](https://discourse.processing.org/t/animation-link-isnt-showing/10824)

<div class="topic-metadata">

**Author:** [@leeke](https://discourse.processing.org/u/leeke)\
**Replies:** 1\
**Last updated:** [May 2, 2019, 12:19am UTC](https://discourse.processing.org/t/animation-link-isnt-showing/10824 "2019-05-02T00:19:49Z")

</div>

I’m a beginner in coding and I’m trying to make a game. I only have the very basics right now but I seem to be having a problem. Link (the character I’m using for the game) Isn’t showing up on the screen when I run the p…

---

## [Maze Game Simple Question](https://discourse.processing.org/t/maze-game-simple-question/10816)

<div class="topic-metadata">

**Author:** [@GuerillaGirl](https://discourse.processing.org/u/GuerillaGirl)\
**Replies:** 1\
**Last updated:** [May 1, 2019, 10:29pm UTC](https://discourse.processing.org/t/maze-game-simple-question/10816 "2019-05-01T22:29:52Z")

</div>

Here is the code that we have. We need to know how to make the dot go faster because when we start it moves slow. We just need to know how to increase the speed of the ellipse. We are beginners! PImage GreenMaze; int x …

---

## [Trouble with Array and Multiple Classes](https://discourse.processing.org/t/trouble-with-array-and-multiple-classes/10731)

<div class="topic-metadata">

**Author:** [@hemicyon](https://discourse.processing.org/u/hemicyon)\
**Replies:** 1\
**Last updated:** [May 1, 2019, 9:12pm UTC](https://discourse.processing.org/t/trouble-with-array-and-multiple-classes/10731 "2019-05-01T21:12:35Z")

</div>

Goal: I am trying to create an array of amoebae (Amies) drawn with beginShape() inside their class (Amy). I am also trying to feed only one Amy within the array. Problem 1: I can create an array of Amies with food funct…

---

## [Help with bezier for clock hand with teardrop shape](https://discourse.processing.org/t/help-with-bezier-for-clock-hand-with-teardrop-shape/10797)

<div class="topic-metadata">

**Author:** [@ottenm](https://discourse.processing.org/u/ottenm)\
**Replies:** 3\
**Last updated:** [May 1, 2019, 12:04pm UTC](https://discourse.processing.org/t/help-with-bezier-for-clock-hand-with-teardrop-shape/10797 "2019-05-01T12:04:17Z")

</div>

I’m hoping to draw a shape matching the hour hand on the clock below. I’ve made a few runs at the teardrop part with bezier(), but nothing clicking yet. Thanks for any help!

---

## [Intersection between point and plane in 3D or more](https://discourse.processing.org/t/intersection-between-point-and-plane-in-3d-or-more/10780)

<div class="topic-metadata">

**Author:** [@Stanlepunk](https://discourse.processing.org/u/Stanlepunk)\
**Replies:** 15\
**Last updated:** [May 1, 2019, 9:23am UTC](https://discourse.processing.org/t/intersection-between-point-and-plane-in-3d-or-more/10780 "2019-05-01T09:23:14Z")

</div>

I try to find a way to know if a 3D point is in a 3D plane or not, but I don’t find a clear topic to do that in Java or in Processing. If any body have a topic or code to do that I’m very interesting. Topics about 3D in…

---

## [Sprites animation that use a lot of memory](https://discourse.processing.org/t/sprites-animation-that-use-a-lot-of-memory/10695)

<div class="topic-metadata">

**Author:** [@Summer](https://discourse.processing.org/u/Summer)\
**Replies:** 9\
**Last updated:** [May 1, 2019, 5:35am UTC](https://discourse.processing.org/t/sprites-animation-that-use-a-lot-of-memory/10695 "2019-05-01T05:35:01Z")

</div>

I made a program that animate sprites but it use a huge amount of memory (~ 3000 MB). I increased the memorry alowed in preference and the program run but it still laggy. Can someone help me to resolve this problem. Than…

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

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