# Coding Questions

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

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

**Page:** 121

---

## [Turning 2D map into a 3D first person view](https://discourse.processing.org/t/turning-2d-map-into-a-3d-first-person-view/15396)

<div class="topic-metadata">

**Author:** [@graysonh](https://discourse.processing.org/u/graysonh)\
**Replies:** 4\
**Last updated:** [November 11, 2019, 4:42pm UTC](https://discourse.processing.org/t/turning-2d-map-into-a-3d-first-person-view/15396 "2019-11-11T16:42:54Z")

</div>

I have spinodal decomposition code to create “maps” like in the image below and I would like to turn it into a 3D walk-around game like Daniel Shiffman’s example with ray casting, but I don’t know how ray casting could b…

---

## [How to get objects to start moving again after collision](https://discourse.processing.org/t/how-to-get-objects-to-start-moving-again-after-collision/15399)

<div class="topic-metadata">

**Author:** [@Lane](https://discourse.processing.org/u/Lane)\
**Replies:** 1\
**Last updated:** [November 11, 2019, 6:53am UTC](https://discourse.processing.org/t/how-to-get-objects-to-start-moving-again-after-collision/15399 "2019-11-11T06:53:36Z")

</div>

Hi! I have 2 cats that float around until they stop when they come into contact with each other, which I called catFight();. I want them to start floating around again normally every time ‘m’ is pressed. I’m new so proce…

---

## [Making variables persistent?](https://discourse.processing.org/t/making-variables-persistent/15393)

<div class="topic-metadata">

**Author:** [@Everdro1d](https://discourse.processing.org/u/Everdro1d)\
**Replies:** 2\
**Last updated:** [November 11, 2019, 3:09am UTC](https://discourse.processing.org/t/making-variables-persistent/15393 "2019-11-11T03:09:47Z")

</div>

What I’m trying to do is make a persistent colour saver, which means that the variables that store the custom colours will need to be saved on exit and loaded on startup. I thought maybe if i could make the program write…

---

## [Hexadecimal-\> file (jpg) / how to convert?](https://discourse.processing.org/t/hexadecimal-file-jpg-how-to-convert/14200)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 5\
**Last updated:** [November 10, 2019, 8:34pm UTC](https://discourse.processing.org/t/hexadecimal-file-jpg-how-to-convert/14200 "2019-11-10T20:34:25Z")

</div>

Hexadecimal-\> file (jpg) Link: Hex to file (binary) converter Good morning. I want to convert the HEX value into a jpg file, Pimage img; I want to put a jpg file in the img variable and display it on the screen. D…

---

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

<div class="topic-metadata">

**Author:** [@Tobias](https://discourse.processing.org/u/Tobias)\
**Replies:** 5\
**Last updated:** [November 10, 2019, 1:46pm UTC](https://discourse.processing.org/t/ellipse-not-moving/15351 "2019-11-10T13:46:01Z")

</div>

I used to know almost all the features in processing like a year ago, and now I decided to get back and try again. I just made a simple script telling the console to show a circle with some gravity, and everything works …

---

## [Array isn't loading any values](https://discourse.processing.org/t/array-isnt-loading-any-values/15368)

<div class="topic-metadata">

**Author:** [@bs.17](https://discourse.processing.org/u/bs.17)\
**Replies:** 15\
**Last updated:** [November 10, 2019, 4:18am UTC](https://discourse.processing.org/t/array-isnt-loading-any-values/15368 "2019-11-10T04:18:45Z")

</div>

\*\*//(Dice game, roll two dice 36 times and store each value, then after you determine how many times 12 showed in that array, but the array 1-36 is all filled with 0's, and it prints that shows 12 0 times. New to coding…

---

## [Trying to create a polygon point connector](https://discourse.processing.org/t/trying-to-create-a-polygon-point-connector/15362)

<div class="topic-metadata">

**Author:** [@musiciantriescoding](https://discourse.processing.org/u/musiciantriescoding)\
**Replies:** 1\
**Last updated:** [November 10, 2019, 2:21am UTC](https://discourse.processing.org/t/trying-to-create-a-polygon-point-connector/15362 "2019-11-10T02:21:43Z")

</div>

Hello! I am trying to create a polygon point connector that works likes this: 1. draw n amount of points on a circle equidistant from each other 2. connect the points to the nth point next to it to create polygons an…

---

## [Intersection of ellipses](https://discourse.processing.org/t/intersection-of-ellipses/15357)

<div class="topic-metadata">

**Author:** [@edward](https://discourse.processing.org/u/edward)\
**Replies:** 6\
**Last updated:** [November 9, 2019, 11:54pm UTC](https://discourse.processing.org/t/intersection-of-ellipses/15357 "2019-11-09T23:54:31Z")

</div>

Hi guys. I’m finding this quite a challenge. The way I have it in this code, any ellipse avoids contact with the others whilst dragging it, which is kind of what I want. However, in order to keep on dragging an ellipse …

---

## [Can't create a Serializable object and convert it to a byte\[\]](https://discourse.processing.org/t/cant-create-a-serializable-object-and-convert-it-to-a-byte/15360)

<div class="topic-metadata">

**Author:** [@creepercrack](https://discourse.processing.org/u/creepercrack)\
**Replies:** 4\
**Last updated:** [November 9, 2019, 10:49pm UTC](https://discourse.processing.org/t/cant-create-a-serializable-object-and-convert-it-to-a-byte/15360 "2019-11-09T22:49:22Z")

</div>

So I don’t have much to say, the only thing is that I don’t know why this code: import java.io.\*; void setup() { Foo foo = new Foo(); try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); Objec…

---

## [Fade effect from an image to another](https://discourse.processing.org/t/fade-effect-from-an-image-to-another/12244)

<div class="topic-metadata">

**Author:** [@Vickydcl](https://discourse.processing.org/u/Vickydcl)\
**Replies:** 2\
**Last updated:** [November 9, 2019, 11:25pm UTC](https://discourse.processing.org/t/fade-effect-from-an-image-to-another/12244 "2019-11-09T23:25:32Z")

</div>

I have this code but when I press the mouse I want an image fade transition, any help? Thanks! void setup() { size(600, 600); estaciones = new PImage\[2\]; estaciones\[0\]=loadImage("test.png"); estaciones\[1\]=load…

---

## [Random Custom Classes](https://discourse.processing.org/t/random-custom-classes/15354)

<div class="topic-metadata">

**Author:** [@cajk24](https://discourse.processing.org/u/cajk24)\
**Replies:** 4\
**Last updated:** [November 9, 2019, 5:21pm UTC](https://discourse.processing.org/t/random-custom-classes/15354 "2019-11-09T17:21:15Z")

</div>

I’m trying to create a program where different types of fish are defined into different classes, and the user would be able to spawn them randomly by pressing the ‘f’ key. I can’t seem to figure out how to define the ran…

---

## [Processing.js code on openprocessing - nothing happens when you click](https://discourse.processing.org/t/processing-js-code-on-openprocessing-nothing-happens-when-you-click/15323)

<div class="topic-metadata">

**Author:** [@scruffyboy13](https://discourse.processing.org/u/scruffyboy13)\
**Replies:** 8\
**Last updated:** [November 8, 2019, 8:44pm UTC](https://discourse.processing.org/t/processing-js-code-on-openprocessing-nothing-happens-when-you-click/15323 "2019-11-08T20:44:05Z")

</div>

I’ve been using openprocessing.org to create a processingjs code but something is going wrong where nothing happens when you click on the main screen but it’s supposed to change to the tutorial screen. I’ve been trying f…

---

## [Easy typing program](https://discourse.processing.org/t/easy-typing-program/15226)

<div class="topic-metadata">

**Author:** [@helpme123](https://discourse.processing.org/u/helpme123)\
**Replies:** 4\
**Last updated:** [November 8, 2019, 5:30pm UTC](https://discourse.processing.org/t/easy-typing-program/15226 "2019-11-08T17:30:06Z")

</div>

Im trying to create a program where a random letter appears on the screen and the user has to type it to gain 1 point and if they type it within a time frame they get bonus points (I haven’t wrote the point system yet be…

---

## [Creating a self-moving face (eyes and mouth only)](https://discourse.processing.org/t/creating-a-self-moving-face-eyes-and-mouth-only/15293)

<div class="topic-metadata">

**Author:** [@JigKSaw](https://discourse.processing.org/u/JigKSaw)\
**Replies:** 3\
**Last updated:** [November 8, 2019, 3:52pm UTC](https://discourse.processing.org/t/creating-a-self-moving-face-eyes-and-mouth-only/15293 "2019-11-08T15:52:20Z")

</div>

Hi there. It’s my intention to create a storyteller at the center of the window, who will speak, kinda like this: :eyes: :lips: which opens autonomously eyes and mouth (in a mechanic way). How can I draw/create them? …

---

## [RGB Colour Squares](https://discourse.processing.org/t/rgb-colour-squares/15266)

<div class="topic-metadata">

**Author:** [@Civil](https://discourse.processing.org/u/Civil)\
**Replies:** 4\
**Last updated:** [November 8, 2019, 5:48am UTC](https://discourse.processing.org/t/rgb-colour-squares/15266 "2019-11-08T05:48:04Z")

</div>

So I thought a fun little thing to do would be to draw some squares using RGB and the simple double for loop. However, there are 3 different combinations that you can do: Iterate Red and Green, leave Blue 255 Iterate R…

---

## [How to create real randomized objects](https://discourse.processing.org/t/how-to-create-real-randomized-objects/15304)

<div class="topic-metadata">

**Author:** [@Andreas](https://discourse.processing.org/u/Andreas)\
**Replies:** 1\
**Last updated:** [November 7, 2019, 1:55pm UTC](https://discourse.processing.org/t/how-to-create-real-randomized-objects/15304 "2019-11-07T13:55:05Z")

</div>

I want to make an ‘iOS dynamic wallpaper generator’ in processing. I made a class that can draw a dynamic gradient color spot. But I don’t know how to draw multiple spots with different(random) color, shape, and positio…

---

## [Pong collision when ball hits paddle](https://discourse.processing.org/t/pong-collision-when-ball-hits-paddle/15281)

<div class="topic-metadata">

**Author:** [@FilDomInteractive](https://discourse.processing.org/u/FilDomInteractive)\
**Replies:** 2\
**Last updated:** [November 7, 2019, 11:46am UTC](https://discourse.processing.org/t/pong-collision-when-ball-hits-paddle/15281 "2019-11-07T11:46:57Z")

</div>

Hello, can you help me how to do collision so when the ball hits the paddle, it will go back? The code \> float x = 400; float y = 300; float k = width - 20; float e = height / 2; float c = 715; float h = height / 2; fl…

---

## [Keep getting misclicks, with my buttonClicked function](https://discourse.processing.org/t/keep-getting-misclicks-with-my-buttonclicked-function/15295)

<div class="topic-metadata">

**Author:** [@JellyG37](https://discourse.processing.org/u/JellyG37)\
**Replies:** 3\
**Last updated:** [November 7, 2019, 11:30am UTC](https://discourse.processing.org/t/keep-getting-misclicks-with-my-buttonclicked-function/15295 "2019-11-07T11:30:10Z")

</div>

Hello everyone. I’m coding a GUI for a schoolproject, where i need to register whether or not the user has clicked on the right button or not. I’ve made different hitboxes on the screen where the clicks will be true, but…

---

## [Line help beginner completely new](https://discourse.processing.org/t/line-help-beginner-completely-new/15120)

<div class="topic-metadata">

**Author:** [@FilDomInteractive](https://discourse.processing.org/u/FilDomInteractive)\
**Replies:** 15\
**Last updated:** [November 6, 2019, 9:05am UTC](https://discourse.processing.org/t/line-help-beginner-completely-new/15120 "2019-11-06T09:05:45Z")

</div>

How to make a line that is at the same position as mouse but is longer than the distance. below

---

## [I want something like persistent ripples on the pool, But problems occur!](https://discourse.processing.org/t/i-want-something-like-persistent-ripples-on-the-pool-but-problems-occur/15271)

<div class="topic-metadata">

**Author:** [@CMSwift](https://discourse.processing.org/u/CMSwift)\
**Replies:** 1\
**Last updated:** [November 6, 2019, 3:56am UTC](https://discourse.processing.org/t/i-want-something-like-persistent-ripples-on-the-pool-but-problems-occur/15271 "2019-11-06T03:56:10Z")

</div>

Refering to https://www.openprocessing.org/sketch/775186 I made a little bit changes :slight\_smile: float incX = 0.04; float incY = 0.05; float distance = 12; int wavesHeight = 200; boolean looping = true; float frame …

---

## [Obstacle game in 3d (with 2d obstacles), unable to add more than 1 obstacle](https://discourse.processing.org/t/obstacle-game-in-3d-with-2d-obstacles-unable-to-add-more-than-1-obstacle/15110)

<div class="topic-metadata">

**Author:** [@D.Signer](https://discourse.processing.org/u/D.Signer)\
**Replies:** 10\
**Last updated:** [November 5, 2019, 10:12pm UTC](https://discourse.processing.org/t/obstacle-game-in-3d-with-2d-obstacles-unable-to-add-more-than-1-obstacle/15110 "2019-11-05T22:12:28Z")

</div>

I am trying to make an obstacle game where you are supposedly driving and there are trees you need to avoid (for now those are just rectangles). Since I am pretty new to processing, I tried some stuff out, and it all see…

---

## [Triangle movement | Last thread this week](https://discourse.processing.org/t/triangle-movement-last-thread-this-week/15191)

<div class="topic-metadata">

**Author:** [@FilDomInteractive](https://discourse.processing.org/u/FilDomInteractive)\
**Replies:** 1\
**Last updated:** [November 3, 2019, 8:33pm UTC](https://discourse.processing.org/t/triangle-movement-last-thread-this-week/15191 "2019-11-03T20:33:56Z")

</div>

I Have an ellipse(x, y, 20, 20); and I want it to be a triangle of any parameter, but will still have position x, y so I can move it with my keys. Thank you!!

---

## [Processing Frames drop over time, Array of multiple 1000s of objects](https://discourse.processing.org/t/processing-frames-drop-over-time-array-of-multiple-1000s-of-objects/15116)

<div class="topic-metadata">

**Author:** [@Janvonfalken](https://discourse.processing.org/u/Janvonfalken)\
**Replies:** 1\
**Last updated:** [November 5, 2019, 5:45pm UTC](https://discourse.processing.org/t/processing-frames-drop-over-time-array-of-multiple-1000s-of-objects/15116 "2019-11-05T17:45:37Z")

</div>

I am trying to write a line editor for the game “BeamNG”. It takes in a JSON file and lets you edit waypoints (values) of that JSON. If I start the program it works fine, but as soon as I zoom in the Framerate begins to …

---

## [Display text as a wave](https://discourse.processing.org/t/display-text-as-a-wave/15236)

<div class="topic-metadata">

**Author:** [@dev19](https://discourse.processing.org/u/dev19)\
**Replies:** 2\
**Last updated:** [November 5, 2019, 5:33pm UTC](https://discourse.processing.org/t/display-text-as-a-wave/15236 "2019-11-05T17:33:23Z")

</div>

this is my code… int xspace = 5; // How far apart should each horizontal location be spaced int w; // Width of entire wave float theta = 0.0; // Start angle at 0 float amplitude = 80.0; // Height of wa…

---

## [Attractor on Infinite Surface](https://discourse.processing.org/t/attractor-on-infinite-surface/15134)

<div class="topic-metadata">

**Author:** [@Lexyth](https://discourse.processing.org/u/Lexyth)\
**Replies:** 12\
**Last updated:** [November 5, 2019, 5:31pm UTC](https://discourse.processing.org/t/attractor-on-infinite-surface/15134 "2019-11-05T17:31:26Z")

</div>

I‘m trying to get an Attractor simulation running on a pseudo infinite surface, but i can‘t get it to work properly. What i‘m doing is basically set up a normal 1D Attractor simulation (Particles with pos, direction and…

---

## [How can I change the page by clicking a button?](https://discourse.processing.org/t/how-can-i-change-the-page-by-clicking-a-button/15244)

<div class="topic-metadata">

**Author:** [@CyberDodo](https://discourse.processing.org/u/CyberDodo)\
**Replies:** 6\
**Last updated:** [November 5, 2019, 11:31am UTC](https://discourse.processing.org/t/how-can-i-change-the-page-by-clicking-a-button/15244 "2019-11-05T11:31:10Z")

</div>

How can I change the page by clicking a button?

---

## [Getting undesirable vertices when importing SVG from illustrator](https://discourse.processing.org/t/getting-undesirable-vertices-when-importing-svg-from-illustrator/15205)

<div class="topic-metadata">

**Author:** [@jeykech](https://discourse.processing.org/u/jeykech)\
**Replies:** 12\
**Last updated:** [November 4, 2019, 10:14pm UTC](https://discourse.processing.org/t/getting-undesirable-vertices-when-importing-svg-from-illustrator/15205 "2019-11-04T22:14:29Z")

</div>

Hi guys, i’am having a little problem when importing an svg exported from illustrator. in illustrator I made sure I had only the necessary vertices like this but when imported to processing I get this the code i’am…

---

## [Detecting greatest jump in value in arrayList](https://discourse.processing.org/t/detecting-greatest-jump-in-value-in-arraylist/15216)

<div class="topic-metadata">

**Author:** [@edward](https://discourse.processing.org/u/edward)\
**Replies:** 3\
**Last updated:** [November 4, 2019, 8:31pm UTC](https://discourse.processing.org/t/detecting-greatest-jump-in-value-in-arraylist/15216 "2019-11-04T20:31:08Z")

</div>

Good morning, I want to be able to detect the element with the greatest jump in value in an arrayList. I’ve done it this way, but I wonder if there is a “more correct” and more simplified way to do it, maybe using fewe…

---

## [Problem with bouncing ball program with mousePress](https://discourse.processing.org/t/problem-with-bouncing-ball-program-with-mousepress/15227)

<div class="topic-metadata">

**Author:** [@helpme123](https://discourse.processing.org/u/helpme123)\
**Replies:** 1\
**Last updated:** [November 4, 2019, 7:49pm UTC](https://discourse.processing.org/t/problem-with-bouncing-ball-program-with-mousepress/15227 "2019-11-04T19:49:58Z")

</div>

Im trying to create a program where balls bounce around the screen and when they hit each other they collide and when mousePressed create another ball, but nothing is showing on my sketch window. Ball\[\] balls = new Ball…

---

## [Drawing Sheet on Processing](https://discourse.processing.org/t/drawing-sheet-on-processing/14928)

<div class="topic-metadata">

**Author:** [@ImDaGr3en](https://discourse.processing.org/u/ImDaGr3en)\
**Replies:** 6\
**Last updated:** [November 4, 2019, 2:42am UTC](https://discourse.processing.org/t/drawing-sheet-on-processing/14928 "2019-11-04T02:42:32Z")

</div>

My project is done! As you can see from the title, I managed to create a working drawing sheet in which you can draw with different colors by pressing the mouse in different positions. You can also trigger the eraser mo…

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

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