# Processing

**URL:** https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=177

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

**Page:** 178

---

## [Help me make bullets for a game I'm trying to make](https://discourse.processing.org/t/help-me-make-bullets-for-a-game-im-trying-to-make/24555)

<div class="topic-metadata">

**Author:** [@Cal\_codes](https://discourse.processing.org/u/Cal_codes)\
**Replies:** 7\
**Last updated:** [October 13, 2020, 11:46am UTC](https://discourse.processing.org/t/help-me-make-bullets-for-a-game-im-trying-to-make/24555 "2020-10-13T11:46:19Z")

</div>

Hi! I’m trying to build a retro top down arena shooter game and I’m struggling to get shooting to work. What I want is to have an ArrayList of bullets that can be shot using a keypressed fucntion and that are shot in th…

---

## [How to make an ArrayList object "blink" without drawing the background](https://discourse.processing.org/t/how-to-make-an-arraylist-object-blink-without-drawing-the-background/24534)

<div class="topic-metadata">

**Author:** [@marianalimoes](https://discourse.processing.org/u/marianalimoes)\
**Replies:** 8\
**Last updated:** [October 13, 2020, 8:03am UTC](https://discourse.processing.org/t/how-to-make-an-arraylist-object-blink-without-drawing-the-background/24534 "2020-10-13T08:03:36Z")

</div>

Hello. I have this code I can’t solve. I’m using two arraylists that draw balls in a random location. The first one, “Bola” (= “Ball” in Portuguese), is random colored and placed on canvas with a timer. The second one, …

---

## [New update. Version not compatible](https://discourse.processing.org/t/new-update-version-not-compatible/24526)

<div class="topic-metadata">

**Author:** [@IRIGIMA](https://discourse.processing.org/u/IRIGIMA)\
**Replies:** 3\
**Last updated:** [October 12, 2020, 9:51pm UTC](https://discourse.processing.org/t/new-update-version-not-compatible/24526 "2020-10-12T21:51:50Z")

</div>

Am now getting this error due to recent update. Can anyone simplify solution?? ASAP !! (Was all K prior)

---

## [Can someone help me create an energy bar for a game that gets higher when clicked](https://discourse.processing.org/t/can-someone-help-me-create-an-energy-bar-for-a-game-that-gets-higher-when-clicked/24543)

<div class="topic-metadata">

**Author:** [@Cal\_codes](https://discourse.processing.org/u/Cal_codes)\
**Replies:** 3\
**Last updated:** [October 12, 2020, 4:07pm UTC](https://discourse.processing.org/t/can-someone-help-me-create-an-energy-bar-for-a-game-that-gets-higher-when-clicked/24543 "2020-10-12T16:07:10Z")

</div>

Hi guys! I’ve been trying to teach myself coding and I wanted to try to make an energy bar that goes up when its clicked instead of just immediately displaying the entire energy bar. This is the code I have so far. Th…

---

## [Do these seem right? can't seem to make it work](https://discourse.processing.org/t/do-these-seem-right-cant-seem-to-make-it-work/24544)

<div class="topic-metadata">

**Author:** [@thughes](https://discourse.processing.org/u/thughes)\
**Replies:** 4\
**Last updated:** [October 12, 2020, 3:24pm UTC](https://discourse.processing.org/t/do-these-seem-right-cant-seem-to-make-it-work/24544 "2020-10-12T15:24:35Z")

</div>

Another if statement will check to see if the Blue and Red ball are within a certain distance of each other. This function will check to see if the x and y position of the BLUE ball is less than 20 from the x and y pos…

---

## [Calculating with fractions](https://discourse.processing.org/t/calculating-with-fractions/24546)

<div class="topic-metadata">

**Author:** [@Superkid](https://discourse.processing.org/u/Superkid)\
**Replies:** 2\
**Last updated:** [October 12, 2020, 3:02pm UTC](https://discourse.processing.org/t/calculating-with-fractions/24546 "2020-10-12T15:02:56Z")

</div>

Hey! I got a problem in Processing. i want to define a variable to be 1/60. But if I look in the Console it always says, that the variable is 0. Last time I tried this (about one year ago) it worked perfectly. How do i …

---

## [What is the xRed position?](https://discourse.processing.org/t/what-is-the-xred-position/24527)

<div class="topic-metadata">

**Author:** [@thughes](https://discourse.processing.org/u/thughes)\
**Replies:** 3\
**Last updated:** [October 12, 2020, 12:34pm UTC](https://discourse.processing.org/t/what-is-the-xred-position/24527 "2020-10-12T12:34:22Z")

</div>

I’m a little confused on the xRed position?!?! xRed and yRed position for the RED ball . Remember this should be set to x anywhere and y will be a random between 200 and 400. The ball will be width and height of 3…

---

## [How would I explore and identify random crashes](https://discourse.processing.org/t/how-would-i-explore-and-identify-random-crashes/24531)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 3\
**Last updated:** [October 12, 2020, 8:23am UTC](https://discourse.processing.org/t/how-would-i-explore-and-identify-random-crashes/24531 "2020-10-12T08:23:27Z")

</div>

I have a program which is rather large, and sometime with no warning it will just freeze. Now it doesnt crash with a spinning cursor which is the usual, no it just freezes, I can close it without any problem but cannot c…

---

## [Different background, Different item by mousePressed](https://discourse.processing.org/t/different-background-different-item-by-mousepressed/24530)

<div class="topic-metadata">

**Author:** [@fisher](https://discourse.processing.org/u/fisher)\
**Replies:** 1\
**Last updated:** [October 12, 2020, 7:15am UTC](https://discourse.processing.org/t/different-background-different-item-by-mousepressed/24530 "2020-10-12T07:15:05Z")

</div>

please format code with \</\> button \* homework policy \* asking questions I’m making day/night animation where I use “mousePressed” on locating the sun on the blue sky according to the mouseX,mouseY. When the key ‘n’ i…

---

## [Query on how effect on processing book created](https://discourse.processing.org/t/query-on-how-effect-on-processing-book-created/24522)

<div class="topic-metadata">

**Author:** [@dragodiv](https://discourse.processing.org/u/dragodiv)\
**Replies:** 2\
**Last updated:** [October 11, 2020, 6:38pm UTC](https://discourse.processing.org/t/query-on-how-effect-on-processing-book-created/24522 "2020-10-11T18:38:59Z")

</div>

Hi How is the effect on below page achieved ? http://learningprocessing.com/ Had checked on the javascript part of source, but didnt understand how it was achieved and if it could be done on processing?

---

## [Using keyboard events](https://discourse.processing.org/t/using-keyboard-events/24503)

<div class="topic-metadata">

**Author:** [@thughes](https://discourse.processing.org/u/thughes)\
**Replies:** 5\
**Last updated:** [October 11, 2020, 7:02am UTC](https://discourse.processing.org/t/using-keyboard-events/24503 "2020-10-11T07:02:11Z")

</div>

Advice please: public void change This function will increment the y2 of the 2nd ellipse by 2. Use the short cut operator for the assignment. If the y2 is greater than height, reset the y2 to 30. this is what i have so…

---

## [P2D/P3D sketches won’t start on Ubuntu 20.04](https://discourse.processing.org/t/p2d-p3d-sketches-won-t-start-on-ubuntu-20-04/22186)

<div class="topic-metadata">

**Author:** [@villares](https://discourse.processing.org/u/villares)\
**Replies:** 7\
**Last updated:** [October 11, 2020, 4:50pm UTC](https://discourse.processing.org/t/p2d-p3d-sketches-won-t-start-on-ubuntu-20-04/22186 "2020-10-11T16:50:35Z")

</div>

This looks similar to an older issue: https://discourse.processing.org/t/solved-p2d-p3d-sketches-wont-start-on-fresh-ubuntu-18-04-installation/3568 Profile GL4bc is not available on X11GraphicsDevice\[type .x11, connect…

---

## [How to open maximized window?](https://discourse.processing.org/t/how-to-open-maximized-window/22941)

<div class="topic-metadata">

**Author:** [@Rafsing](https://discourse.processing.org/u/Rafsing)\
**Replies:** 8\
**Last updated:** [July 31, 2020, 3:05pm UTC](https://discourse.processing.org/t/how-to-open-maximized-window/22941 "2020-07-31T15:05:10Z")

</div>

How to open maximized window with windows taskbar. I’m using the newest version of processing, and any version of size(displayWidth, displayHeight); surface.setResizable(true); surface.setLocation(0, 0); doesn’t work.

---

## [Declare a 3x3 empty array](https://discourse.processing.org/t/declare-a-3x3-empty-array/24515)

<div class="topic-metadata">

**Author:** [@learningL](https://discourse.processing.org/u/learningL)\
**Replies:** 3\
**Last updated:** [October 11, 2020, 11:54am UTC](https://discourse.processing.org/t/declare-a-3x3-empty-array/24515 "2020-10-11T11:54:27Z")

</div>

Hello I would like to know how to declare a 3x3 empty array which data type is char. Thanks in advance.

---

## [Add method to float\[\]\[\]](https://discourse.processing.org/t/add-method-to-float/24502)

<div class="topic-metadata">

**Author:** [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Replies:** 1\
**Last updated:** [October 11, 2020, 9:44am UTC](https://discourse.processing.org/t/add-method-to-float/24502 "2020-10-11T09:44:19Z")

</div>

I’m currently writing a Mathlibrary. And it is kind of annoying to always have to use new Matrix(m) it would be better if I could use something like m.toMatrix() Is there a possibility to do that?

---

## [Mouse draw sketch](https://discourse.processing.org/t/mouse-draw-sketch/24449)

<div class="topic-metadata">

**Author:** [@joe\_processing](https://discourse.processing.org/u/joe_processing)\
**Replies:** 4\
**Last updated:** [October 11, 2020, 7:01am UTC](https://discourse.processing.org/t/mouse-draw-sketch/24449 "2020-10-11T07:01:28Z")

</div>

hi, |'m trying to write a code that demonstrates a spread of infected pixels that appear from and after the user draws a line in processing (I added a picture that demonstrates the stages that code makes). But my code …

---

## [Can't get the balls to move correctly](https://discourse.processing.org/t/cant-get-the-balls-to-move-correctly/18518)

<div class="topic-metadata">

**Author:** [@GKBeginner](https://discourse.processing.org/u/GKBeginner)\
**Replies:** 6\
**Last updated:** [October 11, 2020, 12:14am UTC](https://discourse.processing.org/t/cant-get-the-balls-to-move-correctly/18518 "2020-10-11T00:14:09Z")

</div>

One ball should be randomly moving and the other is controlled by the arrow keys on the keyboard. They are not working correctly and I can’t figure out why. int x1=30; int y1; int x2; int y2=30; int r=255; int g=255; i…

---

## [Petit question sur processing](https://discourse.processing.org/t/petit-question-sur-processing/24487)

<div class="topic-metadata">

**Author:** [@nina](https://discourse.processing.org/u/nina)\
**Replies:** 10\
**Last updated:** [October 10, 2020, 8:27pm UTC](https://discourse.processing.org/t/petit-question-sur-processing/24487 "2020-10-10T20:27:12Z")

</div>

Bonsoir, j’ai une petit question je ne comprends pas à quoi elle sert l’instruction return? Voulez-vous bien m’aider, s’il vous plait. Je vous remercie d’avance . cordialement , Nina

---

## [Very basic traffic light](https://discourse.processing.org/t/very-basic-traffic-light/24451)

<div class="topic-metadata">

**Author:** [@rk0945](https://discourse.processing.org/u/rk0945)\
**Replies:** 7\
**Last updated:** [October 10, 2020, 7:51pm UTC](https://discourse.processing.org/t/very-basic-traffic-light/24451 "2020-10-10T19:51:00Z")

</div>

Thanks - problem solved!!!

---

## [Difference between loadPixels and get()](https://discourse.processing.org/t/difference-between-loadpixels-and-get/24491)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 1\
**Last updated:** [October 10, 2020, 4:52am UTC](https://discourse.processing.org/t/difference-between-loadpixels-and-get/24491 "2020-10-10T04:52:57Z")

</div>

As the title implies just after a bit of info. Looking through some examples I came across the histogram image sketch which makes use of get to retrieve pixel values. for (int i = 0; i \< img.width; i++) { for (int j …

---

## [Lighting for 3d gravity sim](https://discourse.processing.org/t/lighting-for-3d-gravity-sim/24388)

<div class="topic-metadata">

**Author:** [@Kport1](https://discourse.processing.org/u/Kport1)\
**Replies:** 5\
**Last updated:** [October 10, 2020, 1:58pm UTC](https://discourse.processing.org/t/lighting-for-3d-gravity-sim/24388 "2020-10-10T13:58:11Z")

</div>

Hello! Im having trouble with the lighting in my 3d gravity sim. I am trying to programm stars but the lighting function in processing doesnt give of direct light to the camera, so the stars appear like planets, but they…

---

## [Using multiple mouse functions](https://discourse.processing.org/t/using-multiple-mouse-functions/24485)

<div class="topic-metadata">

**Author:** [@thughes](https://discourse.processing.org/u/thughes)\
**Replies:** 6\
**Last updated:** [October 10, 2020, 1:03pm UTC](https://discourse.processing.org/t/using-multiple-mouse-functions/24485 "2020-10-10T13:03:39Z")

</div>

this is what i’m trying to do: Create a program that will change the background color based on the mouse. You will create a setup(), draw() function. The size of the frame will by 400 by 400. Create a mousePressed() …

---

## [Connect dots with lines](https://discourse.processing.org/t/connect-dots-with-lines/24493)

<div class="topic-metadata">

**Author:** [@fernanda\_123](https://discourse.processing.org/u/fernanda_123)\
**Replies:** 1\
**Last updated:** [October 10, 2020, 10:52am UTC](https://discourse.processing.org/t/connect-dots-with-lines/24493 "2020-10-10T10:52:54Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hi, I’m new in processing and I hope someone can help me with a proyect :smiley: So, I have to make a program where I make points and each poin…

---

## [HTTP Requests for JSON string and next release with upgrade version](https://discourse.processing.org/t/http-requests-for-json-string-and-next-release-with-upgrade-version/24496)

<div class="topic-metadata">

**Author:** [@YuneeBird](https://discourse.processing.org/u/YuneeBird)\
**Replies:** 0\
**Last updated:** [October 10, 2020, 8:23am UTC](https://discourse.processing.org/t/http-requests-for-json-string-and-next-release-with-upgrade-version/24496 "2020-10-10T08:23:58Z")

</div>

Hi, I am grateful the code and library is available and Thanks for the contributors. However, the jsonpost.pde example for adddata( string ) method does seem to work when I install the library 0.1.4 from ‘contrib…

---

## [Calculating angle of triangle](https://discourse.processing.org/t/calculating-angle-of-triangle/24483)

<div class="topic-metadata">

**Author:** [@arcadeperfect](https://discourse.processing.org/u/arcadeperfect)\
**Replies:** 15\
**Last updated:** [October 9, 2020, 10:33pm UTC](https://discourse.processing.org/t/calculating-angle-of-triangle/24483 "2020-10-09T22:33:36Z")

</div>

Sorry, this is a math question more than a Processing one. I’m trying to calculate an angle “a” that will always give a specified constant length “d” for any given position of p. P can move, and the other two points ar…

---

## [I need help asap BEFORE 19:00 PM](https://discourse.processing.org/t/i-need-help-asap-before-19-00-pm/24469)

<div class="topic-metadata">

**Author:** [@INEEDHELP](https://discourse.processing.org/u/INEEDHELP)\
**Replies:** 12\
**Last updated:** [October 9, 2020, 5:33pm UTC](https://discourse.processing.org/t/i-need-help-asap-before-19-00-pm/24469 "2020-10-09T17:33:18Z")

</div>

please format code with \</\> button \* homework policy \* asking questions I'm making a bubble shoot game and I want to know when my bullet hit the bubble then it will vanish and i get a point. PLEASE explain

---

## [Processing coding help - Sliders](https://discourse.processing.org/t/processing-coding-help-sliders/24462)

<div class="topic-metadata">

**Author:** [@Ellie98](https://discourse.processing.org/u/Ellie98)\
**Replies:** 3\
**Last updated:** [October 9, 2020, 12:54pm UTC](https://discourse.processing.org/t/processing-coding-help-sliders/24462 "2020-10-09T12:54:29Z")

</div>

Hello, could someone look into my code? I don’t know how to continue. I had to code 4 Sliders. Two are following the Y-direction and two the X-direction. But one of the two sliders have to go to the opposide direction a…

---

## [How to save an image from sketch windows](https://discourse.processing.org/t/how-to-save-an-image-from-sketch-windows/24436)

<div class="topic-metadata">

**Author:** [@rafaelb](https://discourse.processing.org/u/rafaelb)\
**Replies:** 4\
**Last updated:** [October 9, 2020, 12:43pm UTC](https://discourse.processing.org/t/how-to-save-an-image-from-sketch-windows/24436 "2020-10-09T12:43:36Z")

</div>

please format code with \</\> button \* homework policy \* asking questions PArdon my beginnereness!!! When I have a Sketch window and want to save it as a single figure (image) in .png or .jpg, what do I have to do??. …

---

## [Image Manipulation](https://discourse.processing.org/t/image-manipulation/24459)

<div class="topic-metadata">

**Author:** [@stellakramer](https://discourse.processing.org/u/stellakramer)\
**Replies:** 1\
**Last updated:** [October 9, 2020, 12:36pm UTC](https://discourse.processing.org/t/image-manipulation/24459 "2020-10-09T12:36:09Z")

</div>

Could someone help me? I’m trying to make a code in Processing where you have an image, and on the image an ellipse moves with your mouse. But the ellipse is not blank or filled but rather it warps the image. Bloats, inf…

---

## [Processing mapping function - help](https://discourse.processing.org/t/processing-mapping-function-help/24463)

<div class="topic-metadata">

**Author:** [@Ellie98](https://discourse.processing.org/u/Ellie98)\
**Replies:** 1\
**Last updated:** [October 9, 2020, 12:28pm UTC](https://discourse.processing.org/t/processing-mapping-function-help/24463 "2020-10-09T12:28:22Z")

</div>

Hello, I have to code 2 circles that are following the mouse. But the red one stays inside the square and I have to do it with the map() function but I don’t really understand it. It’s not working. Could someone help me…

[Previous page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=176)

[Next page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=178)
