# Coding Questions

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

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

**Page:** 139

---

## [Arrays and colors](https://discourse.processing.org/t/arrays-and-colors/11526)

<div class="topic-metadata">

**Author:** [@Darius](https://discourse.processing.org/u/Darius)\
**Replies:** 3\
**Last updated:** [May 23, 2019, 10:58pm UTC](https://discourse.processing.org/t/arrays-and-colors/11526 "2019-05-23T22:58:55Z")

</div>

Hi All, I am very new in processing and I am trying to use an array to change the color of my background color by clicking with the mouse to use numbers from 0 to 4. This seems not really working on my sketch, any sugges…

---

## [Character and button](https://discourse.processing.org/t/character-and-button/11436)

<div class="topic-metadata">

**Author:** [@macabol](https://discourse.processing.org/u/macabol)\
**Replies:** 3\
**Last updated:** [May 23, 2019, 3:33pm UTC](https://discourse.processing.org/t/character-and-button/11436 "2019-05-23T15:33:27Z")

</div>

hello I would add a button that can make me choose different character when I play. Thank you for your answer here is my script: PImage lapin;//image boule PImage fond;//fond PImage fleche;//fleche PImage fleche2;//flec…

---

## [How to fix my scoring code and how to input a game over feature/screen when the ball hit the ground?](https://discourse.processing.org/t/how-to-fix-my-scoring-code-and-how-to-input-a-game-over-feature-screen-when-the-ball-hit-the-ground/11402)

<div class="topic-metadata">

**Author:** [@grodothefrog](https://discourse.processing.org/u/grodothefrog)\
**Replies:** 34\
**Last updated:** [May 23, 2019, 10:09am UTC](https://discourse.processing.org/t/how-to-fix-my-scoring-code-and-how-to-input-a-game-over-feature-screen-when-the-ball-hit-the-ground/11402 "2019-05-23T10:09:46Z")

</div>

Hello, I’ve wondering of how I want my ball to score into the brown box and how to make a ball disappear upon collision with the brown box to score a goal. And how to place a game over feature/screen when the ball it the…

---

## [Heat Mapping Solutions](https://discourse.processing.org/t/heat-mapping-solutions/11424)

<div class="topic-metadata">

**Author:** [@davidbambalan](https://discourse.processing.org/u/davidbambalan)\
**Replies:** 3\
**Last updated:** [May 23, 2019, 1:47am UTC](https://discourse.processing.org/t/heat-mapping-solutions/11424 "2019-05-23T01:47:44Z")

</div>

Are there any solutions to creating a heat map from collected data (i.e., gps location and temperature sensor), a library maybe? And the solution should be in real-time. Thanks! Here’s the code I found online but I don’…

---

## [Simulate a trigger as switch/case with the keyboard](https://discourse.processing.org/t/simulate-a-trigger-as-switch-case-with-the-keyboard/11420)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 5\
**Last updated:** [May 22, 2019, 11:51pm UTC](https://discourse.processing.org/t/simulate-a-trigger-as-switch-case-with-the-keyboard/11420 "2019-05-22T23:51:11Z")

</div>

Hi , I would like my program switch on the same case automatically, in order to actualise data from void draw. For the moment, I have to tap on the shift key to actualise the case ‘default’. In this way, each time I ta…

---

## [Recursion Function or something different?](https://discourse.processing.org/t/recursion-function-or-something-different/11473)

<div class="topic-metadata">

**Author:** [@champagnepapi](https://discourse.processing.org/u/champagnepapi)\
**Replies:** 6\
**Last updated:** [May 22, 2019, 6:34pm UTC](https://discourse.processing.org/t/recursion-function-or-something-different/11473 "2019-05-22T18:34:22Z")

</div>

Hey, so I am fairly new to processing, my main area of interested is using processing to achieve effects which are primarily using typography. Recently I stumbled upon the following image —\> and it seems after a good…

---

## [Fade in/out effect](https://discourse.processing.org/t/fade-in-out-effect/11483)

<div class="topic-metadata">

**Author:** [@clueless\_coder](https://discourse.processing.org/u/clueless_coder)\
**Replies:** 4\
**Last updated:** [May 22, 2019, 3:37pm UTC](https://discourse.processing.org/t/fade-in-out-effect/11483 "2019-05-22T15:37:03Z")

</div>

So I have this code and I’m trying to make the text fade in and out. I could make in fade in but I couldn’t make it fade out. Could anyone help me? int t=10; //transparency void setup() { size(200,200); } void draw() …

---

## [Can't seem to map latitude and longitude coordinates correctly in Processing 3](https://discourse.processing.org/t/cant-seem-to-map-latitude-and-longitude-coordinates-correctly-in-processing-3/734)

<div class="topic-metadata">

**Author:** [@bindaeduk](https://discourse.processing.org/u/bindaeduk)\
**Replies:** 9\
**Last updated:** [May 22, 2019, 6:21am UTC](https://discourse.processing.org/t/cant-seem-to-map-latitude-and-longitude-coordinates-correctly-in-processing-3/734 "2019-05-22T06:21:25Z")

</div>

Hi there, I’m trying to make a very basic Processing sketch, where I map out the latitude and longitude points that my watch tracks on my bike rides. I’m able to parse the XML data from the location source, and I’ve se…

---

## [Rotate and translate](https://discourse.processing.org/t/rotate-and-translate/11392)

<div class="topic-metadata">

**Author:** [@marcholman23](https://discourse.processing.org/u/marcholman23)\
**Replies:** 6\
**Last updated:** [May 21, 2019, 7:58pm UTC](https://discourse.processing.org/t/rotate-and-translate/11392 "2019-05-21T19:58:26Z")

</div>

Hi, I am working on learning how to rotate an image to follow the mouse using a formula from Keith Peters HTML5 Animation. I am curious why the following code does not rotate the image completely. It seems to only swi…

---

## [How loop 2 diferent images](https://discourse.processing.org/t/how-loop-2-diferent-images/11470)

<div class="topic-metadata">

**Author:** [@johnpt](https://discourse.processing.org/u/johnpt)\
**Replies:** 11\
**Last updated:** [May 21, 2019, 7:08pm UTC](https://discourse.processing.org/t/how-loop-2-diferent-images/11470 "2019-05-21T19:08:34Z")

</div>

Hey guys. I’m a student and I have a processing class. I have to do a game to pass. I just started and I can’t make one of the png image moving. So the clouds are moving to the right side, and I want the airplane to co…

---

## [mouseWheel event.getCount OS difference](https://discourse.processing.org/t/mousewheel-event-getcount-os-difference/11378)

<div class="topic-metadata">

**Author:** [@mala](https://discourse.processing.org/u/mala)\
**Replies:** 11\
**Last updated:** [May 20, 2019, 1:10pm UTC](https://discourse.processing.org/t/mousewheel-event-getcount-os-difference/11378 "2019-05-20T13:10:45Z")

</div>

Has anyone any insight into why getCount on the mousewheel returns differently on OSX(10.14) to Windows(10) ? On OSX the code below will return a range from -12 to 12 dependent on how far the wheel is scrolled. On Wind…

---

## [Time delay issue](https://discourse.processing.org/t/time-delay-issue/11398)

<div class="topic-metadata">

**Author:** [@fewy](https://discourse.processing.org/u/fewy)\
**Replies:** 2\
**Last updated:** [May 20, 2019, 1:19am UTC](https://discourse.processing.org/t/time-delay-issue/11398 "2019-05-20T01:19:50Z")

</div>

I’ve just started learing how to program in processing a couple of days ago and the nxtlvl function gets to be called when 5 points are reached, which means a level is completed. My problem is that the pause() function i…

---

## [Processing, button, void](https://discourse.processing.org/t/processing-button-void/11199)

<div class="topic-metadata">

**Author:** [@macabol](https://discourse.processing.org/u/macabol)\
**Replies:** 31\
**Last updated:** [May 20, 2019, 12:44am UTC](https://discourse.processing.org/t/processing-button-void/11199 "2019-05-20T00:44:00Z")

</div>

Hello everyone I have a presentation of a computer game and my program works very well but when I have to add a button there is a problem with void reset. I will need your help please to be able to add a menu with a butt…

---

## [ArrayList issue?](https://discourse.processing.org/t/arraylist-issue/11323)

<div class="topic-metadata">

**Author:** [@p4stoboy](https://discourse.processing.org/u/p4stoboy)\
**Replies:** 5\
**Last updated:** [May 19, 2019, 10:36pm UTC](https://discourse.processing.org/t/arraylist-issue/11323 "2019-05-19T22:36:39Z")

</div>

I have this Female class that has an array of coordinates, the move() method adds those coordinates to the Female’s location every tick to move the object etc. etc. My issue is that I have an arrayList full of these obje…

---

## [How to "smooth" noise results](https://discourse.processing.org/t/how-to-smooth-noise-results/11307)

<div class="topic-metadata">

**Author:** [@glaem](https://discourse.processing.org/u/glaem)\
**Replies:** 4\
**Last updated:** [May 19, 2019, 9:43pm UTC](https://discourse.processing.org/t/how-to-smooth-noise-results/11307 "2019-05-19T21:43:11Z")

</div>

I know that noise returns a value between 0,1. I’m looking for a way to “smooth” the noise. Maybe instead of returning .5, .6, .3 etc. it would return .5, .5, .6, .6, .3, .3 basically I want to hold the noise value …

---

## [Memory Usage Optimization](https://discourse.processing.org/t/memory-usage-optimization/11375)

<div class="topic-metadata">

**Author:** [@MrPyro](https://discourse.processing.org/u/MrPyro)\
**Replies:** 5\
**Last updated:** [May 19, 2019, 9:12pm UTC](https://discourse.processing.org/t/memory-usage-optimization/11375 "2019-05-19T21:12:01Z")

</div>

I’m currently working on a project that needs the ability to draw 500 \* 500 \* 256 boxes. \[https://github.com/Mr-Pyro/3DSV\]. I am running out of ram. The PShape storing just the boxes alone seems to be approaching 2-3GB e…

---

## [Sequence of rotation](https://discourse.processing.org/t/sequence-of-rotation/3184)

<div class="topic-metadata">

**Author:** [@kll](https://discourse.processing.org/u/kll)\
**Replies:** 7\
**Last updated:** [May 19, 2019, 4:59pm UTC](https://discourse.processing.org/t/sequence-of-rotation/3184 "2019-05-19T16:59:44Z")

</div>

does the sequence in what i use rotation matter? like by rotateZ(radians(alphaZ)); rotateY(radians(alphaY)); rotateX(radians(alphaX)); show\_object(); rotateX(radians(-alphaX)); rotateY(radians(-alphaY)); rotateZ(radian…

---

## [Simplest method for pshape triangle with rounded corners?](https://discourse.processing.org/t/simplest-method-for-pshape-triangle-with-rounded-corners/8563)

<div class="topic-metadata">

**Author:** [@mala](https://discourse.processing.org/u/mala)\
**Replies:** 4\
**Last updated:** [May 19, 2019, 10:11am UTC](https://discourse.processing.org/t/simplest-method-for-pshape-triangle-with-rounded-corners/8563 "2019-05-19T10:11:23Z")

</div>

Has anyone got any suggestions for this ? It can be drawn point by point rather tediously with vertex and beziervertex, but is there maybe an easier method ? Thanks for any suggestions. mala

---

## [Functional Stencils() and Brushes()](https://discourse.processing.org/t/functional-stencils-and-brushes/11291)

<div class="topic-metadata">

**Author:** [@Student40](https://discourse.processing.org/u/Student40)\
**Replies:** 4\
**Last updated:** [May 19, 2019, 6:14am UTC](https://discourse.processing.org/t/functional-stencils-and-brushes/11291 "2019-05-19T06:14:58Z")

</div>

having a hard time incorporating this into a code, any help would be great. the directions state to do this for my assignment each key a,s,d,f,g will be assigned to call a different function use noLoop(), loop(), comb…

---

## [Pong - problems with boundary check](https://discourse.processing.org/t/pong-problems-with-boundary-check/11367)

<div class="topic-metadata">

**Author:** [@marcholman23](https://discourse.processing.org/u/marcholman23)\
**Replies:** 11\
**Last updated:** [May 19, 2019, 3:32am UTC](https://discourse.processing.org/t/pong-problems-with-boundary-check/11367 "2019-05-19T03:32:08Z")

</div>

Hi, I’m new to processing and working on implementing a simple pong like program. At this point I have created a Ball and a Paddle. The Paddle is simply a rectangle that tracks the mouseX variable. Now I am working o…

---

## [Imageloader, How to convert Image to PImage?](https://discourse.processing.org/t/imageloader-how-to-convert-image-to-pimage/11357)

<div class="topic-metadata">

**Author:** [@Palp](https://discourse.processing.org/u/Palp)\
**Replies:** 1\
**Last updated:** [May 18, 2019, 3:35pm UTC](https://discourse.processing.org/t/imageloader-how-to-convert-image-to-pimage/11357 "2019-05-18T15:35:35Z")

</div>

Hello, I am trying to Load images from data folder with string on by one with 2 seconds of displaying time, and get pixel brightness value from these images. What I have: String path = sketchPath("data"); ImageLoader …

---

## [How do I integrate dist() into my current code?](https://discourse.processing.org/t/how-do-i-integrate-dist-into-my-current-code/11313)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 14\
**Last updated:** [May 18, 2019, 11:39pm UTC](https://discourse.processing.org/t/how-do-i-integrate-dist-into-my-current-code/11313 "2019-05-18T23:39:40Z")

</div>

Below is a simple program I am trying to build up. When the Ball object and Donut object intersect I would like: 1/ the ball to turn red 2/ the donut to turn blue 3/ the background to be a random color When there is…

---

## [Detect if any window in the sketch is the active window](https://discourse.processing.org/t/detect-if-any-window-in-the-sketch-is-the-active-window/8989)

<div class="topic-metadata">

**Author:** [@jamcdonald](https://discourse.processing.org/u/jamcdonald)\
**Replies:** 9\
**Last updated:** [May 18, 2019, 8:30pm UTC](https://discourse.processing.org/t/detect-if-any-window-in-the-sketch-is-the-active-window/8989 "2019-05-18T20:30:59Z")

</div>

I have a 2+ windows processing Sketch, I want 1 windows to stay on top of all the other windows in the sketch, to do this I am using surface.setAlwaysOnTop(true);, however this puts the window on top of all windows, not …

---

## [Two level to my game](https://discourse.processing.org/t/two-level-to-my-game/11281)

<div class="topic-metadata">

**Author:** [@macabol](https://discourse.processing.org/u/macabol)\
**Replies:** 19\
**Last updated:** [May 17, 2019, 7:31pm UTC](https://discourse.processing.org/t/two-level-to-my-game/11281 "2019-05-17T19:31:14Z")

</div>

Hello everyone I urgently need your help I must make my game tomorrow and I just miss it to do 2 level to my game but I do not know how to do it. Thank you for your help and here is my code: PImage img;//image boule PIm…

---

## [Paint line question](https://discourse.processing.org/t/paint-line-question/11312)

<div class="topic-metadata">

**Author:** [@Nick1](https://discourse.processing.org/u/Nick1)\
**Replies:** 4\
**Last updated:** [May 17, 2019, 3:26pm UTC](https://discourse.processing.org/t/paint-line-question/11312 "2019-05-17T15:26:55Z")

</div>

Hey, I want to draw a line with my “paint” program but is does not draw. Can anyone help me? Thanks int akt\_links, akt\_breite, akt\_oben, akt\_hoehe; boolean zeichnen\_aktiv, zeichnen\_aktiv\_linie, loeschen, viereck, kre…

---

## [\[SOLVED\] While using Javafx for playing a video, how can i make a "rect", for example, appear in front of it?](https://discourse.processing.org/t/solved-while-using-javafx-for-playing-a-video-how-can-i-make-a-rect-for-example-appear-in-front-of-it/11173)

<div class="topic-metadata">

**Author:** [@94matheus](https://discourse.processing.org/u/94matheus)\
**Replies:** 8\
**Last updated:** [May 17, 2019, 1:37pm UTC](https://discourse.processing.org/t/solved-while-using-javafx-for-playing-a-video-how-can-i-make-a-rect-for-example-appear-in-front-of-it/11173 "2019-05-17T13:37:16Z")

</div>

Hi! I’m using PApplet inside Eclipse (A college assignment requires that we use Processing IDE but I need some of Java functions to make it work the way I envision it) and everytime a video starts playing (through java…

---

## [LerpColor seamless motion](https://discourse.processing.org/t/lerpcolor-seamless-motion/11303)

<div class="topic-metadata">

**Author:** [@ale.moso](https://discourse.processing.org/u/ale.moso)\
**Replies:** 6\
**Last updated:** [May 16, 2019, 6:24pm UTC](https://discourse.processing.org/t/lerpcolor-seamless-motion/11303 "2019-05-16T18:24:46Z")

</div>

Hi dear community, I want to made gradients where colors move from one to another constantly changing but whitout a blink like a flow of colors. Any ideas in how acomplish this? Many thanks

---

## [NullPointerException with objects](https://discourse.processing.org/t/nullpointerexception-with-objects/11280)

<div class="topic-metadata">

**Author:** [@DoubleTony](https://discourse.processing.org/u/DoubleTony)\
**Replies:** 2\
**Last updated:** [May 15, 2019, 4:43pm UTC](https://discourse.processing.org/t/nullpointerexception-with-objects/11280 "2019-05-15T16:43:23Z")

</div>

Hi I’m creating a random maze generator but it doesn’t seem to generate the cells that make up the maze and I get a NullPointerException when I try to access the cells to give them the position of the vertices, I ask for…

---

## [Problem with procesing in game](https://discourse.processing.org/t/problem-with-procesing-in-game/11265)

<div class="topic-metadata">

**Author:** [@Garcia](https://discourse.processing.org/u/Garcia)\
**Replies:** 2\
**Last updated:** [May 15, 2019, 2:56pm UTC](https://discourse.processing.org/t/problem-with-procesing-in-game/11265 "2019-05-15T14:56:09Z")

</div>

Hey guys! I have a little problem. I’m making a game for classes. It’s similar to Space Invaders. So when i’m press \<- (to left) and -\> (to right), sometimes it takes to move. Does anyone have a solution? My code fo…

---

## [How do I bounce all the balls?](https://discourse.processing.org/t/how-do-i-bounce-all-the-balls/11225)

<div class="topic-metadata">

**Author:** [@tai](https://discourse.processing.org/u/tai)\
**Replies:** 2\
**Last updated:** [May 15, 2019, 2:21pm UTC](https://discourse.processing.org/t/how-do-i-bounce-all-the-balls/11225 "2019-05-15T14:21:54Z")

</div>

Nice to meet you. Use this site for the first time. I am worried about not doing anything rude. I want you to help. I want all the balls to bounce the wall. However, only one ball bounces the wall. Please tell me h…

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

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