# Coding Questions

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

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

**Page:** 34

---

## [Why does my program crash sometimes?](https://discourse.processing.org/t/why-does-my-program-crash-sometimes/35497)

<div class="topic-metadata">

**Author:** [@Coder1](https://discourse.processing.org/u/Coder1)\
**Replies:** 7\
**Last updated:** [March 1, 2022, 4:44pm UTC](https://discourse.processing.org/t/why-does-my-program-crash-sometimes/35497 "2022-03-01T16:44:58Z")

</div>

Hello, I made a Clan system where you get different advantages based on your clan. However my code does work but sometimes it just crashes and I don’t know why. Please help me int clanRoll; String clanName; int clanC…

---

## [How do I detect "enter" from a string loaded from a text document variable](https://discourse.processing.org/t/how-do-i-detect-enter-from-a-string-loaded-from-a-text-document-variable/35446)

<div class="topic-metadata">

**Author:** [@TT3overnot](https://discourse.processing.org/u/TT3overnot)\
**Replies:** 6\
**Last updated:** [March 1, 2022, 4:09pm UTC](https://discourse.processing.org/t/how-do-i-detect-enter-from-a-string-loaded-from-a-text-document-variable/35446 "2022-03-01T16:09:12Z")

</div>

Help! I’m trying to simulate specific key presses from a text document, the problem is that when ever there is a new line in the document it reads that as nothing. Specifcly " ‘’ ", here’s my code, please help: import j…

---

## [Question About Home Made Timer Function](https://discourse.processing.org/t/question-about-home-made-timer-function/35480)

<div class="topic-metadata">

**Author:** [@BruceTheWayneJohnson](https://discourse.processing.org/u/BruceTheWayneJohnson)\
**Replies:** 3\
**Last updated:** [March 1, 2022, 3:50pm UTC](https://discourse.processing.org/t/question-about-home-made-timer-function/35480 "2022-03-01T15:50:12Z")

</div>

Hello Processing friends! In order to practice creating modular functions I created a timer function that uses milli() to determine if a specific number of seconds have passed. I added some code that I expected to run…

---

## [curveVertex are wrong on a PGraphics](https://discourse.processing.org/t/curvevertex-are-wrong-on-a-pgraphics/35499)

<div class="topic-metadata">

**Author:** [@DrHooDoo](https://discourse.processing.org/u/DrHooDoo)\
**Replies:** 2\
**Last updated:** [March 1, 2022, 2:57pm UTC](https://discourse.processing.org/t/curvevertex-are-wrong-on-a-pgraphics/35499 "2022-03-01T14:57:51Z")

</div>

Hello to all, I’m trying to put a PShape containing curveVertex on a PGraphics. The image i’m getting is wrong and all the curveVertex are displayed as vertex instead … I have no clue of what is wrong. Thank you for y…

---

## [Code for cycling through specified colour values](https://discourse.processing.org/t/code-for-cycling-through-specified-colour-values/35418)

<div class="topic-metadata">

**Author:** [@zerohstudio](https://discourse.processing.org/u/zerohstudio)\
**Replies:** 11\
**Last updated:** [February 28, 2022, 12:57pm UTC](https://discourse.processing.org/t/code-for-cycling-through-specified-colour-values/35418 "2022-02-28T12:57:53Z")

</div>

Hello, I am new to Processing and my first personal challenge is to write a small program that cycles through 50 specific colour values and then loops. I managed to write something that displays and changes colour from …

---

## [Recreating pong, I need help though](https://discourse.processing.org/t/recreating-pong-i-need-help-though/35166)

<div class="topic-metadata">

**Author:** [@Adrian\_vargas42](https://discourse.processing.org/u/Adrian_vargas42)\
**Replies:** 6\
**Last updated:** [March 1, 2022, 9:53am UTC](https://discourse.processing.org/t/recreating-pong-i-need-help-though/35166 "2022-03-01T09:53:13Z")

</div>

Hello, I need help with recreating the game, “Pong”. I have gotten both of the paddles and the divider betwen which side is which, I need to get help with getting, the score, and the ball to move on its own, the mouse mo…

---

## [Is there a way to use a command that draws what I want instead of using e.g. rect or ellipses very much?](https://discourse.processing.org/t/is-there-a-way-to-use-a-command-that-draws-what-i-want-instead-of-using-e-g-rect-or-ellipses-very-much/35402)

<div class="topic-metadata">

**Author:** [@Coder1](https://discourse.processing.org/u/Coder1)\
**Replies:** 4\
**Last updated:** [March 1, 2022, 9:46am UTC](https://discourse.processing.org/t/is-there-a-way-to-use-a-command-that-draws-what-i-want-instead-of-using-e-g-rect-or-ellipses-very-much/35402 "2022-03-01T09:46:15Z")

</div>

Hello. I would like to know if there is a way to use a command or a function instead of using e.g. ellipse or rect very very often to create an animation? Here is an example: rect(x,y -= g,g,g); rect(x,y -= g,g,g); re…

---

## [Can you help me change the Speed of the ball?](https://discourse.processing.org/t/can-you-help-me-change-the-speed-of-the-ball/35470)

<div class="topic-metadata">

**Author:** [@Cuber1](https://discourse.processing.org/u/Cuber1)\
**Replies:** 8\
**Last updated:** [February 28, 2022, 11:44am UTC](https://discourse.processing.org/t/can-you-help-me-change-the-speed-of-the-ball/35470 "2022-02-28T11:44:10Z")

</div>

Reset the velocity back to its initial value once the ball collides with an edge of the internal wall or the canvas boundary. Note that the sign of the velocity will depend on the edge the ball hits. For example, after …

---

## [Cómo darle un valor fijo a la última posición de mouseX](https://discourse.processing.org/t/como-darle-un-valor-fijo-a-la-ultima-posicion-de-mousex/35467)

<div class="topic-metadata">

**Author:** [@Amju\_Rubi](https://discourse.processing.org/u/Amju_Rubi)\
**Replies:** 1\
**Last updated:** [February 27, 2022, 10:47pm UTC](https://discourse.processing.org/t/como-darle-un-valor-fijo-a-la-ultima-posicion-de-mousex/35467 "2022-02-27T22:47:52Z")

</div>

necesito que la posición en x tome un valor estático al cumplir con cierta condición y esta posición debe ser la última que tuvo mouseX

---

## [Saving Current Frame on Mouse Click](https://discourse.processing.org/t/saving-current-frame-on-mouse-click/35427)

<div class="topic-metadata">

**Author:** [@eoinfen](https://discourse.processing.org/u/eoinfen)\
**Replies:** 7\
**Last updated:** [February 27, 2022, 12:33am UTC](https://discourse.processing.org/t/saving-current-frame-on-mouse-click/35427 "2022-02-27T00:33:50Z")

</div>

I am trying to save the current frame when the mouse is clicked. I have tried using save() and saveFrame(), but both are saving the next frame that will be displayed instead of the current frame being displayed. Is there…

---

## [PSurfaceAWT.SmoothCanvas\_SquareNuisance](https://discourse.processing.org/t/psurfaceawt-smoothcanvas-squarenuisance/35447)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 1\
**Last updated:** [February 25, 2022, 9:16pm UTC](https://discourse.processing.org/t/psurfaceawt-smoothcanvas-squarenuisance/35447 "2022-02-25T21:16:39Z")

</div>

Other than setting the canvas bounds outside of the frame is there any way to get rid of this pesky colored square? import java.awt.\*; import java.awt.event.\*; import javax.swing.\*; javax.swing.JFrame frame; java.awt.C…

---

## [How to export frames as layers to an ico file](https://discourse.processing.org/t/how-to-export-frames-as-layers-to-an-ico-file/35448)

<div class="topic-metadata">

**Author:** [@Fred-Sheppard](https://discourse.processing.org/u/Fred-Sheppard)\
**Replies:** 0\
**Last updated:** [February 25, 2022, 7:57pm UTC](https://discourse.processing.org/t/how-to-export-frames-as-layers-to-an-ico-file/35448 "2022-02-25T19:57:54Z")

</div>

I want to be able to export the processing window across several frames, using saveFrames() or similar, to a single ico file with one layer per frame. It might work similar to the code shown. PImage img; void setup() {…

---

## [AWT Components in Default Processing Window](https://discourse.processing.org/t/awt-components-in-default-processing-window/35401)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 8\
**Last updated:** [February 25, 2022, 4:29pm UTC](https://discourse.processing.org/t/awt-components-in-default-processing-window/35401 "2022-02-25T16:29:16Z")

</div>

With a little help from a StackOverflow thread we are able to get the frame for Processing’s default window (https://stackoverflow.com/questions/39107750/java-and-processing-3-0-frame-class-deprecated-is-there-an-alterna…

---

## [Automatic calendar](https://discourse.processing.org/t/automatic-calendar/35412)

<div class="topic-metadata">

**Author:** [@Malleat](https://discourse.processing.org/u/Malleat)\
**Replies:** 2\
**Last updated:** [February 24, 2022, 1:41pm UTC](https://discourse.processing.org/t/automatic-calendar/35412 "2022-02-24T13:41:48Z")

</div>

Hello everyone ! I want to create an interractive calendar for my projects, with the years / month / day and weeks number. Like i will use the excel librairy to set up every dates, and target dates, then it will automa…

---

## [JFrame\_example\_](https://discourse.processing.org/t/jframe-example/35370)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 0\
**Last updated:** [February 22, 2022, 4:40am UTC](https://discourse.processing.org/t/jframe-example/35370 "2022-02-22T04:40:13Z")

</div>

Before I waste too much time on this, would someone please remind me why this is a bad idea and shouldn’t be pursued. Other than the fact that I have two windows (one of which I didn’t ask for) it seems to work ok. Act…

---

## [Sphere-Sphere Intersect](https://discourse.processing.org/t/sphere-sphere-intersect/35364)

<div class="topic-metadata">

**Author:** [@Divitiacus](https://discourse.processing.org/u/Divitiacus)\
**Replies:** 3\
**Last updated:** [February 22, 2022, 5:41pm UTC](https://discourse.processing.org/t/sphere-sphere-intersect/35364 "2022-02-22T17:41:31Z")

</div>

When two spheres overlap in 3D, they create a circle, where they intersect. I would like to be able to create a (random) point on this circle. Here is what I have so far: Axis a through the center of the circle (long b…

---

## [Image movement management - Donkey Kong Game](https://discourse.processing.org/t/image-movement-management-donkey-kong-game/35374)

<div class="topic-metadata">

**Author:** [@cisky](https://discourse.processing.org/u/cisky)\
**Replies:** 1\
**Last updated:** [February 22, 2022, 11:50am UTC](https://discourse.processing.org/t/image-movement-management-donkey-kong-game/35374 "2022-02-22T11:50:20Z")

</div>

please format code with \</\> button \* homework policy \* asking questions We need help with the image movement management of a Mario image in our game (see how it’s managed in this game freekong org). We don’t know how…

---

## [Duplicate Curves](https://discourse.processing.org/t/duplicate-curves/35366)

<div class="topic-metadata">

**Author:** [@jmankoff](https://discourse.processing.org/u/jmankoff)\
**Replies:** 4\
**Last updated:** [February 22, 2022, 4:55am UTC](https://discourse.processing.org/t/duplicate-curves/35366 "2022-02-22T04:55:55Z")

</div>

Hi, I’m trying to generate an SVG with bezier curves in it from processing. However, when I open the resulting SVG in illustrator, there are duplicates of every curve – one with no fill but a line, and one with no line,…

---

## [Collision detection for player sprite and platforms sprites](https://discourse.processing.org/t/collision-detection-for-player-sprite-and-platforms-sprites/35363)

<div class="topic-metadata">

**Author:** [@RafaDuarte](https://discourse.processing.org/u/RafaDuarte)\
**Replies:** 1\
**Last updated:** [February 21, 2022, 10:13pm UTC](https://discourse.processing.org/t/collision-detection-for-player-sprite-and-platforms-sprites/35363 "2022-02-21T22:13:56Z")

</div>

I have read some topics here on the Processing forum and watched some videos on YouTube towards collision detection in simple games, however most of them are centred in drawings made on Processing itself, such as circles…

---

## [Problem with reading a html file](https://discourse.processing.org/t/problem-with-reading-a-html-file/32277)

<div class="topic-metadata">

**Author:** [@Flolo](https://discourse.processing.org/u/Flolo)\
**Replies:** 2\
**Last updated:** [February 20, 2022, 8:27pm UTC](https://discourse.processing.org/t/problem-with-reading-a-html-file/32277 "2022-02-20T20:27:44Z")

</div>

Hey, I want to write a class with which you can get a certain element from a website. For example give the class a link and an xpath and as result I want a string with the code of the element. link:Ludmilla von Böhmen…

---

## [Send 1 data from Processing to Python that changes in void draw() loop (NEED HELP)](https://discourse.processing.org/t/send-1-data-from-processing-to-python-that-changes-in-void-draw-loop-need-help/35241)

<div class="topic-metadata">

**Author:** [@finchle99](https://discourse.processing.org/u/finchle99)\
**Replies:** 4\
**Last updated:** [February 20, 2022, 6:08pm UTC](https://discourse.processing.org/t/send-1-data-from-processing-to-python-that-changes-in-void-draw-loop-need-help/35241 "2022-02-20T18:08:59Z")

</div>

Hi, I’m new in Processing. How can I send only 1 data from Processing to Python every time I use mousePressed == true, the data changes in void draw(). I tried and every time I press the mouse, the data that was sent …

---

## [Detect rectangle intersection in 3D](https://discourse.processing.org/t/detect-rectangle-intersection-in-3d/35201)

<div class="topic-metadata">

**Author:** [@bruno.pace](https://discourse.processing.org/u/bruno.pace)\
**Replies:** 5\
**Last updated:** [February 19, 2022, 3:50pm UTC](https://discourse.processing.org/t/detect-rectangle-intersection-in-3d/35201 "2022-02-19T15:50:12Z")

</div>

Hi there, I am writing a program to draw some white squares in 3D space and I would like that, where they intersect, a black line is shown. I can’t find an easy way to do that. However, if I use different colors for th…

---

## [Removing class from code](https://discourse.processing.org/t/removing-class-from-code/35249)

<div class="topic-metadata">

**Author:** [@gvmrk](https://discourse.processing.org/u/gvmrk)\
**Replies:** 3\
**Last updated:** [February 18, 2022, 6:36pm UTC](https://discourse.processing.org/t/removing-class-from-code/35249 "2022-02-18T18:36:09Z")

</div>

Hello, I wrote this code a while ago. Now I need to get the methods loose and get the class out of the code, How do I do this? Thank you! int speelveldPosX, speelveldPosY; int speelveldSizeX, speelveldSizeY; int vakSi…

---

## [Teclear una letra y generar un objeto](https://discourse.processing.org/t/teclear-una-letra-y-generar-un-objeto/35271)

<div class="topic-metadata">

**Author:** [@AdriaCornell](https://discourse.processing.org/u/AdriaCornell)\
**Replies:** 2\
**Last updated:** [February 18, 2022, 6:28pm UTC](https://discourse.processing.org/t/teclear-una-letra-y-generar-un-objeto/35271 "2022-02-18T18:28:54Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Tengo una duda sobre como hacer para que una vez consigo asignar a una letra un objeto por ejemplo, al pulsar la letra C aparece un círculo dond…

---

## [Convert a primitive type array into a Object\[\] array](https://discourse.processing.org/t/convert-a-primitive-type-array-into-a-object-array/35245)

<div class="topic-metadata">

**Author:** [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Replies:** 1\
**Last updated:** [February 17, 2022, 6:50pm UTC](https://discourse.processing.org/t/convert-a-primitive-type-array-into-a-object-array/35245 "2022-02-17T18:50:43Z")

</div>

I’m currently writing a serialization-function and have been making progress for everything that doesn’t use an array with primitive types. Here is my code: import java.lang.reflect.Field; class BClass { int value; …

---

## [ How to connect my code with the key pressed event and what should I do to make my character jump? ( Processing 3.5.4)](https://discourse.processing.org/t/how-to-connect-my-code-with-the-key-pressed-event-and-what-should-i-do-to-make-my-character-jump-processing-3-5-4/35231)

<div class="topic-metadata">

**Author:** [@RafaDuarte](https://discourse.processing.org/u/RafaDuarte)\
**Replies:** 4\
**Last updated:** [February 17, 2022, 6:31pm UTC](https://discourse.processing.org/t/how-to-connect-my-code-with-the-key-pressed-event-and-what-should-i-do-to-make-my-character-jump-processing-3-5-4/35231 "2022-02-17T18:31:26Z")

</div>

I have been coding a simple game and I’m stuck in the key pressed events and my intention is to make my character move backwards, onwards, upwards and downwards. Where should I place the keypressed code to connect it wit…

---

## [How to connect my code with the key pressed event and what should I do to make my character jump? (Duplicate thread)](https://discourse.processing.org/t/how-to-connect-my-code-with-the-key-pressed-event-and-what-should-i-do-to-make-my-character-jump-duplicate-thread/35211)

<div class="topic-metadata">

**Author:** [@RafaDuarte](https://discourse.processing.org/u/RafaDuarte)\
**Replies:** 4\
**Last updated:** [February 17, 2022, 5:50pm UTC](https://discourse.processing.org/t/how-to-connect-my-code-with-the-key-pressed-event-and-what-should-i-do-to-make-my-character-jump-duplicate-thread/35211 "2022-02-17T17:50:10Z")

</div>

I have been coding a simple game and I’m stuck in the key pressed events and my intention is to make my character move backwards, onwards, upwards and downwards. Where should I place the keypressed code to connect it wit…

---

## [Flickering of shapes. Problem with perspective?](https://discourse.processing.org/t/flickering-of-shapes-problem-with-perspective/33892)

<div class="topic-metadata">

**Author:** [@WhiteSte](https://discourse.processing.org/u/WhiteSte)\
**Replies:** 12\
**Last updated:** [February 17, 2022, 3:51pm UTC](https://discourse.processing.org/t/flickering-of-shapes-problem-with-perspective/33892 "2022-02-17T15:51:51Z")

</div>

Dear all, the little start up where I work is building a software. For this reason i cannot share with you all the code, but i could share some little pieces. The problem: I’m trying to visualize a city in a 3d world, b…

---

## [Introducing randomness and asymmetry to shape](https://discourse.processing.org/t/introducing-randomness-and-asymmetry-to-shape/35073)

<div class="topic-metadata">

**Author:** [@krissnutt](https://discourse.processing.org/u/krissnutt)\
**Replies:** 40\
**Last updated:** [February 17, 2022, 3:55pm UTC](https://discourse.processing.org/t/introducing-randomness-and-asymmetry-to-shape/35073 "2022-02-17T15:55:19Z")

</div>

Good day :slight\_smile: I am trying to code a pattern of vulva shapes. So far I have managed to code the shape and make a pattern, but what I want to do is make each vulva different from the other ones, i.e., introduce …

---

## [Problem: Image (background) needs to loop in it's --background; x position](https://discourse.processing.org/t/problem-image-background-needs-to-loop-in-its-background-x-position/35224)

<div class="topic-metadata">

**Author:** [@Kimjstuff](https://discourse.processing.org/u/Kimjstuff)\
**Replies:** 3\
**Last updated:** [February 17, 2022, 3:39pm UTC](https://discourse.processing.org/t/problem-image-background-needs-to-loop-in-its-background-x-position/35224 "2022-02-17T15:39:49Z")

</div>

I’m trying to make a small game and is currently stock on a few problems I have made my background/image move from left to right, but when it meets the edge of the background/picture within my processing window I want …

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

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