# Coding Questions

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

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

**Page:** 23

---

## [Conditionals for resetting moving object](https://discourse.processing.org/t/conditionals-for-resetting-moving-object/39389)

<div class="topic-metadata">

**Author:** [@turtle1](https://discourse.processing.org/u/turtle1)\
**Replies:** 4\
**Last updated:** [October 26, 2022, 12:45pm UTC](https://discourse.processing.org/t/conditionals-for-resetting-moving-object/39389 "2022-10-26T12:45:05Z")

</div>

hi, i want to repeat a moving object using a conditional statement. my object moves off the canvas, but i want that to keep repeating from the top. i have my conditional statement, but how would i incorporate the two?

---

## [Grid of custom designs using beginShape(); vertex(); endShape(CLOSE);](https://discourse.processing.org/t/grid-of-custom-designs-using-beginshape-vertex-endshape-close/39404)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 8\
**Last updated:** [October 26, 2022, 10:57am UTC](https://discourse.processing.org/t/grid-of-custom-designs-using-beginshape-vertex-endshape-close/39404 "2022-10-26T10:57:07Z")

</div>

How do you make a grid of custom shapes like the one that follows (via Daniel Shiffman’s book “Learning Processing”)? void setup(){ size(800,800,P2D); background(255); } void draw(){ stroke(0); translate(30, 30…

---

## [Duplicate bezier figure](https://discourse.processing.org/t/duplicate-bezier-figure/39341)

<div class="topic-metadata">

**Author:** [@Erif](https://discourse.processing.org/u/Erif)\
**Replies:** 6\
**Last updated:** [October 26, 2022, 8:48am UTC](https://discourse.processing.org/t/duplicate-bezier-figure/39341 "2022-10-26T08:48:05Z")

</div>

Hi all, I’ve created this simple figure by rotating a bezier curve: void setup() { size(800, 800); } void draw() { background(255); translate(width/2, height/2); //produce figure by rotating bezier curve …

---

## [Need help with enemy and bullet collision in my little game](https://discourse.processing.org/t/need-help-with-enemy-and-bullet-collision-in-my-little-game/39430)

<div class="topic-metadata">

**Author:** [@butterjwab](https://discourse.processing.org/u/butterjwab)\
**Replies:** 2\
**Last updated:** [October 25, 2022, 7:40pm UTC](https://discourse.processing.org/t/need-help-with-enemy-and-bullet-collision-in-my-little-game/39430 "2022-10-25T19:40:25Z")

</div>

hi, so im making a shooting simple game in processing but I have no idea how to make my enemy disappear and then respawn after my bullets hit it. this is my code: int pixelsize = 4; int gridsize = pixelsize \* 7 + 5; P…

---

## [Extract vertex from a svg file](https://discourse.processing.org/t/extract-vertex-from-a-svg-file/39414)

<div class="topic-metadata">

**Author:** [@DrHooDoo](https://discourse.processing.org/u/DrHooDoo)\
**Replies:** 4\
**Last updated:** [October 25, 2022, 1:32pm UTC](https://discourse.processing.org/t/extract-vertex-from-a-svg-file/39414 "2022-10-25T13:32:28Z")

</div>

Hello all ! :slight\_smile: In short, I’m trying to extract vertex from a svg but no matter how I do I always get an error: “getVertexCount() only works with PATH or GEOMETRY shapes” What I did was: create a little s…

---

## [Intersection of 2 circle arcs](https://discourse.processing.org/t/intersection-of-2-circle-arcs/10424)

<div class="topic-metadata">

**Author:** [@CallMeGhosty](https://discourse.processing.org/u/CallMeGhosty)\
**Replies:** 5\
**Last updated:** [October 25, 2022, 8:02am UTC](https://discourse.processing.org/t/intersection-of-2-circle-arcs/10424 "2022-10-25T08:02:49Z")

</div>

Hello, As the title says, I would like to get the X and Y coordinates of where the 2 arcs intersect. I only know how to check if they do intersect… hides in shame Challenge: Animate the drawing of the bisector of a tr…

---

## [I can't figure out how to make this array compatible with my Button class](https://discourse.processing.org/t/i-cant-figure-out-how-to-make-this-array-compatible-with-my-button-class/39403)

<div class="topic-metadata">

**Author:** [@darthbray](https://discourse.processing.org/u/darthbray)\
**Replies:** 2\
**Last updated:** [October 23, 2022, 10:43pm UTC](https://discourse.processing.org/t/i-cant-figure-out-how-to-make-this-array-compatible-with-my-button-class/39403 "2022-10-23T22:43:16Z")

</div>

please format code with \</\> button \* homework policy \* asking questions I’m trying to create a randomly generated chord progression program but I haven’t even reached that part yet, I’m stuck on making an array with …

---

## [Image Heightmap out of recursive circles](https://discourse.processing.org/t/image-heightmap-out-of-recursive-circles/39394)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 2\
**Last updated:** [October 23, 2022, 5:31pm UTC](https://discourse.processing.org/t/image-heightmap-out-of-recursive-circles/39394 "2022-10-23T17:31:52Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hi, I’m wondering how to make a P3D heightmap out of the following grid of recursive circles? Is it possible since the circles aren’t a uniform …

---

## [Fullscreen recursion](https://discourse.processing.org/t/fullscreen-recursion/39393)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 2\
**Last updated:** [October 23, 2022, 2:10am UTC](https://discourse.processing.org/t/fullscreen-recursion/39393 "2022-10-23T02:10:34Z")

</div>

Hi, I am trying to recreate this recursive circular pattern (via Daniel Shiffman’s book “Learning Processing”). How do I get the recursive pattern to fill the frame of the screen? As you can see, my code doesn’t include …

---

## [Borderless Window](https://discourse.processing.org/t/borderless-window/39385)

<div class="topic-metadata">

**Author:** [@5x9x7x2x7x9](https://discourse.processing.org/u/5x9x7x2x7x9)\
**Replies:** 1\
**Last updated:** [October 22, 2022, 6:34pm UTC](https://discourse.processing.org/t/borderless-window/39385 "2022-10-22T18:34:20Z")

</div>

How could I create a borderless window, Like discord?

---

## [How to make circles grow and shrink, but each circle to have a delay?](https://discourse.processing.org/t/how-to-make-circles-grow-and-shrink-but-each-circle-to-have-a-delay/39277)

<div class="topic-metadata">

**Author:** [@animanoir](https://discourse.processing.org/u/animanoir)\
**Replies:** 4\
**Last updated:** [October 20, 2022, 9:30pm UTC](https://discourse.processing.org/t/how-to-make-circles-grow-and-shrink-but-each-circle-to-have-a-delay/39277 "2022-10-20T21:30:34Z")

</div>

The best I have is this—I don’t know what I am missing. I want for each circle to have a delay or something, because right now all the circles grow at the same time. int size = 300; float theta; void setup() { noFill…

---

## [Javax swing JFrame in the main processing PApplet](https://discourse.processing.org/t/javax-swing-jframe-in-the-main-processing-papplet/16122)

<div class="topic-metadata">

**Author:** [@GeorgeJava](https://discourse.processing.org/u/GeorgeJava)\
**Replies:** 3\
**Last updated:** [October 21, 2022, 1:45am UTC](https://discourse.processing.org/t/javax-swing-jframe-in-the-main-processing-papplet/16122 "2022-10-21T01:45:30Z")

</div>

Hello i search somewhere the example of the menu in the main processing sketch, but when i want to add something more, like buttons, labels etc. it cant render or display it… how to make it working ? Menu\_bar mp; void s…

---

## [Background turns black when resizing](https://discourse.processing.org/t/background-turns-black-when-resizing/39359)

<div class="topic-metadata">

**Author:** [@Katsucchi](https://discourse.processing.org/u/Katsucchi)\
**Replies:** 10\
**Last updated:** [October 19, 2022, 10:27pm UTC](https://discourse.processing.org/t/background-turns-black-when-resizing/39359 "2022-10-19T22:27:49Z")

</div>

I have homework where i was supposed to make recreate a drawing from a famous painter. The assignment now is to make the window resizable. I came up with this solution: void setup() { background(255, 255, 255); size…

---

## [Background overwrites mouseClicked for bubbles (Fish tank)](https://discourse.processing.org/t/background-overwrites-mouseclicked-for-bubbles-fish-tank/39263)

<div class="topic-metadata">

**Author:** [@LeckereKrokette](https://discourse.processing.org/u/LeckereKrokette)\
**Replies:** 9\
**Last updated:** [October 18, 2022, 5:04pm UTC](https://discourse.processing.org/t/background-overwrites-mouseclicked-for-bubbles-fish-tank/39263 "2022-10-18T17:04:59Z")

</div>

Hello everyone, I’m relatively new to Processing. My first project will be a fish tank. I would like the bubbles to rise from bottom to top when I click my mouse, this should happen every click. At the moment it only wor…

---

## [Save and print (on paper) multiple images](https://discourse.processing.org/t/save-and-print-on-paper-multiple-images/39333)

<div class="topic-metadata">

**Author:** [@friedadedoncker](https://discourse.processing.org/u/friedadedoncker)\
**Replies:** 2\
**Last updated:** [October 18, 2022, 9:40am UTC](https://discourse.processing.org/t/save-and-print-on-paper-multiple-images/39333 "2022-10-18T09:40:22Z")

</div>

Hi, Using this tutorial, I’m able to print images on paper ones they’re saved. What it does now though, is overwrite the previous existing image everytime. I would like to save all the images so I’m using this code as…

---

## [Clean up my code & retry button](https://discourse.processing.org/t/clean-up-my-code-retry-button/39321)

<div class="topic-metadata">

**Author:** [@ArcJAVA](https://discourse.processing.org/u/ArcJAVA)\
**Replies:** 4\
**Last updated:** [October 18, 2022, 5:27am UTC](https://discourse.processing.org/t/clean-up-my-code-retry-button/39321 "2022-10-18T05:27:01Z")

</div>

Hi, i need to make a game where i pick up treasure. but i have quite a lot of unnecesery or dubble code. so i was wondering if someone could help me with making my code less complicated and easier for others to copy if i…

---

## [If I have a grid of 50x50 rectangles how can I randomly place an image in only a few of them?](https://discourse.processing.org/t/if-i-have-a-grid-of-50x50-rectangles-how-can-i-randomly-place-an-image-in-only-a-few-of-them/39326)

<div class="topic-metadata">

**Author:** [@ExplodingWhale](https://discourse.processing.org/u/ExplodingWhale)\
**Replies:** 1\
**Last updated:** [October 17, 2022, 9:44pm UTC](https://discourse.processing.org/t/if-i-have-a-grid-of-50x50-rectangles-how-can-i-randomly-place-an-image-in-only-a-few-of-them/39326 "2022-10-17T21:44:21Z")

</div>

I could use a for loop for the amount of images but how do i make the random function match the exact location of the rectangles?

---

## [Displaying part of an image causes flipping a blurs](https://discourse.processing.org/t/displaying-part-of-an-image-causes-flipping-a-blurs/39232)

<div class="topic-metadata">

**Author:** [@Exister](https://discourse.processing.org/u/Exister)\
**Replies:** 4\
**Last updated:** [October 17, 2022, 8:52pm UTC](https://discourse.processing.org/t/displaying-part-of-an-image-causes-flipping-a-blurs/39232 "2022-10-17T20:52:52Z")

</div>

Hello! I was trying to set up the basis for a game engine and wanted to load a sprite sheet that would then display only parts of itself at a time. Did some research and found this which looked to have exactly what I wan…

---

## [How do I add collision between player projectile and enemies?](https://discourse.processing.org/t/how-do-i-add-collision-between-player-projectile-and-enemies/39238)

<div class="topic-metadata">

**Author:** [@Marfmamow](https://discourse.processing.org/u/Marfmamow)\
**Replies:** 10\
**Last updated:** [October 17, 2022, 4:21pm UTC](https://discourse.processing.org/t/how-do-i-add-collision-between-player-projectile-and-enemies/39238 "2022-10-17T16:21:08Z")

</div>

I’m making a 2d tile based game, and I have implemented collision between the player and wall tiles. I did this by placing each tile in an array, and then giving the player’s position an index in the array However, thi…

---

## [How do I make a bar that shows the progress of a cooldown?](https://discourse.processing.org/t/how-do-i-make-a-bar-that-shows-the-progress-of-a-cooldown/39315)

<div class="topic-metadata">

**Author:** [@Marfmamow](https://discourse.processing.org/u/Marfmamow)\
**Replies:** 4\
**Last updated:** [October 17, 2022, 3:46pm UTC](https://discourse.processing.org/t/how-do-i-make-a-bar-that-shows-the-progress-of-a-cooldown/39315 "2022-10-17T15:46:39Z")

</div>

In my game, I currently have 2 weapons. One with a cooldown of 2 seconds, and the other with a cooldown of 4.33 seconds To make the cooldown, I’m doing: int time = millis(); boolean fired = false; if (millis() - time \>…

---

## [Add a circular signal to a circular signal. Almost works!](https://discourse.processing.org/t/add-a-circular-signal-to-a-circular-signal-almost-works/39246)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 0\
**Last updated:** [October 13, 2022, 4:55pm UTC](https://discourse.processing.org/t/add-a-circular-signal-to-a-circular-signal-almost-works/39246 "2022-10-13T16:55:31Z")

</div>

Hello, 10 ball turn in a clock way. By tapping ‘b’ you can see the same circular movement on the 10 balls and by tapping ‘q’ you can see a circular signal added itself to one different ball each 200 ms. I’m trying to…

---

## [Trying to Make center shape spin with mouse interaction](https://discourse.processing.org/t/trying-to-make-center-shape-spin-with-mouse-interaction/39312)

<div class="topic-metadata">

**Author:** [@JHProcess](https://discourse.processing.org/u/JHProcess)\
**Replies:** 4\
**Last updated:** [October 17, 2022, 11:47am UTC](https://discourse.processing.org/t/trying-to-make-center-shape-spin-with-mouse-interaction/39312 "2022-10-17T11:47:08Z")

</div>

Hi There again! Im trying to make a star in spin with mouse interaction while also still being able to place rectangles in a scatter pattern. // Draw star fill(41, 171, 226); stroke(255); strokeWeight(2); begin…

---

## [Trying to make star spin with mouse interaction](https://discourse.processing.org/t/trying-to-make-star-spin-with-mouse-interaction/39302)

<div class="topic-metadata">

**Author:** [@JHProcess](https://discourse.processing.org/u/JHProcess)\
**Replies:** 3\
**Last updated:** [October 17, 2022, 8:13am UTC](https://discourse.processing.org/t/trying-to-make-star-spin-with-mouse-interaction/39302 "2022-10-17T08:13:50Z")

</div>

Hi, so I got some help earlier on how to place rectangles across the plane in random spots. Now my next question is how i can make the star spin, have the rectangles pop up, and then stop after pressing the mouse again. …

---

## [Treasure game: how to pick up items and end the game?](https://discourse.processing.org/t/treasure-game-how-to-pick-up-items-and-end-the-game/39294)

<div class="topic-metadata">

**Author:** [@ArcJAVA](https://discourse.processing.org/u/ArcJAVA)\
**Replies:** 20\
**Last updated:** [October 16, 2022, 5:09pm UTC](https://discourse.processing.org/t/treasure-game-how-to-pick-up-items-and-end-the-game/39294 "2022-10-16T17:09:30Z")

</div>

Hi, I’m trying to make a game that can pick up treasures. right now I can touch them so I will get point but I have no idea how I can let them disappear when I touched them. i need to let the game stop when all the treas…

---

## [How do I create a circle appears and floats circles but doesnt move out of the frame? something like the example below](https://discourse.processing.org/t/how-do-i-create-a-circle-appears-and-floats-circles-but-doesnt-move-out-of-the-frame-something-like-the-example-below/39290)

<div class="topic-metadata">

**Author:** [@andreasarmiento](https://discourse.processing.org/u/andreasarmiento)\
**Replies:** 6\
**Last updated:** [October 16, 2022, 10:50am UTC](https://discourse.processing.org/t/how-do-i-create-a-circle-appears-and-floats-circles-but-doesnt-move-out-of-the-frame-something-like-the-example-below/39290 "2022-10-16T10:50:58Z")

</div>

---

## [Snake game in java processing](https://discourse.processing.org/t/snake-game-in-java-processing/38131)

<div class="topic-metadata">

**Author:** [@ikay](https://discourse.processing.org/u/ikay)\
**Replies:** 4\
**Last updated:** [October 16, 2022, 9:43am UTC](https://discourse.processing.org/t/snake-game-in-java-processing/38131 "2022-10-16T09:43:54Z")

</div>

I tried doing a snake game and tried to run my code to make the snake increase as it eats and also at the end it also gives me syntax error could someone help me out here type or int growth = 1; final int X\_SPEED = 1; …

---

## [How do I create a 4 frame destructible wall sequence?](https://discourse.processing.org/t/how-do-i-create-a-4-frame-destructible-wall-sequence/39284)

<div class="topic-metadata">

**Author:** [@Marfmamow](https://discourse.processing.org/u/Marfmamow)\
**Replies:** 4\
**Last updated:** [October 16, 2022, 5:36am UTC](https://discourse.processing.org/t/how-do-i-create-a-4-frame-destructible-wall-sequence/39284 "2022-10-16T05:36:51Z")

</div>

I’m making a 2d game, and some of the walls are destructible. There are 5 sprites for that type of wall. Normal wall sprite Destroyed frame 1 Destroyed frame 2 Destroyed frame 3 Destroyed frame 4 All 5 of these sprit…

---

## [Sending windows notifications within processing](https://discourse.processing.org/t/sending-windows-notifications-within-processing/39267)

<div class="topic-metadata">

**Author:** [@Shachar](https://discourse.processing.org/u/Shachar)\
**Replies:** 12\
**Last updated:** [October 15, 2022, 4:57pm UTC](https://discourse.processing.org/t/sending-windows-notifications-within-processing/39267 "2022-10-15T16:57:51Z")

</div>

is it possible to send my own windows notifications using processing? I have tried to follow this stack overflow question but it doesn’t seem to be working in processing. I would really appreciate any help! Thanks in ad…

---

## [How to link console result to csv file](https://discourse.processing.org/t/how-to-link-console-result-to-csv-file/39261)

<div class="topic-metadata">

**Author:** [@Eihort](https://discourse.processing.org/u/Eihort)\
**Replies:** 1\
**Last updated:** [October 14, 2022, 11:06am UTC](https://discourse.processing.org/t/how-to-link-console-result-to-csv-file/39261 "2022-10-14T11:06:20Z")

</div>

Hello everyone, my doubt is this: I have to make a program that saves the results of pressing a button, in Csv format. For example: the program starts, and two buttons appear, true and false, I can’t understand how to s…

---

## [Using JColorChooser in processing to change drawing line color](https://discourse.processing.org/t/using-jcolorchooser-in-processing-to-change-drawing-line-color/39253)

<div class="topic-metadata">

**Author:** [@Ideally](https://discourse.processing.org/u/Ideally)\
**Replies:** 4\
**Last updated:** [October 14, 2022, 8:57am UTC](https://discourse.processing.org/t/using-jcolorchooser-in-processing-to-change-drawing-line-color/39253 "2022-10-14T08:57:32Z")

</div>

My program only draws lines, I want to use JColorChooser to choose a line color as soon as I start drawing. can anyone give me a hand? I’ve got this so far. import java.awt.\*; import javax.swing.\*; public static col…

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

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