# Coding Questions

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

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

**Page:** 158

---

## [The Game of Life](https://discourse.processing.org/t/the-game-of-life/7007)

<div class="topic-metadata">

**Author:** [@Baipyrus](https://discourse.processing.org/u/Baipyrus)\
**Replies:** 2\
**Last updated:** [December 30, 2018, 2:59pm UTC](https://discourse.processing.org/t/the-game-of-life/7007 "2018-12-30T14:59:07Z")

</div>

To anyone that has watched The Coding Train’s Video about it or just knows the Game of Life, can you take a look at my script in over here and tell me if I did anything wrong? I made it just for fun, and noticed that it …

---

## [Select output of printWriter](https://discourse.processing.org/t/select-output-of-printwriter/7014)

<div class="topic-metadata">

**Author:** [@vjjv](https://discourse.processing.org/u/vjjv)\
**Replies:** 1\
**Last updated:** [December 30, 2018, 10:54am UTC](https://discourse.processing.org/t/select-output-of-printwriter/7014 "2018-12-30T10:54:57Z")

</div>

hello! how can i save the printWriter object inside a custom folder? wr = createWriter("obj"+ index + "txt"); i want to create a folder inside a sketch and save the files there. Thanks!

---

## [Shuffling vertex order in beginshape() to draw random polygons](https://discourse.processing.org/t/shuffling-vertex-order-in-beginshape-to-draw-random-polygons/6989)

<div class="topic-metadata">

**Author:** [@cftpa](https://discourse.processing.org/u/cftpa)\
**Replies:** 2\
**Last updated:** [December 30, 2018, 10:37am UTC](https://discourse.processing.org/t/shuffling-vertex-order-in-beginshape-to-draw-random-polygons/6989 "2018-12-30T10:37:29Z")

</div>

Hello, this is my first post and I’m fairly new to Processing. I have a series of vertex coordinates and I was wondering if it’s possible to shuffle the order in which they draw the polygon (v0, v1, v2, v3 -\> v3, v1, v…

---

## [Objects follow ground with gravity](https://discourse.processing.org/t/objects-follow-ground-with-gravity/7012)

<div class="topic-metadata">

**Author:** [@tommyokie](https://discourse.processing.org/u/tommyokie)\
**Replies:** 3\
**Last updated:** [December 30, 2018, 2:44am UTC](https://discourse.processing.org/t/objects-follow-ground-with-gravity/7012 "2018-12-30T02:44:40Z")

</div>

hey, I’m pretty new with processing so this might be pretty simple How could I have an object, a ball, with location, velocity, and acceleration vectors, be constrained on top of a 2d ground (a slanted line to be simpl…

---

## [Keep track and save objects variables](https://discourse.processing.org/t/keep-track-and-save-objects-variables/6993)

<div class="topic-metadata">

**Author:** [@vjjv](https://discourse.processing.org/u/vjjv)\
**Replies:** 1\
**Last updated:** [December 29, 2018, 10:19pm UTC](https://discourse.processing.org/t/keep-track-and-save-objects-variables/6993 "2018-12-29T22:19:12Z")

</div>

Hello! i try to keeping track and save the objects values in a file and next read the changes. If i\`ve only one object a printWriter works fine, becouse i read the changes over time. but with and array of differents obj…

---

## [Making a trail with an image](https://discourse.processing.org/t/making-a-trail-with-an-image/6987)

<div class="topic-metadata">

**Author:** [@Jeany](https://discourse.processing.org/u/Jeany)\
**Replies:** 6\
**Last updated:** [December 29, 2018, 10:01pm UTC](https://discourse.processing.org/t/making-a-trail-with-an-image/6987 "2018-12-29T22:01:17Z")

</div>

Hi, I have a question about making a trail (which is goin to be an image of a car trail) in my code. Im working on a project where you can race with a car and I thought it would be a nice idea to leave a trace on the r…

---

## [Application hangs when mouse is moved](https://discourse.processing.org/t/application-hangs-when-mouse-is-moved/6946)

<div class="topic-metadata">

**Author:** [@iampadik](https://discourse.processing.org/u/iampadik)\
**Replies:** 3\
**Last updated:** [December 29, 2018, 2:50pm UTC](https://discourse.processing.org/t/application-hangs-when-mouse-is-moved/6946 "2018-12-29T14:50:50Z")

</div>

Hello people. A novice here.My application hangs as soon as my mouse moves and I have to restart the application. Whereas I don’t have the function mouseMoved in my code anywhere. If I keep the mouse steady , application…

---

## [Nested classes, best approach?](https://discourse.processing.org/t/nested-classes-best-approach/6974)

<div class="topic-metadata">

**Author:** [@Tsskyx](https://discourse.processing.org/u/Tsskyx)\
**Replies:** 2\
**Last updated:** [December 29, 2018, 5:09pm UTC](https://discourse.processing.org/t/nested-classes-best-approach/6974 "2018-12-29T17:09:10Z")

</div>

So, long story short, I’m making a neural network. Basically, I currently have one big 2D irregular array of Neuron objects (say, of the following shape or similar: {784, 32, 32, 10}), and I’ve just got the idea of turni…

---

## [Using PApplet whilst extending classes like PGraphics](https://discourse.processing.org/t/using-papplet-whilst-extending-classes-like-pgraphics/6942)

<div class="topic-metadata">

**Author:** [@Kluivert](https://discourse.processing.org/u/Kluivert)\
**Replies:** 4\
**Last updated:** [December 29, 2018, 4:51pm UTC](https://discourse.processing.org/t/using-papplet-whilst-extending-classes-like-pgraphics/6942 "2018-12-29T16:51:13Z")

</div>

Heya Everyone! I recently attempted to extend the PGraphics class specifically the PGraphicsJAVA2D class and referred to GotoLoop’s Solution But don’t understand the code as well which leaves me with anxiety.

---

## [Drawing multiple 3D box plots](https://discourse.processing.org/t/drawing-multiple-3d-box-plots/7008)

<div class="topic-metadata">

**Author:** [@kikisarp](https://discourse.processing.org/u/kikisarp)\
**Replies:** 9\
**Last updated:** [December 30, 2018, 5:35am UTC](https://discourse.processing.org/t/drawing-multiple-3d-box-plots/7008 "2018-12-30T05:35:07Z")

</div>

Hi, I need to draw a 3D shape, specifically a cube at different locations on a grid and to simulate that, I’m using the randomize function to give me random values for the parameters of “translate()” and also the “box()…

---

## [Problem with reusing a function](https://discourse.processing.org/t/problem-with-reusing-a-function/6966)

<div class="topic-metadata">

**Author:** [@JoseBri93](https://discourse.processing.org/u/JoseBri93)\
**Replies:** 2\
**Last updated:** [December 29, 2018, 4:44am UTC](https://discourse.processing.org/t/problem-with-reusing-a-function/6966 "2018-12-29T04:44:34Z")

</div>

Hi! Based on Daniel Shiffman’s sketch Bouncing Ball, im trying to display a secind ball on the screen unsuccessfully. However both balls appears, they dont move at all. Can someone explain me where i’m making mistakes? t…

---

## [Obtaining position values of a translated, scaled, and rotated imported pShape](https://discourse.processing.org/t/obtaining-position-values-of-a-translated-scaled-and-rotated-imported-pshape/6916)

<div class="topic-metadata">

**Author:** [@Ethanp247](https://discourse.processing.org/u/Ethanp247)\
**Replies:** 5\
**Last updated:** [December 29, 2018, 3:02am UTC](https://discourse.processing.org/t/obtaining-position-values-of-a-translated-scaled-and-rotated-imported-pshape/6916 "2018-12-29T03:02:39Z")

</div>

Hello! This is my first post on this forum, so please let me know if I’m not descriptive enough, etc. When I’m referring to a pShape in this post, I am referring to an imported .obj file. As you know, you can obtain th…

---

## [Some kind of error! Help me pls!](https://discourse.processing.org/t/some-kind-of-error-help-me-pls/6940)

<div class="topic-metadata">

**Author:** [@CheeserMaster](https://discourse.processing.org/u/CheeserMaster)\
**Replies:** 2\
**Last updated:** [December 28, 2018, 8:14am UTC](https://discourse.processing.org/t/some-kind-of-error-help-me-pls/6940 "2018-12-28T08:14:46Z")

</div>

Hi, I don’t know why this happend and i would appreciate if someone can help me. Thats my code: import static javax.swing.JOptionPane.\*; void settings() { size((displayWidth/4)\*2, (displayHeight/3)\*2); } void setup(…

---

## [Incorrect points positions](https://discourse.processing.org/t/incorrect-points-positions/6754)

<div class="topic-metadata">

**Author:** [@Darkar25](https://discourse.processing.org/u/Darkar25)\
**Replies:** 16\
**Last updated:** [December 28, 2018, 4:15am UTC](https://discourse.processing.org/t/incorrect-points-positions/6754 "2018-12-28T04:15:17Z")

</div>

i am trying to make Graph,its almost done…last thing i need to fix,is points positions…i completely dont know why they placing like that…any ideas? Graph.pde: ArrayList\<Float\> arr = new ArrayList\<Float\>(); GraphView gr…

---

## [Making a book cover! Sketch ---\> 300 dpi](https://discourse.processing.org/t/making-a-book-cover-sketch-300-dpi/5894)

<div class="topic-metadata">

**Author:** [@PartyWave](https://discourse.processing.org/u/PartyWave)\
**Replies:** 7\
**Last updated:** [December 27, 2018, 9:23pm UTC](https://discourse.processing.org/t/making-a-book-cover-sketch-300-dpi/5894 "2018-12-27T21:23:54Z")

</div>

Hi! Trying to make a book with my friends. We’d love to get a really high quality cover. Made a couple sketches on Processing. While the animations are great, we will need to capture a frame into an SVG. Know there are …

---

## [Rubix Cube Randomization](https://discourse.processing.org/t/rubix-cube-randomization/6896)

<div class="topic-metadata">

**Author:** [@Baipyrus](https://discourse.processing.org/u/Baipyrus)\
**Replies:** 7\
**Last updated:** [December 27, 2018, 8:31pm UTC](https://discourse.processing.org/t/rubix-cube-randomization/6896 "2018-12-27T20:31:24Z")

</div>

I’ve created this Rubix Cube Test Sketch, and it works totally fine for first. When I started creating a Randomizer Function to randomize all the little Tiles on each side, it went kind of buggy, and I can’t figure out w…

---

## [Check file is finished writing to disk](https://discourse.processing.org/t/check-file-is-finished-writing-to-disk/6932)

<div class="topic-metadata">

**Author:** [@jeffmarc](https://discourse.processing.org/u/jeffmarc)\
**Replies:** 1\
**Last updated:** [December 27, 2018, 6:31pm UTC](https://discourse.processing.org/t/check-file-is-finished-writing-to-disk/6932 "2018-12-27T18:31:07Z")

</div>

I use file.exist() and it says file exists, but it is not finished being written to disk because when i loadImage() i get errors that say the file is not all there. Is there any other way to check when a file is finishe…

---

## [Get intersection point of line and CIE chromaticity curve](https://discourse.processing.org/t/get-intersection-point-of-line-and-cie-chromaticity-curve/6685)

<div class="topic-metadata">

**Author:** [@ProsExplorer](https://discourse.processing.org/u/ProsExplorer)\
**Replies:** 7\
**Last updated:** [December 26, 2018, 11:43pm UTC](https://discourse.processing.org/t/get-intersection-point-of-line-and-cie-chromaticity-curve/6685 "2018-12-26T23:43:08Z")

</div>

First, let me lay out what I’ve done so far and what I’m trying to do with this partially completed program. I’m attempting to convert the RGB pixel values to their corresponding wavelength by: Converting RGB to XYZ \[c…

---

## [Scale size in vertex Shader](https://discourse.processing.org/t/scale-size-in-vertex-shader/6900)

<div class="topic-metadata">

**Author:** [@vjjv](https://discourse.processing.org/u/vjjv)\
**Replies:** 4\
**Last updated:** [December 26, 2018, 11:08pm UTC](https://discourse.processing.org/t/scale-size-in-vertex-shader/6900 "2018-12-26T23:08:58Z")

</div>

hello! its possible to scale a model into the vertexShader? can i get the data of the size sending via sphere(x) ? #version 150 #define PROCESSING\_COLOR\_SHADER #ifdef GL\_ES precision mediump float; #endif uniform mat…

---

## [Getting pixel data from a PShape](https://discourse.processing.org/t/getting-pixel-data-from-a-pshape/6684)

<div class="topic-metadata">

**Author:** [@Andrewkaram](https://discourse.processing.org/u/Andrewkaram)\
**Replies:** 18\
**Last updated:** [December 26, 2018, 10:41pm UTC](https://discourse.processing.org/t/getting-pixel-data-from-a-pshape/6684 "2018-12-26T22:41:26Z")

</div>

Hello, I’m looking into getting pixel data from a PShape. I have successfully imported a .obj file into processing. However, I am focused on retrieving the pixel data of the object, and eventually, put in into an array.…

---

## [Save multiple Letters](https://discourse.processing.org/t/save-multiple-letters/6857)

<div class="topic-metadata">

**Author:** [@tigger97](https://discourse.processing.org/u/tigger97)\
**Replies:** 2\
**Last updated:** [December 26, 2018, 4:17pm UTC](https://discourse.processing.org/t/save-multiple-letters/6857 "2018-12-26T16:17:15Z")

</div>

Hey I’m new, Our teacher askes us to develope a learning programm for the scrabble game. Basically you get 9 letter from which you can wright a word, that word is then checkedm to see if it is in the Library. I can alr…

---

## [Displaying transparent img](https://discourse.processing.org/t/displaying-transparent-img/6895)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 8\
**Last updated:** [December 26, 2018, 1:16pm UTC](https://discourse.processing.org/t/displaying-transparent-img/6895 "2018-12-26T13:16:12Z")

</div>

Hi! Ive been working on a few games that require non rect images, but i dont have any tool to make transparent images :frowning: i only have default programs of Win10, and i dont want to download some large programs. I…

---

## [Minimum non zero value of array](https://discourse.processing.org/t/minimum-non-zero-value-of-array/6889)

<div class="topic-metadata">

**Author:** [@fonsinho](https://discourse.processing.org/u/fonsinho)\
**Replies:** 3\
**Last updated:** [December 25, 2018, 6:07pm UTC](https://discourse.processing.org/t/minimum-non-zero-value-of-array/6889 "2018-12-25T18:07:53Z")

</div>

Hi, i create this sketch for working…but i can´t take minimum non zero value Some suggestions? tks //ArrayList\<int \[\]\> yo=new ArrayList\<int \[\]\>(); //Pilo pilo; int\[\] a ={3,56,0,12, 8,7,6,5, 5,6,0,…

---

## [Help!Snake growing algorithm not working](https://discourse.processing.org/t/help-snake-growing-algorithm-not-working/6886)

<div class="topic-metadata">

**Author:** [@M.Abbas.Askari](https://discourse.processing.org/u/M.Abbas.Askari)\
**Replies:** 2\
**Last updated:** [December 25, 2018, 8:32am UTC](https://discourse.processing.org/t/help-snake-growing-algorithm-not-working/6886 "2018-12-25T08:32:07Z")

</div>

Am a beggner & struggling to Code. Just created account to ask a qustion I AM STUCK!!! i think the problem is in the move() function in snake class the snake acts weird when i eat the food /////CODE////// /////main…

---

## [Problem with my collisions need help](https://discourse.processing.org/t/problem-with-my-collisions-need-help/6852)

<div class="topic-metadata">

**Author:** [@Robin73](https://discourse.processing.org/u/Robin73)\
**Replies:** 6\
**Last updated:** [December 24, 2018, 3:05pm UTC](https://discourse.processing.org/t/problem-with-my-collisions-need-help/6852 "2018-12-24T15:05:06Z")

</div>

My friend and I are working on this labyrinth and it was working but Yoshi were able to cross the wall so i added the function get() and i wanted my yoshi to walk in a direction if the key was pressed and if the color of…

---

## [Initialize array in glsl](https://discourse.processing.org/t/initialize-array-in-glsl/6858)

<div class="topic-metadata">

**Author:** [@Stanlepunk](https://discourse.processing.org/u/Stanlepunk)\
**Replies:** 4\
**Last updated:** [December 24, 2018, 1:46pm UTC](https://discourse.processing.org/t/initialize-array-in-glsl/6858 "2018-12-24T13:46:15Z")

</div>

I want initialize an array from uniform, but the problem I cannot because the array must be init from const. For this reason I must write a same method ntwice, that’s make a lot of code to write the same thing. is it p…

---

## [Timer with specific format](https://discourse.processing.org/t/timer-with-specific-format/6864)

<div class="topic-metadata">

**Author:** [@MichaelPCgamer](https://discourse.processing.org/u/MichaelPCgamer)\
**Replies:** 2\
**Last updated:** [December 24, 2018, 1:50am UTC](https://discourse.processing.org/t/timer-with-specific-format/6864 "2018-12-24T01:50:09Z")

</div>

int milli; int hours; int minutes; int seconds; void setup () { size(600, 400); } void draw() { background(0); milli = millis(); seconds = milli / 1000; minutes = seconds / 60; hours = minutes / 60; tex…

---

## [How to create glsl inputs](https://discourse.processing.org/t/how-to-create-glsl-inputs/6855)

<div class="topic-metadata">

**Author:** [@vjjv](https://discourse.processing.org/u/vjjv)\
**Replies:** 1\
**Last updated:** [December 23, 2018, 8:21pm UTC](https://discourse.processing.org/t/how-to-create-glsl-inputs/6855 "2018-12-23T20:21:50Z")

</div>

hello! i want to create some vertex shaders input, to send data per vertex. I dont know exactly how can i do it. im sure that some of you have this information. Actually my shaders inputs are texCoord, Color, position, n…

---

## [Need help making my paddle contact](https://discourse.processing.org/t/need-help-making-my-paddle-contact/6773)

<div class="topic-metadata">

**Author:** [@JakeLen](https://discourse.processing.org/u/JakeLen)\
**Replies:** 3\
**Last updated:** [December 23, 2018, 1:40am UTC](https://discourse.processing.org/t/need-help-making-my-paddle-contact/6773 "2018-12-23T01:40:55Z")

</div>

Hi Y’all, I’m trying to make a vertical, one player version of pong for android. I’ve made png horizontally before but i’m fairly new to this whole thing and changing axis has me thrown off. I just need help making th…

---

## [Beginner requires some help for a "snake" game](https://discourse.processing.org/t/beginner-requires-some-help-for-a-snake-game/6831)

<div class="topic-metadata">

**Author:** [@Rogahn](https://discourse.processing.org/u/Rogahn)\
**Replies:** 2\
**Last updated:** [December 22, 2018, 11:21pm UTC](https://discourse.processing.org/t/beginner-requires-some-help-for-a-snake-game/6831 "2018-12-22T23:21:28Z")

</div>

Hello there, I have to do a special snake game for my coding classes. There is no food in this version of the game, but each time “s” is pressed, the snake have to grow by 1 (and only 1) square. The issue is that some…

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

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