# Coding Questions

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

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

**Page:** 75

---

## [Get() Problems - Pro3 - Fr/Eng](https://discourse.processing.org/t/get-problems-pro3-fr-eng/25245)

<div class="topic-metadata">

**Author:** [@Eli0kYd](https://discourse.processing.org/u/Eli0kYd)\
**Replies:** 4\
**Last updated:** [November 7, 2020, 12:14pm UTC](https://discourse.processing.org/t/get-problems-pro3-fr-eng/25245 "2020-11-07T12:14:10Z")

</div>

Hello ! I’m new to processing and I need your help :slight\_smile: I need to select pixel’s area from my original image and to transpose it in rectangles. I learned that -get()( could help me but I do not know where to …

---

## [Ellipse bounce from window](https://discourse.processing.org/t/ellipse-bounce-from-window/25157)

<div class="topic-metadata">

**Author:** [@Ellie98](https://discourse.processing.org/u/Ellie98)\
**Replies:** 2\
**Last updated:** [November 6, 2020, 8:35pm UTC](https://discourse.processing.org/t/ellipse-bounce-from-window/25157 "2020-11-06T20:35:13Z")

</div>

Hello, I’m trying to get the ellipse bounce from the edge of the window but two sides aren’t working. The right vertical side and the bottom horizontal side. Could someone help me out? float damping = 0.97; float gravi…

---

## [Set Window's Minimum size when using P2D](https://discourse.processing.org/t/set-windows-minimum-size-when-using-p2d/1192)

<div class="topic-metadata">

**Author:** [@VansiusProductions](https://discourse.processing.org/u/VansiusProductions)\
**Replies:** 9\
**Last updated:** [November 6, 2020, 11:29am UTC](https://discourse.processing.org/t/set-windows-minimum-size-when-using-p2d/1192 "2020-11-06T11:29:29Z")

</div>

Hi, How do i Set Window’s Minimum size when using the P2D renderer? I know for the default Java renderer I would do this: PSurfaceAWT.SmoothCanvas sc = (PSurfaceAWT.SmoothCanvas) getSurface().getNative(); JFrame jf = (…

---

## [Collision detection ball catching game](https://discourse.processing.org/t/collision-detection-ball-catching-game/25200)

<div class="topic-metadata">

**Author:** [@FabsFabs](https://discourse.processing.org/u/FabsFabs)\
**Replies:** 17\
**Last updated:** [November 6, 2020, 6:31am UTC](https://discourse.processing.org/t/collision-detection-ball-catching-game/25200 "2020-11-06T06:31:28Z")

</div>

Main code float playerWidth; float playerX; float playerY; float number; float\[\] circleY = new float\[10\]; float circleRadius = 25; float headRadius = 15; Player player; //========================================…

---

## [Want to make an array but it doesn't work](https://discourse.processing.org/t/want-to-make-an-array-but-it-doesnt-work/25208)

<div class="topic-metadata">

**Author:** [@MaxMax](https://discourse.processing.org/u/MaxMax)\
**Replies:** 1\
**Last updated:** [November 5, 2020, 5:18pm UTC](https://discourse.processing.org/t/want-to-make-an-array-but-it-doesnt-work/25208 "2020-11-05T17:18:19Z")

</div>

I want to make an array list for my obstacles. This is my full code: StripeMovement\[\] stripes = new StripeMovement\[10\]; ObstacleMovement obstacle1 = new ObstacleMovement(100, 200, 10, 6); ObstacleMovement obstacle2 …

---

## [How to rotate around a sphere?](https://discourse.processing.org/t/how-to-rotate-around-a-sphere/25072)

<div class="topic-metadata">

**Author:** [@raboytniksings](https://discourse.processing.org/u/raboytniksings)\
**Replies:** 24\
**Last updated:** [November 1, 2020, 10:21am UTC](https://discourse.processing.org/t/how-to-rotate-around-a-sphere/25072 "2020-11-01T10:21:25Z")

</div>

I spawn a sphere not at the center of the space, and I would like the “camera” to rotate around that sphere, always looking towards the sphere’s center. According to https://gist.github.com/atduskgreg/1516424, it should …

---

## [Color click game](https://discourse.processing.org/t/color-click-game/25207)

<div class="topic-metadata">

**Author:** [@jeremy](https://discourse.processing.org/u/jeremy)\
**Replies:** 1\
**Last updated:** [November 5, 2020, 3:41pm UTC](https://discourse.processing.org/t/color-click-game/25207 "2020-11-05T15:41:14Z")

</div>

I want to let it wrong when the mouse clicked wrong place so I use the if-else , mouse X and Y in right range and clicked it get score, But now I clicked the first color ,it input twice clicked , then, it appear the in…

---

## [Create Arc with curves/bezier](https://discourse.processing.org/t/create-arc-with-curves-bezier/25178)

<div class="topic-metadata">

**Author:** [@nktlst](https://discourse.processing.org/u/nktlst)\
**Replies:** 6\
**Last updated:** [November 5, 2020, 10:12am UTC](https://discourse.processing.org/t/create-arc-with-curves-bezier/25178 "2020-11-05T10:12:30Z")

</div>

Hello. I created for-loop for generating ARCs with random angles… using build in arc function. Here some issues with controlling this arcs because they based on circles, and overlays each other (my arc is quarter of circ…

---

## [Fractal zoom with text](https://discourse.processing.org/t/fractal-zoom-with-text/25140)

<div class="topic-metadata">

**Author:** [@M.Payne](https://discourse.processing.org/u/M.Payne)\
**Replies:** 6\
**Last updated:** [November 3, 2020, 2:19pm UTC](https://discourse.processing.org/t/fractal-zoom-with-text/25140 "2020-11-03T14:19:44Z")

</div>

I was wondering if its possible to create a fractal zoom with text instead of shapes or lines. If so, can someone please point me in the right direction. I’m currently learning Processing for my Major Project and this …

---

## [Memory card game](https://discourse.processing.org/t/memory-card-game/7160)

<div class="topic-metadata">

**Author:** [@roeludh](https://discourse.processing.org/u/roeludh)\
**Replies:** 18\
**Last updated:** [November 5, 2020, 12:43am UTC](https://discourse.processing.org/t/memory-card-game/7160 "2020-11-05T00:43:15Z")

</div>

Hi, I have to make this memory card game in processing and Im a little stuck somewhere. I have three screens and on the third screen the game is displayed based on the selected number of cards in the second screen. This…

---

## [Algorithm for dividing a circle, providing labels for only some of the divisions](https://discourse.processing.org/t/algorithm-for-dividing-a-circle-providing-labels-for-only-some-of-the-divisions/25138)

<div class="topic-metadata">

**Author:** [@ddownn](https://discourse.processing.org/u/ddownn)\
**Replies:** 4\
**Last updated:** [November 3, 2020, 6:45pm UTC](https://discourse.processing.org/t/algorithm-for-dividing-a-circle-providing-labels-for-only-some-of-the-divisions/25138 "2020-11-03T18:45:26Z")

</div>

I am trying to find a reusable algorithm for dividing any integer quantity into an integer number of parts, but providing a label for only some of those parts. For example, numbers on a clock. I have the following, nume…

---

## [P3D: Two towers with a connecting bridge - QuadStrip](https://discourse.processing.org/t/p3d-two-towers-with-a-connecting-bridge-quadstrip/14109)

<div class="topic-metadata">

**Author:** [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Replies:** 6\
**Last updated:** [November 2, 2020, 5:47pm UTC](https://discourse.processing.org/t/p3d-two-towers-with-a-connecting-bridge-quadstrip/14109 "2020-11-02T17:47:16Z")

</div>

I have a more general question concerning how to make two towers with a connecting bridge or more complex stuff. I understand I can make ONE tower using QuadStrip. And the other tower and the bridge too. But how would …

---

## [Basic Array Question](https://discourse.processing.org/t/basic-array-question/25077)

<div class="topic-metadata">

**Author:** [@joe\_processing](https://discourse.processing.org/u/joe_processing)\
**Replies:** 1\
**Last updated:** [October 31, 2020, 6:26pm UTC](https://discourse.processing.org/t/basic-array-question/25077 "2020-10-31T18:26:45Z")

</div>

Hi there! I’ve noobie question… I wrote a code that makes a ball appear when the key pressed minus or plus. two questions: I want every press will make one ball (now it looks like 3 at a time). how do I make the arr…

---

## [Show "explosions" in which many dots scatter away from the location of a mouse click](https://discourse.processing.org/t/show-explosions-in-which-many-dots-scatter-away-from-the-location-of-a-mouse-click/25106)

<div class="topic-metadata">

**Author:** [@jeremy](https://discourse.processing.org/u/jeremy)\
**Replies:** 1\
**Last updated:** [November 1, 2020, 10:31am UTC](https://discourse.processing.org/t/show-explosions-in-which-many-dots-scatter-away-from-the-location-of-a-mouse-click/25106 "2020-11-01T10:31:19Z")

</div>

Hi,I’ve a question. I want to write a code like this: Can anyone give me a example ? Thank you!

---

## [How to move the color?](https://discourse.processing.org/t/how-to-move-the-color/25074)

<div class="topic-metadata">

**Author:** [@GoodPro](https://discourse.processing.org/u/GoodPro)\
**Replies:** 2\
**Last updated:** [November 1, 2020, 8:10am UTC](https://discourse.processing.org/t/how-to-move-the-color/25074 "2020-11-01T08:10:50Z")

</div>

Hi, everyone, I’m working on a project to make a car teaser with processing. I want to add a motion that moves the red LED light from left to right, and I want someone to help me. I tried randomizing the color of the st…

---

## [Problem converting canny algorithm to shader](https://discourse.processing.org/t/problem-converting-canny-algorithm-to-shader/25052)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 0\
**Last updated:** [October 30, 2020, 3:47pm UTC](https://discourse.processing.org/t/problem-converting-canny-algorithm-to-shader/25052 "2020-10-30T15:47:34Z")

</div>

I’m struggling to produce the same output in glsl. Here is the processing code. void getNeighboursMax3(int x, int y,float t) { boolean k = false; int p = x + y \* img.width; float red = red(sobel.pixels…

---

## [Problem with multiple inputs](https://discourse.processing.org/t/problem-with-multiple-inputs/25066)

<div class="topic-metadata">

**Author:** [@lepetoc](https://discourse.processing.org/u/lepetoc)\
**Replies:** 3\
**Last updated:** [October 31, 2020, 4:06pm UTC](https://discourse.processing.org/t/problem-with-multiple-inputs/25066 "2020-10-31T16:06:18Z")

</div>

Hello, i’m actually trying to code a litlle, i’m at the beginning and i’m trying to do the character movement, i searched some codes to handle multiple inputs, but i have a problem that i cannot understand : void keyPr…

---

## [Preview of flight path for 3d gravity sim](https://discourse.processing.org/t/preview-of-flight-path-for-3d-gravity-sim/25053)

<div class="topic-metadata">

**Author:** [@Kport1](https://discourse.processing.org/u/Kport1)\
**Replies:** 0\
**Last updated:** [October 30, 2020, 5:00pm UTC](https://discourse.processing.org/t/preview-of-flight-path-for-3d-gravity-sim/25053 "2020-10-30T17:00:27Z")

</div>

im trying to programm a 3d gravity simulation, but the preview of the flight path of a selected Planet isnt working. I have marked the section in the code where this preview is calculated. Thx Code: class Planet extend…

---

## [Does anyone know why I get this IndexOutOfBoundsExceptions error](https://discourse.processing.org/t/does-anyone-know-why-i-get-this-indexoutofboundsexceptions-error/25059)

<div class="topic-metadata">

**Author:** [@eltorres](https://discourse.processing.org/u/eltorres)\
**Replies:** 1\
**Last updated:** [October 30, 2020, 9:37pm UTC](https://discourse.processing.org/t/does-anyone-know-why-i-get-this-indexoutofboundsexceptions-error/25059 "2020-10-30T21:37:29Z")

</div>

PFont font; ArrayList\<walkers\> l = new ArrayList\<walkers\>(); ArrayList\<walkers\> i = new ArrayList\<walkers\>(); ArrayList\<walkers\> L = new ArrayList\<walkers\>(); int mongolicos = 10; int proteccion = 5; int infectado\_pro…

---

## [Need to obtain object name in constructor(Solution:Referencing)](https://discourse.processing.org/t/need-to-obtain-object-name-in-constructor-solution-referencing/25039)

<div class="topic-metadata">

**Author:** [@xX\_pokeman2003\_Xx](https://discourse.processing.org/u/xX_pokeman2003_Xx)\
**Replies:** 10\
**Last updated:** [October 30, 2020, 9:13pm UTC](https://discourse.processing.org/t/need-to-obtain-object-name-in-constructor-solution-referencing/25039 "2020-10-30T21:13:29Z")

</div>

For transparency sake, I left the original post here, but the solution for the actual question itself is pretty simple:You can’t. HOWEVER, there is a work around that lets you do something similar, by referencing the obj…

---

## [How to create shuffling effect when mouse pressed and choose one when mouse is released](https://discourse.processing.org/t/how-to-create-shuffling-effect-when-mouse-pressed-and-choose-one-when-mouse-is-released/25054)

<div class="topic-metadata">

**Author:** [@ljna227](https://discourse.processing.org/u/ljna227)\
**Replies:** 0\
**Last updated:** [October 30, 2020, 5:50pm UTC](https://discourse.processing.org/t/how-to-create-shuffling-effect-when-mouse-pressed-and-choose-one-when-mouse-is-released/25054 "2020-10-30T17:50:45Z")

</div>

So I have an array of pictures and another array of names of the pictures. When the mouse is pressed, the names and pictures appear on the screen and shuffles. When the mouse is realeased, it stops at one image and corre…

---

## [Need to run something after declaring an object](https://discourse.processing.org/t/need-to-run-something-after-declaring-an-object/25038)

<div class="topic-metadata">

**Author:** [@xX\_pokeman2003\_Xx](https://discourse.processing.org/u/xX_pokeman2003_Xx)\
**Replies:** 2\
**Last updated:** [October 30, 2020, 5:28am UTC](https://discourse.processing.org/t/need-to-run-something-after-declaring-an-object/25038 "2020-10-30T05:28:18Z")

</div>

I’m currently writing a bit of code I want to reuse in other projects. It’s a GUI framework. The problem is that I don’t want to constantly keep typing in a specific line of code every single time I start using whatever …

---

## [I need help with my game (snake game)](https://discourse.processing.org/t/i-need-help-with-my-game-snake-game/24984)

<div class="topic-metadata">

**Author:** [@umar](https://discourse.processing.org/u/umar)\
**Replies:** 9\
**Last updated:** [October 29, 2020, 11:44pm UTC](https://discourse.processing.org/t/i-need-help-with-my-game-snake-game/24984 "2020-10-29T23:44:32Z")

</div>

It’s actually a snake game, but with 16 by 8 blocks window size, where yellow is for banana(+10 points), red is for apple(+5 points) and green block is for cameleon(-5 points). The problem I’m facing is that my fruits ar…

---

## [Debug to processing pjs from processing 3](https://discourse.processing.org/t/debug-to-processing-pjs-from-processing-3/25004)

<div class="topic-metadata">

**Author:** [@adrianmc](https://discourse.processing.org/u/adrianmc)\
**Replies:** 4\
**Last updated:** [October 29, 2020, 6:13pm UTC](https://discourse.processing.org/t/debug-to-processing-pjs-from-processing-3/25004 "2020-10-29T18:13:47Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hi all I’m having a problem trying to upload this code to a website, I understand pjs runs with and older version of processing, however I’m not…

---

## [Need some help in creating a simulation](https://discourse.processing.org/t/need-some-help-in-creating-a-simulation/24999)

<div class="topic-metadata">

**Author:** [@Toninuin](https://discourse.processing.org/u/Toninuin)\
**Replies:** 4\
**Last updated:** [October 29, 2020, 10:02pm UTC](https://discourse.processing.org/t/need-some-help-in-creating-a-simulation/24999 "2020-10-29T22:02:32Z")

</div>

Hey people! I’m really new to processing and programming as a whole and I’m trying to do a simulation of a terrain with pseudo-realistic river flow logic. Its a 2D array with perlin noise that does the trick for the terr…

---

## [Moving a picture](https://discourse.processing.org/t/moving-a-picture/25018)

<div class="topic-metadata">

**Author:** [@AntiQliMax](https://discourse.processing.org/u/AntiQliMax)\
**Replies:** 1\
**Last updated:** [October 29, 2020, 4:02pm UTC](https://discourse.processing.org/t/moving-a-picture/25018 "2020-10-29T16:02:26Z")

</div>

Well at this point i worked a bit further, The goal is that a fish should jump from a random start position to another (hard coded route) to another end point. I know you guys don’t have the pictures and I am sorry for …

---

## [How to create button that makes lines of text appear randomly](https://discourse.processing.org/t/how-to-create-button-that-makes-lines-of-text-appear-randomly/25017)

<div class="topic-metadata">

**Author:** [@dreabirdflies](https://discourse.processing.org/u/dreabirdflies)\
**Replies:** 1\
**Last updated:** [October 29, 2020, 4:00pm UTC](https://discourse.processing.org/t/how-to-create-button-that-makes-lines-of-text-appear-randomly/25017 "2020-10-29T16:00:30Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Wondering how to do this?

---

## [Need help with centipede / snake game](https://discourse.processing.org/t/need-help-with-centipede-snake-game/24982)

<div class="topic-metadata">

**Author:** [@zezo](https://discourse.processing.org/u/zezo)\
**Replies:** 8\
**Last updated:** [October 29, 2020, 3:45pm UTC](https://discourse.processing.org/t/need-help-with-centipede-snake-game/24982 "2020-10-29T15:45:26Z")

</div>

Hello guys! So I’ve been working on a snake game (kind of ) for school recently but I’m kinda stuck on a part. Because I need to add (invisible) pieces of food on screen and when the snake eats it, the snake needs to be…

---

## [If statement problems](https://discourse.processing.org/t/if-statement-problems/25012)

<div class="topic-metadata">

**Author:** [@AntiQliMax](https://discourse.processing.org/u/AntiQliMax)\
**Replies:** 4\
**Last updated:** [October 29, 2020, 1:40pm UTC](https://discourse.processing.org/t/if-statement-problems/25012 "2020-10-29T13:40:52Z")

</div>

Hello, I am new to processing and programming in general, as of a project for school I ran into a problem. The goal is that a random number will be generated, with a click on a the mouse, after that it should go to the …

---

## [Planet Generation](https://discourse.processing.org/t/planet-generation/24966)

<div class="topic-metadata">

**Author:** [@HumanoidX](https://discourse.processing.org/u/HumanoidX)\
**Replies:** 2\
**Last updated:** [October 29, 2020, 1:37am UTC](https://discourse.processing.org/t/planet-generation/24966 "2020-10-29T01:37:29Z")

</div>

I’m doing a planet generation program. My code: import peasy.\*; PVector resolution = new PVector(200,200); PVector\[\]\[\] basicGlobe = new PVector\[round(resolution.x) + 1\]\[round(resolution.y) + 1\]; float radius = 400; P…

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

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