# Coding Questions

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

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

**Page:** 51

---

## [Parsing object to array/Getting name of an object attribute](https://discourse.processing.org/t/parsing-object-to-array-getting-name-of-an-object-attribute/30759)

<div class="topic-metadata">

**Author:** [@Naik\_Trofimov](https://discourse.processing.org/u/Naik_Trofimov)\
**Replies:** 3\
**Last updated:** [June 17, 2021, 4:40pm UTC](https://discourse.processing.org/t/parsing-object-to-array-getting-name-of-an-object-attribute/30759 "2021-06-17T16:40:44Z")

</div>

Hello everyone, I had an idea to try to make a tool for saving the state of a running program on processing, which could be applied by adding just a couple of lines, I would call it “quick save”. The problem is that in a…

---

## [Organic Random Lines](https://discourse.processing.org/t/organic-random-lines/30748)

<div class="topic-metadata">

**Author:** [@humano](https://discourse.processing.org/u/humano)\
**Replies:** 2\
**Last updated:** [June 16, 2021, 10:53pm UTC](https://discourse.processing.org/t/organic-random-lines/30748 "2021-06-16T22:53:34Z")

</div>

Hi there! I am trying to draw organic lines, so I have started making that kind of oscillations that you can see on black line. I don’t know if that can be done easier, but is was the only possible way for my beguinner l…

---

## [Basic Ball bouncing with mouse](https://discourse.processing.org/t/basic-ball-bouncing-with-mouse/30735)

<div class="topic-metadata">

**Author:** [@userfc](https://discourse.processing.org/u/userfc)\
**Replies:** 1\
**Last updated:** [June 15, 2021, 10:40pm UTC](https://discourse.processing.org/t/basic-ball-bouncing-with-mouse/30735 "2021-06-15T22:40:39Z")

</div>

Hi! I need help because I don’t know where to start. I want to build a small game of tiles where you start with a grid of 5x5 balls opposed to one ball that represents the user’s cursor. The first need is to be able to h…

---

## [Coding game: catching coins and avoiding bombs](https://discourse.processing.org/t/coding-game-catching-coins-and-avoiding-bombs/30709)

<div class="topic-metadata">

**Author:** [@processinggg](https://discourse.processing.org/u/processinggg)\
**Replies:** 9\
**Last updated:** [June 15, 2021, 6:50pm UTC](https://discourse.processing.org/t/coding-game-catching-coins-and-avoiding-bombs/30709 "2021-06-15T18:50:40Z")

</div>

Hello, I have a few questions about following code. I have coins, which are being caught by the ship and b0mbs which have to be avoided. However, the b0mbs are somehow stuck with the coins and they aren’t their own objec…

---

## [Adding Score Mechanism](https://discourse.processing.org/t/adding-score-mechanism/30690)

<div class="topic-metadata">

**Author:** [@azul](https://discourse.processing.org/u/azul)\
**Replies:** 10\
**Last updated:** [June 15, 2021, 5:16pm UTC](https://discourse.processing.org/t/adding-score-mechanism/30690 "2021-06-15T17:16:43Z")

</div>

Hi, I made a simple game, yet I couldn’t add a scoring mechanism and an opening scene. When the spaceship hits one of the balls, it loses score, when it explodes the balls using mouse function, it gains scores. It would …

---

## [Crash-Causing Error with trying to display Lives](https://discourse.processing.org/t/crash-causing-error-with-trying-to-display-lives/30706)

<div class="topic-metadata">

**Author:** [@spamelim](https://discourse.processing.org/u/spamelim)\
**Replies:** 3\
**Last updated:** [June 14, 2021, 7:29pm UTC](https://discourse.processing.org/t/crash-causing-error-with-trying-to-display-lives/30706 "2021-06-14T19:29:35Z")

</div>

I have been trying to make a space-shooter type game, and I have been coding lives (which work until I try to display them). My code to display the life count is Player p; void draw() { text("Lives:", 100, 100); text…

---

## [Some help with Conways Game Of Life](https://discourse.processing.org/t/some-help-with-conways-game-of-life/30605)

<div class="topic-metadata">

**Author:** [@Ironbatman1](https://discourse.processing.org/u/Ironbatman1)\
**Replies:** 14\
**Last updated:** [June 14, 2021, 1:43pm UTC](https://discourse.processing.org/t/some-help-with-conways-game-of-life/30605 "2021-06-14T13:43:22Z")

</div>

Alright so I’ve been working on the game of life and have run into a weird problem. There are squares deciding to draw alive for an unknown reason. I have used print to check what the state is at those steps and I know i…

---

## [Can´t run sketches in VS Code from one day to another](https://discourse.processing.org/t/can-t-run-sketches-in-vs-code-from-one-day-to-another/30703)

<div class="topic-metadata">

**Author:** [@cheister](https://discourse.processing.org/u/cheister)\
**Replies:** 2\
**Last updated:** [June 14, 2021, 12:55pm UTC](https://discourse.processing.org/t/can-t-run-sketches-in-vs-code-from-one-day-to-another/30703 "2021-06-14T12:55:05Z")

</div>

Hi, I installed the Processing VSCode Plugin which worked very well but from one day to another the following error occurred: Could not run the sketch (Target VM failed to initialize). It still works in the Processing I…

---

## [Coding a composite image of images that randomly shuffle in placement](https://discourse.processing.org/t/coding-a-composite-image-of-images-that-randomly-shuffle-in-placement/30694)

<div class="topic-metadata">

**Author:** [@phanan](https://discourse.processing.org/u/phanan)\
**Replies:** 1\
**Last updated:** [June 14, 2021, 10:40am UTC](https://discourse.processing.org/t/coding-a-composite-image-of-images-that-randomly-shuffle-in-placement/30694 "2021-06-14T10:40:31Z")

</div>

I know how to code basic Python, but am brand new to Processing/p5j.s. Any help would be appreciated on the steps needed to do the following: I want to code an array of images to fill the background of a webpage, and ha…

---

## [Move PacMan Using Arrow Key](https://discourse.processing.org/t/move-pacman-using-arrow-key/30670)

<div class="topic-metadata">

**Author:** [@MacJ](https://discourse.processing.org/u/MacJ)\
**Replies:** 6\
**Last updated:** [June 13, 2021, 10:24pm UTC](https://discourse.processing.org/t/move-pacman-using-arrow-key/30670 "2021-06-13T22:24:46Z")

</div>

Hello, here is my attempt at it any help would be much appreciated. //The variables that control everything known about the pacman float pacmanX, pacmanY; //The position of the pacman final int PACMAN\_DIAMETER =…

---

## [Help with comparing values in an array](https://discourse.processing.org/t/help-with-comparing-values-in-an-array/30668)

<div class="topic-metadata">

**Author:** [@TheBearOfJare](https://discourse.processing.org/u/TheBearOfJare)\
**Replies:** 1\
**Last updated:** [June 13, 2021, 6:17am UTC](https://discourse.processing.org/t/help-with-comparing-values-in-an-array/30668 "2021-06-13T06:17:09Z")

</div>

So, I’ve been writing various homemade neural networks, and I’ve realized that I waste a ton of time re-writing code and spending too much time writing ten billion copies of the same variable with just a different name. …

---

## [Beginner: how to run examples from 'The Book of Shaders'](https://discourse.processing.org/t/beginner-how-to-run-examples-from-the-book-of-shaders/4682)

<div class="topic-metadata">

**Author:** [@Hieronymus](https://discourse.processing.org/u/Hieronymus)\
**Replies:** 10\
**Last updated:** [June 12, 2021, 10:26am UTC](https://discourse.processing.org/t/beginner-how-to-run-examples-from-the-book-of-shaders/4682 "2021-06-12T10:26:35Z")

</div>

Hello and thank you, I am an absolute beginner with minimal knowledge of coding and I started working trough the examples of ‘The Book of Shaders’ ( https://thebookofshaders.com) I am trying to get the example code to …

---

## [Recreate Parabolic Triangle](https://discourse.processing.org/t/recreate-parabolic-triangle/30638)

<div class="topic-metadata">

**Author:** [@Chencho](https://discourse.processing.org/u/Chencho)\
**Replies:** 2\
**Last updated:** [June 12, 2021, 2:40am UTC](https://discourse.processing.org/t/recreate-parabolic-triangle/30638 "2021-06-12T02:40:49Z")

</div>

I want to recreate this Parabolic triangle gif using Processing. I’ve already got the “base” code figured out I think. What I need now is to cycle through my code to get the correct number of triangles/lines. I’m using…

---

## [Transparent sketch](https://discourse.processing.org/t/transparent-sketch/30603)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 1\
**Last updated:** [June 10, 2021, 7:29pm UTC](https://discourse.processing.org/t/transparent-sketch/30603 "2021-06-10T19:29:35Z")

</div>

@GoToLoop I’m just following an old thread and stumbled upon some of your code https://forum.processing.org/two/discussion/20499/moving-a-translucent-window-around-the-screen/p1 /\*\* \* Opacity + WindowDecoration (v2.0…

---

## [Scaling to file](https://discourse.processing.org/t/scaling-to-file/30607)

<div class="topic-metadata">

**Author:** [@yalaniv](https://discourse.processing.org/u/yalaniv)\
**Replies:** 1\
**Last updated:** [June 9, 2021, 5:30pm UTC](https://discourse.processing.org/t/scaling-to-file/30607 "2021-06-09T17:30:24Z")

</div>

Is it possible to create graphics on screen size 1000\\750, But saving it to file as a 10000/7500? Export as a 1000/750 and scale it won’t work because it will make lines become rectangles and I want it to be thick as a…

---

## [Magnifier please help : (](https://discourse.processing.org/t/magnifier-please-help/30602)

<div class="topic-metadata">

**Author:** [@Goku557](https://discourse.processing.org/u/Goku557)\
**Replies:** 10\
**Last updated:** [June 9, 2021, 4:58pm UTC](https://discourse.processing.org/t/magnifier-please-help/30602 "2021-06-09T16:58:09Z")

</div>

Hey so i am trying to magnify a 5x5 area around the mouse cursour and then draw that area in a rect. Basicaly i want to get the surround pixels at mouse x and mouse Y . put those pixels into an array? use that array t…

---

## [Pong - Ball Bouncing Bug](https://discourse.processing.org/t/pong-ball-bouncing-bug/30599)

<div class="topic-metadata">

**Author:** [@SaftigMelo](https://discourse.processing.org/u/SaftigMelo)\
**Replies:** 7\
**Last updated:** [June 9, 2021, 11:06am UTC](https://discourse.processing.org/t/pong-ball-bouncing-bug/30599 "2021-06-09T11:06:44Z")

</div>

Hi, in school we are making a Pong Game. I only have a problem with the bouncing when the ball touches the paddle on one of the edges the ball gets stuck in the paddle. Bounce Method: void testCollision(Ball ball) …

---

## [How do I save an array of integers to json object/array](https://discourse.processing.org/t/how-do-i-save-an-array-of-integers-to-json-object-array/30583)

<div class="topic-metadata">

**Author:** [@gerrikoio](https://discourse.processing.org/u/gerrikoio)\
**Replies:** 2\
**Last updated:** [June 9, 2021, 9:06am UTC](https://discourse.processing.org/t/how-do-i-save-an-array-of-integers-to-json-object-array/30583 "2021-06-09T09:06:16Z")

</div>

If I had an array of integers, like so: int array\[\] = {1,2,3,4,5}; How would I convert this array to JSON so that it is in this format { "array" : \[ 1, 2, 3, 4, 5 \] } I am not sure what’s best inside my Processing(J…

---

## [MetaBalls from shaderToy](https://discourse.processing.org/t/metaballs-from-shadertoy/30414)

<div class="topic-metadata">

**Author:** [@matheplica](https://discourse.processing.org/u/matheplica)\
**Replies:** 6\
**Last updated:** [June 9, 2021, 7:29am UTC](https://discourse.processing.org/t/metaballs-from-shadertoy/30414 "2021-06-09T07:29:52Z")

</div>

Hello, I’m trying to use this metaballs shaders found on shaderToy with no results. I’ve got a black screen with this error : OpenGL error 1282 at bot endDraw(): invalid operation I adapt a little bit the code but I…

---

## [Looking for help working with CSV code or excel](https://discourse.processing.org/t/looking-for-help-working-with-csv-code-or-excel/28718)

<div class="topic-metadata">

**Author:** [@ADIYAIR](https://discourse.processing.org/u/ADIYAIR)\
**Replies:** 21\
**Last updated:** [June 9, 2021, 7:18am UTC](https://discourse.processing.org/t/looking-for-help-working-with-csv-code-or-excel/28718 "2021-06-09T07:18:35Z")

</div>

Looking for help or examples working with CSV code or excel to create visual pattern

---

## [How to find automous agents within range](https://discourse.processing.org/t/how-to-find-automous-agents-within-range/30575)

<div class="topic-metadata">

**Author:** [@Goku557](https://discourse.processing.org/u/Goku557)\
**Replies:** 3\
**Last updated:** [June 8, 2021, 11:07pm UTC](https://discourse.processing.org/t/how-to-find-automous-agents-within-range/30575 "2021-06-08T23:07:42Z")

</div>

\[sloved\] \` void seek(PVector target) { // only run if mousecursor is pressed if (mousePressed) { // if creatures are nerby target float nerby=(10); for (Creature c : creatures) { float …

---

## [Rolling boulder code problem (complex animation)](https://discourse.processing.org/t/rolling-boulder-code-problem-complex-animation/30571)

<div class="topic-metadata">

**Author:** [@norm1](https://discourse.processing.org/u/norm1)\
**Replies:** 3\
**Last updated:** [June 8, 2021, 8:34pm UTC](https://discourse.processing.org/t/rolling-boulder-code-problem-complex-animation/30571 "2021-06-08T20:34:55Z")

</div>

Doing an animation that requires a boulder to roll down a hill, then go to the right of the screen, then go back left and up the hill and stop. But once I get to the BoulderRollRight I cant go roll the boulder left becau…

---

## [Simulating rear lights of a car](https://discourse.processing.org/t/simulating-rear-lights-of-a-car/30533)

<div class="topic-metadata">

**Author:** [@Th3cG](https://discourse.processing.org/u/Th3cG)\
**Replies:** 5\
**Last updated:** [June 8, 2021, 6:55pm UTC](https://discourse.processing.org/t/simulating-rear-lights-of-a-car/30533 "2021-06-08T18:55:45Z")

</div>

Hi there, I wrote this messy code intended to simulate the behaviour of the rear lights of a car: //introducing variables //n manages the timing for left and right arrows int n; //m and on manage the timing for emerge…

---

## [Catching images](https://discourse.processing.org/t/catching-images/30565)

<div class="topic-metadata">

**Author:** [@processinggg](https://discourse.processing.org/u/processinggg)\
**Replies:** 5\
**Last updated:** [June 8, 2021, 9:11am UTC](https://discourse.processing.org/t/catching-images/30565 "2021-06-08T09:11:20Z")

</div>

Hello, I have difficulty with following code in Processing, I don’t know how to make the bar catch the images/objects that are falling from above. Here is the code float x = 100; float y = 500; Balken balken; //On…

---

## [saveStrings creates a new file when exported application](https://discourse.processing.org/t/savestrings-creates-a-new-file-when-exported-application/30526)

<div class="topic-metadata">

**Author:** [@abatllei](https://discourse.processing.org/u/abatllei)\
**Replies:** 4\
**Last updated:** [June 7, 2021, 8:10pm UTC](https://discourse.processing.org/t/savestrings-creates-a-new-file-when-exported-application/30526 "2021-06-07T20:10:19Z")

</div>

I’m programming a game where I want to save the final points, like a highscore. Same problem as this topic: https://discourse.processing.org/t/save-string-to-txt-file-when-the-program-is-a-standalone-application/26898?u=…

---

## [Remove a object in the array of colors](https://discourse.processing.org/t/remove-a-object-in-the-array-of-colors/30521)

<div class="topic-metadata">

**Author:** [@kylu](https://discourse.processing.org/u/kylu)\
**Replies:** 4\
**Last updated:** [June 7, 2021, 5:19pm UTC](https://discourse.processing.org/t/remove-a-object-in-the-array-of-colors/30521 "2021-06-07T17:19:31Z")

</div>

Hi! i’m working with a code, and i need to remove the color once it has been used. is a walker who takes on a color each time he begins his path. I need to make sure that the color not to repeat This is the class Pale…

---

## [How do I change the size of an object with mouse](https://discourse.processing.org/t/how-do-i-change-the-size-of-an-object-with-mouse/30540)

<div class="topic-metadata">

**Author:** [@Hisoka](https://discourse.processing.org/u/Hisoka)\
**Replies:** 1\
**Last updated:** [June 7, 2021, 1:22pm UTC](https://discourse.processing.org/t/how-do-i-change-the-size-of-an-object-with-mouse/30540 "2021-06-07T13:22:31Z")

</div>

How do I change the size of an object, when the mouse is getting farther than the center of the canvas, the object gets bigger and when the mouse is getting closer to the center of the canvas, the object gets smaller I …

---

## [Active Processing program to simulate a planet orbiting around a sun](https://discourse.processing.org/t/active-processing-program-to-simulate-a-planet-orbiting-around-a-sun/30462)

<div class="topic-metadata">

**Author:** [@matto](https://discourse.processing.org/u/matto)\
**Replies:** 11\
**Last updated:** [June 7, 2021, 10:39am UTC](https://discourse.processing.org/t/active-processing-program-to-simulate-a-planet-orbiting-around-a-sun/30462 "2021-06-07T10:39:15Z")

</div>

Am trying to write a code to make my planet increase and decrease with respect to PI/2 and 3\*PI/2 as it orbits round the sun please any tips

---

## [Scale using cos/sin](https://discourse.processing.org/t/scale-using-cos-sin/30542)

<div class="topic-metadata">

**Author:** [@MacJ](https://discourse.processing.org/u/MacJ)\
**Replies:** 3\
**Last updated:** [June 7, 2021, 1:51am UTC](https://discourse.processing.org/t/scale-using-cos-sin/30542 "2021-06-07T01:51:13Z")

</div>

Hello so below is my code of a simple planet orbiting the sun final int SUN\_DIAM = 50; final int ORBIT\_X = 150; final int ORBIT\_Y = 35; final int PLANET\_DIAM = 25; final float SPEED = 0.03; float angle = 0; final …

---

## [Who can help me, how to place and object when mouse is clicked (SOLVED)](https://discourse.processing.org/t/who-can-help-me-how-to-place-and-object-when-mouse-is-clicked-solved/30492)

<div class="topic-metadata">

**Author:** [@Hisoka](https://discourse.processing.org/u/Hisoka)\
**Replies:** 5\
**Last updated:** [June 6, 2021, 4:07pm UTC](https://discourse.processing.org/t/who-can-help-me-how-to-place-and-object-when-mouse-is-clicked-solved/30492 "2021-06-06T16:07:28Z")

</div>

when I click on the mouse, the figure should be placed on the position that I clicked. After click, the logo should not be moved on the tips of the mouse point and should stay still on the position that the mouse was c…

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

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