# Coding Questions

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

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

**Page:** 138

---

## [Holding the ball in pong](https://discourse.processing.org/t/holding-the-ball-in-pong/11520)

<div class="topic-metadata">

**Author:** [@somedude](https://discourse.processing.org/u/somedude)\
**Replies:** 128\
**Last updated:** [May 30, 2019, 2:04am UTC](https://discourse.processing.org/t/holding-the-ball-in-pong/11520 "2019-05-30T02:04:29Z")

</div>

Hello im coding a pong game with a twist im trying to make it when the player holds the spacebar the bar holds the ball but im having trouble making the ball stop. thanks in advance if ( xpos \<= 30+size/2) { if (…

---

## [Using Noise to create "Biomes" for a map](https://discourse.processing.org/t/using-noise-to-create-biomes-for-a-map/11241)

<div class="topic-metadata">

**Author:** [@ILikePi](https://discourse.processing.org/u/ILikePi)\
**Replies:** 5\
**Last updated:** [May 30, 2019, 12:19am UTC](https://discourse.processing.org/t/using-noise-to-create-biomes-for-a-map/11241 "2019-05-30T00:19:21Z")

</div>

I currently am making some sort of map with biomes, I am attempting to use noise. I only know who to make simplex and perlin noise. I know there are many ways to make it so your noise does not repeat on itself… Right now…

---

## [Hi! I need some help in spawning ellipses at a set interval!](https://discourse.processing.org/t/hi-i-need-some-help-in-spawning-ellipses-at-a-set-interval/11691)

<div class="topic-metadata">

**Author:** [@imBrinCKER](https://discourse.processing.org/u/imBrinCKER)\
**Replies:** 17\
**Last updated:** [May 29, 2019, 11:12pm UTC](https://discourse.processing.org/t/hi-i-need-some-help-in-spawning-ellipses-at-a-set-interval/11691 "2019-05-29T23:12:08Z")

</div>

Hi, I was able to create the functionality of almost everything in the game I’m making, except the spawning of the orbs at a set interval. I looked up some forums and attempted multiple methods, but I’m stuck. Essentiall…

---

## [ArrayList interaction only recognizing one instance](https://discourse.processing.org/t/arraylist-interaction-only-recognizing-one-instance/11678)

<div class="topic-metadata">

**Author:** [@Lachieblue](https://discourse.processing.org/u/Lachieblue)\
**Replies:** 3\
**Last updated:** [May 29, 2019, 4:12pm UTC](https://discourse.processing.org/t/arraylist-interaction-only-recognizing-one-instance/11678 "2019-05-29T16:12:22Z")

</div>

Hello, I am trying to create a code that will link circles to squares if they are within a specified distance, I obviously want to expand upon this later but for now this is my code. int numBalls = 15; int numSquares = …

---

## [Having a second window makes the first tiny](https://discourse.processing.org/t/having-a-second-window-makes-the-first-tiny/11667)

<div class="topic-metadata">

**Author:** [@DerekCresswell](https://discourse.processing.org/u/DerekCresswell)\
**Replies:** 0\
**Last updated:** [May 29, 2019, 5:07am UTC](https://discourse.processing.org/t/having-a-second-window-makes-the-first-tiny/11667 "2019-05-29T05:07:35Z")

</div>

Using a SecondApplet class extending PApplet to create a second window. Works great for the second window. But the first window gets really small when I have settings() and draw() in my second class. Why does this happen…

---

## [Drawing fire in processing](https://discourse.processing.org/t/drawing-fire-in-processing/11581)

<div class="topic-metadata">

**Author:** [@Lili1](https://discourse.processing.org/u/Lili1)\
**Replies:** 3\
**Last updated:** [May 29, 2019, 1:55am UTC](https://discourse.processing.org/t/drawing-fire-in-processing/11581 "2019-05-29T01:55:54Z")

</div>

Does anyone know how can I create a fire symbol in processing?

---

## [Trying to recreate undertale in processing](https://discourse.processing.org/t/trying-to-recreate-undertale-in-processing/4809)

<div class="topic-metadata">

**Author:** [@jensemand](https://discourse.processing.org/u/jensemand)\
**Replies:** 10\
**Last updated:** [May 28, 2019, 5:29pm UTC](https://discourse.processing.org/t/trying-to-recreate-undertale-in-processing/4809 "2019-05-28T17:29:33Z")

</div>

Hi I haven’t used processing for so long and i am kinda new to programming. I decided to challenge myself by trying to recreate the videogame undertale because I thought it would be a fun thing to spend my time on. I hav…

---

## [\[CLOSED\] Images appearing while using rect()](https://discourse.processing.org/t/closed-images-appearing-while-using-rect/11517)

<div class="topic-metadata">

**Author:** [@YDGames](https://discourse.processing.org/u/YDGames)\
**Replies:** 19\
**Last updated:** [May 28, 2019, 6:00am UTC](https://discourse.processing.org/t/closed-images-appearing-while-using-rect/11517 "2019-05-28T06:00:54Z")

</div>

In my game there are enemies wandering around, their draw() method is simple: if(facingRight) { core.displayBuffer.image(image, x, y + offsetY, 80, 80); } else { …

---

## [How to draw a simple brain sketch in processing?](https://discourse.processing.org/t/how-to-draw-a-simple-brain-sketch-in-processing/11580)

<div class="topic-metadata">

**Author:** [@Lili1](https://discourse.processing.org/u/Lili1)\
**Replies:** 4\
**Last updated:** [May 28, 2019, 5:45am UTC](https://discourse.processing.org/t/how-to-draw-a-simple-brain-sketch-in-processing/11580 "2019-05-28T05:45:40Z")

</div>

Can someone help me in drawing a brain sketch in processing? If I want to put 7 brain sketches on the same page, how can I do that? Thanks

---

## [From Application to OpenProcessing](https://discourse.processing.org/t/from-application-to-openprocessing/11645)

<div class="topic-metadata">

**Author:** [@leejones15](https://discourse.processing.org/u/leejones15)\
**Replies:** 1\
**Last updated:** [May 28, 2019, 12:28am UTC](https://discourse.processing.org/t/from-application-to-openprocessing/11645 "2019-05-28T00:28:35Z")

</div>

Hello, all. I am a CS teacher and wrapped up the year (after using MIT App Inventor) teaching my students to use text-based coding through Processing. I am looking for a platform to share student work that doesn’t invo…

---

## [Display and scale text size from .csv file](https://discourse.processing.org/t/display-and-scale-text-size-from-csv-file/11633)

<div class="topic-metadata">

**Author:** [@Darius](https://discourse.processing.org/u/Darius)\
**Replies:** 16\
**Last updated:** [May 27, 2019, 9:27pm UTC](https://discourse.processing.org/t/display-and-scale-text-size-from-csv-file/11633 "2019-05-27T21:27:42Z")

</div>

Hi there, I am stuck again… I am building a small program using a .csv file to display the text information of each row. The program display one row/line of text for each mouse click…so far so good. I then tried to adap…

---

## [Detect if over object when object is zoomed/scaled](https://discourse.processing.org/t/detect-if-over-object-when-object-is-zoomed-scaled/11557)

<div class="topic-metadata">

**Author:** [@mala](https://discourse.processing.org/u/mala)\
**Replies:** 5\
**Last updated:** [May 27, 2019, 5:06pm UTC](https://discourse.processing.org/t/detect-if-over-object-when-object-is-zoomed-scaled/11557 "2019-05-27T17:06:43Z")

</div>

This bascially comes from an attempt at zoom and pan (not using peasyCam ) it’s part of a much bigger project. I have a load of ‘cells’ that are clickable and I want to be able to scale them to ‘simulate’ a zoom in 2D, …

---

## [Print all prime numbers from 1 to n in reverse order](https://discourse.processing.org/t/print-all-prime-numbers-from-1-to-n-in-reverse-order/11575)

<div class="topic-metadata">

**Author:** [@anonomous](https://discourse.processing.org/u/anonomous)\
**Replies:** 8\
**Last updated:** [May 27, 2019, 5:29am UTC](https://discourse.processing.org/t/print-all-prime-numbers-from-1-to-n-in-reverse-order/11575 "2019-05-27T05:29:41Z")

</div>

Hi! I just started learning Processing 3 weeks ago for a class, so I’ve only learned how to use strings/chars, if/else decision structures, and loops so far. I’m stumped on the very last exercise. Here is the assignment,…

---

## [How to run and read the results of command prompt/telnet from a processing sketch?](https://discourse.processing.org/t/how-to-run-and-read-the-results-of-command-prompt-telnet-from-a-processing-sketch/11571)

<div class="topic-metadata">

**Author:** [@Birb](https://discourse.processing.org/u/Birb)\
**Replies:** 5\
**Last updated:** [May 26, 2019, 10:31pm UTC](https://discourse.processing.org/t/how-to-run-and-read-the-results-of-command-prompt-telnet-from-a-processing-sketch/11571 "2019-05-26T22:31:14Z")

</div>

I’d like to run commands on cmd.exe from a processing sketch, reading the results. Is this possible, and is there a most simple example I can take a look at (such as executing dir and then reading the results to an array…

---

## [Gradient Loop Help](https://discourse.processing.org/t/gradient-loop-help/11608)

<div class="topic-metadata">

**Author:** [@Bobby](https://discourse.processing.org/u/Bobby)\
**Replies:** 3\
**Last updated:** [May 26, 2019, 9:12pm UTC](https://discourse.processing.org/t/gradient-loop-help/11608 "2019-05-26T21:12:22Z")

</div>

I am trying to make a background where the screen has rectangles that differ in shades of blue. I have tried putting my colours into an array (ik it not efficient), but i only result to getting 1 shade of blue for all re…

---

## [Unsure how to use PVectors](https://discourse.processing.org/t/unsure-how-to-use-pvectors/11597)

<div class="topic-metadata">

**Author:** [@codingNoob](https://discourse.processing.org/u/codingNoob)\
**Replies:** 8\
**Last updated:** [May 26, 2019, 3:40pm UTC](https://discourse.processing.org/t/unsure-how-to-use-pvectors/11597 "2019-05-26T15:40:07Z")

</div>

How do you add or subtract PVectors arrays in processing? This is my code for my class Ball for my game but i have to change in it PVectors class Ball { int billHeadYCentre=300; int ballSizeX=20; int ballSizeY=20…

---

## [Photo grid visualization](https://discourse.processing.org/t/photo-grid-visualization/11602)

<div class="topic-metadata">

**Author:** [@feelthemall](https://discourse.processing.org/u/feelthemall)\
**Replies:** 1\
**Last updated:** [May 26, 2019, 11:19am UTC](https://discourse.processing.org/t/photo-grid-visualization/11602 "2019-05-26T11:19:01Z")

</div>

So I want to make something like this with a bunch of pictures (which are ordered). Any ideas how should I arrange them them with processing to get a similar result? I think I have to use an array for the photos and a lo…

---

## [Plot a graph through processing](https://discourse.processing.org/t/plot-a-graph-through-processing/11604)

<div class="topic-metadata">

**Author:** [@thatone](https://discourse.processing.org/u/thatone)\
**Replies:** 2\
**Last updated:** [May 26, 2019, 12:41pm UTC](https://discourse.processing.org/t/plot-a-graph-through-processing/11604 "2019-05-26T12:41:54Z")

</div>

Hello, I’ve having a bit of a problem with this exercise. I’m supposed to plot a the graph 300=(x\*x)/200; To get there x is supposed to be added 0.1 at each time and the graph should stop at y=300. Through my current …

---

## [Arrays causing problems?](https://discourse.processing.org/t/arrays-causing-problems/11595)

<div class="topic-metadata">

**Author:** [@Bobby](https://discourse.processing.org/u/Bobby)\
**Replies:** 11\
**Last updated:** [May 26, 2019, 11:03am UTC](https://discourse.processing.org/t/arrays-causing-problems/11595 "2019-05-26T11:03:55Z")

</div>

Hi, I am making a game where balls are being projected (with gravity) and the user has to make the balls bounce and land in a basket. If a ball drops, it should be game over. There are so many problems with my code (thi…

---

## [Trouble with Append()](https://discourse.processing.org/t/trouble-with-append/11548)

<div class="topic-metadata">

**Author:** [@dtools22](https://discourse.processing.org/u/dtools22)\
**Replies:** 2\
**Last updated:** [May 26, 2019, 9:35am UTC](https://discourse.processing.org/t/trouble-with-append/11548 "2019-05-26T09:35:39Z")

</div>

Hello, I am writing a basic poker tracker program. The program takes in a poker hand history file (a .txt file type) which contains multiple hands within it, isolates each hand, saves it into the data folder as a uniqu…

---

## [SOS! Hit Detection help in Pong Game](https://discourse.processing.org/t/sos-hit-detection-help-in-pong-game/11535)

<div class="topic-metadata">

**Author:** [@Susana](https://discourse.processing.org/u/Susana)\
**Replies:** 9\
**Last updated:** [May 25, 2019, 7:08pm UTC](https://discourse.processing.org/t/sos-hit-detection-help-in-pong-game/11535 "2019-05-25T19:08:33Z")

</div>

Hello! I’m having a hard time getting a hit detection between my ball and paddle. I was able to get it to work, but it stopped working once I migrated my code into classes. I’ll include my code that works as well as the …

---

## [Need Help with arrays for background](https://discourse.processing.org/t/need-help-with-arrays-for-background/11577)

<div class="topic-metadata">

**Author:** [@codingNoob](https://discourse.processing.org/u/codingNoob)\
**Replies:** 8\
**Last updated:** [May 25, 2019, 4:27pm UTC](https://discourse.processing.org/t/need-help-with-arrays-for-background/11577 "2019-05-25T16:27:57Z")

</div>

So i have an assignment which needs to have a gradient of blue as the background with each shade being 50 pixels and the darkest at the top, but i cant seem to code it so the top 50 pixels is coloured in. please help in…

---

## [Score counter Help](https://discourse.processing.org/t/score-counter-help/11587)

<div class="topic-metadata">

**Author:** [@Bobby](https://discourse.processing.org/u/Bobby)\
**Replies:** 6\
**Last updated:** [May 25, 2019, 4:14pm UTC](https://discourse.processing.org/t/score-counter-help/11587 "2019-05-25T16:14:08Z")

</div>

Hi, i have made a program to where balls would enter a basket and for every ball that enters (5 balls) + 10 to the counter and the balls would reset to the start. I made my balls in an array: Ball\[\] bballs = new Ball\[5…

---

## [PVector Function Parameters HELP](https://discourse.processing.org/t/pvector-function-parameters-help/11508)

<div class="topic-metadata">

**Author:** [@gaggiatoraya](https://discourse.processing.org/u/gaggiatoraya)\
**Replies:** 2\
**Last updated:** [May 25, 2019, 3:25pm UTC](https://discourse.processing.org/t/pvector-function-parameters-help/11508 "2019-05-25T15:25:42Z")

</div>

I’ve created a program that depicts a ball bouncing off of the floor(actually respawning once it touches the floor) to be used in a larger set of code. I would like to be able to duplicate 4 more bouncing balls however I…

---

## [Screen Capturer Library](https://discourse.processing.org/t/screen-capturer-library/11586)

<div class="topic-metadata">

**Author:** [@davidbambalan](https://discourse.processing.org/u/davidbambalan)\
**Replies:** 1\
**Last updated:** [May 25, 2019, 2:35pm UTC](https://discourse.processing.org/t/screen-capturer-library/11586 "2019-05-25T14:35:16Z")

</div>

Are there any libraries that I can use to capture my screen?

---

## [How do I mirror the movement of another another shape?](https://discourse.processing.org/t/how-do-i-mirror-the-movement-of-another-another-shape/11573)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 9\
**Last updated:** [May 25, 2019, 2:16am UTC](https://discourse.processing.org/t/how-do-i-mirror-the-movement-of-another-another-shape/11573 "2019-05-25T02:16:01Z")

</div>

I would like the green rectangle on the right to mirror the movement of the pink rectangle on the left. (And sometimes randomly overlap.) Is there an easy way to draw the right side of the green rectangle so that it is …

---

## [Randomizing levels](https://discourse.processing.org/t/randomizing-levels/11572)

<div class="topic-metadata">

**Author:** [@clueless\_coder](https://discourse.processing.org/u/clueless_coder)\
**Replies:** 1\
**Last updated:** [May 25, 2019, 1:56am UTC](https://discourse.processing.org/t/randomizing-levels/11572 "2019-05-25T01:56:51Z")

</div>

I’m trying to code a game in which clicking ‘play’ would result in the player getting a random level out of a few set levels. However, the problem is that the levels have to be non-repeating. Does anyone know how to achi…

---

## [Writing a Search Function](https://discourse.processing.org/t/writing-a-search-function/11403)

<div class="topic-metadata">

**Author:** [@dtools22](https://discourse.processing.org/u/dtools22)\
**Replies:** 7\
**Last updated:** [May 24, 2019, 12:55pm UTC](https://discourse.processing.org/t/writing-a-search-function/11403 "2019-05-24T12:55:30Z")

</div>

Hello, I have a program that creates custom objects from text documents that contain certain pieces of data. Each object has its own Boolean tags that correspond to different states the object could be under based upon …

---

## [Where to Start? Generating Meshes from an Image](https://discourse.processing.org/t/where-to-start-generating-meshes-from-an-image/11501)

<div class="topic-metadata">

**Author:** [@rand\_colors](https://discourse.processing.org/u/rand_colors)\
**Replies:** 4\
**Last updated:** [May 23, 2019, 7:18pm UTC](https://discourse.processing.org/t/where-to-start-generating-meshes-from-an-image/11501 "2019-05-23T19:18:59Z")

</div>

Hi everyone, I took a look at the OF tutorials, and I’m trying to understand how to do this https://openframeworks.cc/ofBook/chapters/generativemesh.html in Processing. It’s not essential for this first step to make …

---

## [Trouble with mousePressed](https://discourse.processing.org/t/trouble-with-mousepressed/11529)

<div class="topic-metadata">

**Author:** [@clueless\_coder](https://discourse.processing.org/u/clueless_coder)\
**Replies:** 6\
**Last updated:** [May 24, 2019, 4:14am UTC](https://discourse.processing.org/t/trouble-with-mousepressed/11529 "2019-05-24T04:14:15Z")

</div>

I’m trying to make one part of the code transition to another with no luck. I’m trying to use mousePressed but it seems like the scene only appears for a moment before disappearing again. Is thi because of void draw()? …

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

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