# Coding Questions

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

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

**Page:** 102

---

## [Looking for tricks](https://discourse.processing.org/t/looking-for-tricks/19394)

<div class="topic-metadata">

**Author:** [@Helron](https://discourse.processing.org/u/Helron)\
**Replies:** 6\
**Last updated:** [April 5, 2020, 3:28pm UTC](https://discourse.processing.org/t/looking-for-tricks/19394 "2020-04-05T15:28:57Z")

</div>

Hello, I am looking for tips and tricks … more than exemples that i can find… does it exist a collection of solutions for common develloppement need ? Ex : Buttons : imgcoord + mouse click or P5 library or distance to…

---

## [Shader shows as white instead of the actual shader (Not applied correctly)](https://discourse.processing.org/t/shader-shows-as-white-instead-of-the-actual-shader-not-applied-correctly/19393)

<div class="topic-metadata">

**Author:** [@gbrochar](https://discourse.processing.org/u/gbrochar)\
**Replies:** 0\
**Last updated:** [April 4, 2020, 3:37pm UTC](https://discourse.processing.org/t/shader-shows-as-white-instead-of-the-actual-shader-not-applied-correctly/19393 "2020-04-04T15:37:22Z")

</div>

Hello, I programmed a little shader using C++ OpenGL to compile and run it today and I’m doing an numerical art exhibition using mainly processing, I want to use this shader in the show and thus have to make the shader w…

---

## [How could I make p5 work in a cartesian coordinate system?](https://discourse.processing.org/t/how-could-i-make-p5-work-in-a-cartesian-coordinate-system/19376)

<div class="topic-metadata">

**Author:** [@Night-11010](https://discourse.processing.org/u/Night-11010)\
**Replies:** 5\
**Last updated:** [April 4, 2020, 1:55pm UTC](https://discourse.processing.org/t/how-could-i-make-p5-work-in-a-cartesian-coordinate-system/19376 "2020-04-04T13:55:41Z")

</div>

I kind of get what I want but I still have problems using mouseX and mouseY, they don’t work propertly when I try to change it.

---

## [Trying Curve on a Sphere. Can't seem to get the rise and fall of the curve right](https://discourse.processing.org/t/trying-curve-on-a-sphere-cant-seem-to-get-the-rise-and-fall-of-the-curve-right/19355)

<div class="topic-metadata">

**Author:** [@Samizen](https://discourse.processing.org/u/Samizen)\
**Replies:** 5\
**Last updated:** [April 4, 2020, 1:19am UTC](https://discourse.processing.org/t/trying-curve-on-a-sphere-cant-seem-to-get-the-rise-and-fall-of-the-curve-right/19355 "2020-04-04T01:19:55Z")

</div>

Was trying something like this: But my curves were all wrong…And I ended up with something like this. The code is inserted below: float angle; float r = 200; Table table; PImage earth; PShape globe; int rowCoun…

---

## [Circular coordinates](https://discourse.processing.org/t/circular-coordinates/19344)

<div class="topic-metadata">

**Author:** [@lumicon9](https://discourse.processing.org/u/lumicon9)\
**Replies:** 7\
**Last updated:** [April 3, 2020, 9:54am UTC](https://discourse.processing.org/t/circular-coordinates/19344 "2020-04-03T09:54:46Z")

</div>

how to make this circular coordinates more evenly distributed? …will say; the inner ring less dot frequency becoming more to the outer. maybe fibionacci like…? thank you! float px, py; float angle; float radius = width/…

---

## [Renderer Problems - Login System and Menu](https://discourse.processing.org/t/renderer-problems-login-system-and-menu/19331)

<div class="topic-metadata">

**Author:** [@DaysLoop](https://discourse.processing.org/u/DaysLoop)\
**Replies:** 8\
**Last updated:** [April 3, 2020, 9:58am UTC](https://discourse.processing.org/t/renderer-problems-login-system-and-menu/19331 "2020-04-03T09:58:06Z")

</div>

Sorry, but I’m inexperienced in Processing. I have um little test code where one menu open after login accepted. The two functions work individually, but when I put them together I have this error “translate(), or this…

---

## [Else if not triggering with boolean's](https://discourse.processing.org/t/else-if-not-triggering-with-booleans/19320)

<div class="topic-metadata">

**Author:** [@trevmasterfunk](https://discourse.processing.org/u/trevmasterfunk)\
**Replies:** 2\
**Last updated:** [April 3, 2020, 1:07am UTC](https://discourse.processing.org/t/else-if-not-triggering-with-booleans/19320 "2020-04-03T01:07:27Z")

</div>

Hello! After watching the coding train for a while I decided to download processing and start learning how to create my own programs. I started last week. Currently I am working on a infection simulation. I am trying t…

---

## [Hi I need help please :(](https://discourse.processing.org/t/hi-i-need-help-please/19343)

<div class="topic-metadata">

**Author:** [@DTTTO](https://discourse.processing.org/u/DTTTO)\
**Replies:** 4\
**Last updated:** [April 2, 2020, 4:52pm UTC](https://discourse.processing.org/t/hi-i-need-help-please/19343 "2020-04-02T16:52:40Z")

</div>

for my processing project im trying to make 3 pandas holding green bamboo. The bamboo is supposed to be made with using a quad. And it also needs to be used with keypressed, everytime I press the key it should turn to a …

---

## [Perlin Noise Project](https://discourse.processing.org/t/perlin-noise-project/19182)

<div class="topic-metadata">

**Author:** [@Michael\_processing](https://discourse.processing.org/u/Michael_processing)\
**Replies:** 3\
**Last updated:** [April 2, 2020, 4:33pm UTC](https://discourse.processing.org/t/perlin-noise-project/19182 "2020-04-02T16:33:34Z")

</div>

Hi! I found this code on openprocessing.org but I can’t get it to work in Processing. I would like to make my own version of it an be able to change it later on but I can’t start experimenting because I don’t know how t…

---

## [Hi can anyone help me with my game?](https://discourse.processing.org/t/hi-can-anyone-help-me-with-my-game/19162)

<div class="topic-metadata">

**Author:** [@alex21brom](https://discourse.processing.org/u/alex21brom)\
**Replies:** 10\
**Last updated:** [April 2, 2020, 2:52pm UTC](https://discourse.processing.org/t/hi-can-anyone-help-me-with-my-game/19162 "2020-04-02T14:52:06Z")

</div>

i am trying to make this image appear at random heights continuously class Chaser { int x; int y; float ran; int rani; PImage carimageY, carimageN, carimageW; Chaser() { x = Lane(); y = height-50; carimageY=lo…

---

## [rotationX/rotationY getting really slow](https://discourse.processing.org/t/rotationx-rotationy-getting-really-slow/19151)

<div class="topic-metadata">

**Author:** [@rubbs](https://discourse.processing.org/u/rubbs)\
**Replies:** 8\
**Last updated:** [April 2, 2020, 1:43pm UTC](https://discourse.processing.org/t/rotationx-rotationy-getting-really-slow/19151 "2020-04-02T13:43:03Z")

</div>

the rotation is gradually getting slower and really laggy, anyone know why this is happening? Many thanks, Callum // ------------------------------------START------------------------------------ // ~variables & imports…

---

## [Expecting }, found 'else'](https://discourse.processing.org/t/expecting-found-else/19328)

<div class="topic-metadata">

**Author:** [@soolim](https://discourse.processing.org/u/soolim)\
**Replies:** 4\
**Last updated:** [April 2, 2020, 1:25pm UTC](https://discourse.processing.org/t/expecting-found-else/19328 "2020-04-02T13:25:16Z")

</div>

Hello. An error occurred during processing coding. I don’t know what the problem is. In points (a,b), a wants to get a +d(random) The error is the same as ’ expecting }, found ‘else’ '. If you’re good at processin…

---

## [Many bouncing balls](https://discourse.processing.org/t/many-bouncing-balls/19165)

<div class="topic-metadata">

**Author:** [@dimdim](https://discourse.processing.org/u/dimdim)\
**Replies:** 2\
**Last updated:** [April 2, 2020, 3:21am UTC](https://discourse.processing.org/t/many-bouncing-balls/19165 "2020-04-02T03:21:16Z")

</div>

hi everyone, i have problem with my codes. i wanna try making animation many bouncing balls. my bouncing balls solved when all the balls force the all windows’s side. but the problem is the balls is still through the oth…

---

## [Does anyone know how to make a play button for a game?](https://discourse.processing.org/t/does-anyone-know-how-to-make-a-play-button-for-a-game/19302)

<div class="topic-metadata">

**Author:** [@Oppyusa](https://discourse.processing.org/u/Oppyusa)\
**Replies:** 1\
**Last updated:** [April 1, 2020, 8:44pm UTC](https://discourse.processing.org/t/does-anyone-know-how-to-make-a-play-button-for-a-game/19302 "2020-04-01T20:44:31Z")

</div>

I am trying to make a game and don’t know how to make the background change until a new button is pressed. Here is my code: PImage bg; int y; void setup() { size(1000, 700); bg = loadImage("download.jpeg"); } boo…

---

## [Wrap Text to Shapes](https://discourse.processing.org/t/wrap-text-to-shapes/18756)

<div class="topic-metadata">

**Author:** [@robdin](https://discourse.processing.org/u/robdin)\
**Replies:** 6\
**Last updated:** [April 1, 2020, 8:22pm UTC](https://discourse.processing.org/t/wrap-text-to-shapes/18756 "2020-04-01T20:22:46Z")

</div>

Hello, I’m traying to wrap a image to shape. I see that i can do it with a shape and a texture. The only problem is that textureWrape(textureWrap() / Reference / Processing.org) seems to works only on a beginshape and …

---

## [Problem with missing ball (foo)](https://discourse.processing.org/t/problem-with-missing-ball-foo/19276)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 7\
**Last updated:** [April 1, 2020, 8:01pm UTC](https://discourse.processing.org/t/problem-with-missing-ball-foo/19276 "2020-04-01T20:01:25Z")

</div>

I have a sketch (see below) where a ball moves. When I tested it, everything seems to work but now the ball has gone off the screen to the right somewhere. How do I get my ball back? Ball\[\] balls = new Ball\[1\]; void s…

---

## [Requirements that Processing has for loading TIFF files](https://discourse.processing.org/t/requirements-that-processing-has-for-loading-tiff-files/19281)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 14\
**Last updated:** [April 1, 2020, 8:00pm UTC](https://discourse.processing.org/t/requirements-that-processing-has-for-loading-tiff-files/19281 "2020-04-01T20:00:46Z")

</div>

Is there a way to find out the requirements that Processing has for loading TIFF files? The documents say only gif, .jpg, .tga, or .png but I can load TIFF if the TIFF has been made by Processing. Error: Processing can …

---

## [Array with for loop exercise in Nyhoff book](https://discourse.processing.org/t/array-with-for-loop-exercise-in-nyhoff-book/19277)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 3\
**Last updated:** [April 1, 2020, 5:44pm UTC](https://discourse.processing.org/t/array-with-for-loop-exercise-in-nyhoff-book/19277 "2020-04-01T17:44:45Z")

</div>

This is an exercise in the Nyhoff book. I am trying to figure out how to output to the consul the column position and the row position 5 times. So that it reads like this: column: random number, row: random number col…

---

## [How to move obstacles?](https://discourse.processing.org/t/how-to-move-obstacles/18944)

<div class="topic-metadata">

**Author:** [@NotConsumable](https://discourse.processing.org/u/NotConsumable)\
**Replies:** 6\
**Last updated:** [April 1, 2020, 3:37pm UTC](https://discourse.processing.org/t/how-to-move-obstacles/18944 "2020-04-01T15:37:42Z")

</div>

So I am trying to make a frogger game and I have everything doing what I need it to do, but my hazards wont move and everything i try to do does not work? I have no idea how to make them move and how to add another row a…

---

## [Problems with .svg libraries](https://discourse.processing.org/t/problems-with-svg-libraries/19206)

<div class="topic-metadata">

**Author:** [@CheckschDa](https://discourse.processing.org/u/CheckschDa)\
**Replies:** 3\
**Last updated:** [April 1, 2020, 2:03pm UTC](https://discourse.processing.org/t/problems-with-svg-libraries/19206 "2020-04-01T14:03:58Z")

</div>

Hello I’m having some Problems withe the .svg library. I wanted to write a little code, which should export 15 .svg files. But its only exporting the last one. Is my Code broken or is the .svg exporter not able to expor…

---

## [How to get distance from a line](https://discourse.processing.org/t/how-to-get-distance-from-a-line/19215)

<div class="topic-metadata">

**Author:** [@Cybernet](https://discourse.processing.org/u/Cybernet)\
**Replies:** 5\
**Last updated:** [April 1, 2020, 1:56pm UTC](https://discourse.processing.org/t/how-to-get-distance-from-a-line/19215 "2020-04-01T13:56:21Z")

</div>

So I have a line in my code. And a object moves alongside it. How can I say that if the object more than 50 pixels away from the line, then move the object. If the object is less than 50 pixels away from the line, then m…

---

## [Error: ArrayIndexOutOfBoundsException: -1](https://discourse.processing.org/t/error-arrayindexoutofboundsexception-1/19267)

<div class="topic-metadata">

**Author:** [@Sofia8425](https://discourse.processing.org/u/Sofia8425)\
**Replies:** 2\
**Last updated:** [April 1, 2020, 7:38am UTC](https://discourse.processing.org/t/error-arrayindexoutofboundsexception-1/19267 "2020-04-01T07:38:56Z")

</div>

I am trying to code a snake game. This isn’t the finished version, but I am already cluless. When I try to run it this error appears: ArrayIndexOutOfBoundsException: -1 Could not run the sketch (Target VM failed to ini…

---

## [2D Topographical Map](https://discourse.processing.org/t/2d-topographical-map/19260)

<div class="topic-metadata">

**Author:** [@heatmiser](https://discourse.processing.org/u/heatmiser)\
**Replies:** 1\
**Last updated:** [March 31, 2020, 6:41pm UTC](https://discourse.processing.org/t/2d-topographical-map/19260 "2020-03-31T18:41:42Z")

</div>

Hi, I’m very new to Processing. I’m looking to create a small square plot that has contour lines like the 2D topographical map shown in the image below. How would I go about doing this? Thanks.

---

## [How to make every drawing scale if canvas size is changed](https://discourse.processing.org/t/how-to-make-every-drawing-scale-if-canvas-size-is-changed/18697)

<div class="topic-metadata">

**Author:** [@Dan99](https://discourse.processing.org/u/Dan99)\
**Replies:** 2\
**Last updated:** [March 31, 2020, 12:42pm UTC](https://discourse.processing.org/t/how-to-make-every-drawing-scale-if-canvas-size-is-changed/18697 "2020-03-31T12:42:58Z")

</div>

I’m very new to coding and was wondering how i could change this code to scale if the canvas size was to change. I know its not the nicest or cleanest code but it works for how I understand it currently. void setup() {…

---

## [Make a shoot function](https://discourse.processing.org/t/make-a-shoot-function/19235)

<div class="topic-metadata">

**Author:** [@rune](https://discourse.processing.org/u/rune)\
**Replies:** 8\
**Last updated:** [March 31, 2020, 11:23am UTC](https://discourse.processing.org/t/make-a-shoot-function/19235 "2020-03-31T11:23:45Z")

</div>

Trying to make a copy of space invaders, it’s purely for fun but now i’ve used quite a while trying to make the shoot function work proberly. The problem is that my “bullet” disapears after i move my player, due to the f…

---

## [Cloud Animation - Processing Basics](https://discourse.processing.org/t/cloud-animation-processing-basics/19216)

<div class="topic-metadata">

**Author:** [@Dan99](https://discourse.processing.org/u/Dan99)\
**Replies:** 4\
**Last updated:** [March 31, 2020, 8:27am UTC](https://discourse.processing.org/t/cloud-animation-processing-basics/19216 "2020-03-31T08:27:42Z")

</div>

Need help, would love to call or share screen of discord with someone who is willing to lend a hand! I would like to be taught how to Click and drag clouds one at a time. constrained to above horizon. when another c…

---

## [How to draw a flower, rotate petals](https://discourse.processing.org/t/how-to-draw-a-flower-rotate-petals/19143)

<div class="topic-metadata">

**Author:** [@tengtengloves](https://discourse.processing.org/u/tengtengloves)\
**Replies:** 23\
**Last updated:** [March 30, 2020, 10:44pm UTC](https://discourse.processing.org/t/how-to-draw-a-flower-rotate-petals/19143 "2020-03-30T22:44:55Z")

</div>

Hi all, I’m have no idea with coding but I really tried hard to fix it. I was stuck to draw on the flower petal code, I have tried for couple times but it not works. The flower petal couldn’t be rotated. Plus, when I r…

---

## [Frogger game (make the frog not to go outside)](https://discourse.processing.org/t/frogger-game-make-the-frog-not-to-go-outside/18825)

<div class="topic-metadata">

**Author:** [@nhghi](https://discourse.processing.org/u/nhghi)\
**Replies:** 8\
**Last updated:** [March 20, 2020, 5:26pm UTC](https://discourse.processing.org/t/frogger-game-make-the-frog-not-to-go-outside/18825 "2020-03-20T17:26:40Z")

</div>

hi, guys, I’m trying to make a new game. the basic idea is if my green frog will go around the canvas but it will not go outside of it. I created a objectInCanvas() function to see if the frog goes outside or not. so rig…

---

## [Using loadImage with tiff](https://discourse.processing.org/t/using-loadimage-with-tiff/19205)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 0\
**Last updated:** [March 30, 2020, 8:07pm UTC](https://discourse.processing.org/t/using-loadimage-with-tiff/19205 "2020-03-30T20:07:42Z")

</div>

How do I load images that are .tiff format? loadImage() only works with ( .gif, .jpg, .tga, .png). I want to use tiff, not something else. Is there a different method, or a workaround? I saw loadImageIO() somewhere but i…

---

## [How can I add an object every minute?](https://discourse.processing.org/t/how-can-i-add-an-object-every-minute/19191)

<div class="topic-metadata">

**Author:** [@sandyveer](https://discourse.processing.org/u/sandyveer)\
**Replies:** 2\
**Last updated:** [March 30, 2020, 4:33pm UTC](https://discourse.processing.org/t/how-can-i-add-an-object-every-minute/19191 "2020-03-30T16:33:57Z")

</div>

Hii, I’m relatively new to processing and am currently trying to recreate this abstract clock: https://www.youtube.com/watch?v=93Jf32V1\_FU I am lost as to how to add a new square randomly on the canvas every minute. And…

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

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