# Coding Questions

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

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

**Page:** 137

---

## [Unable to Resolve XML URL (Even though it is valid)](https://discourse.processing.org/t/unable-to-resolve-xml-url-even-though-it-is-valid/11836)

<div class="topic-metadata">

**Author:** [@n055](https://discourse.processing.org/u/n055)\
**Replies:** 10\
**Last updated:** [June 5, 2019, 6:37pm UTC](https://discourse.processing.org/t/unable-to-resolve-xml-url-even-though-it-is-valid/11836 "2019-06-05T18:37:28Z")

</div>

Hey y’all, I’m trying to fetch an xml document from a URL for a daily quote, but despite the link working outside of Processing (it resolves in my browser and in an online xml reader), I’m getting lots of strange errors …

---

## [When ellipse hit the rect](https://discourse.processing.org/t/when-ellipse-hit-the-rect/11733)

<div class="topic-metadata">

**Author:** [@Nick1](https://discourse.processing.org/u/Nick1)\
**Replies:** 2\
**Last updated:** [June 5, 2019, 4:44pm UTC](https://discourse.processing.org/t/when-ellipse-hit-the-rect/11733 "2019-06-05T16:44:05Z")

</div>

Hey, I want when my ellipse hit my rect then i want that the ellipse start above another time. But i dont know how to do that. Thanks for help PImage klo, kacke; int x; int \[\] KackeX; int \[\] KackeY; int \[\] speedX; int…

---

## [Keeping a moving shape inside an area](https://discourse.processing.org/t/keeping-a-moving-shape-inside-an-area/11819)

<div class="topic-metadata">

**Author:** [@GuilhermeVolker](https://discourse.processing.org/u/GuilhermeVolker)\
**Replies:** 3\
**Last updated:** [June 4, 2019, 1:36pm UTC](https://discourse.processing.org/t/keeping-a-moving-shape-inside-an-area/11819 "2019-06-04T13:36:48Z")

</div>

Hello! I’am trying to develop an artificial horizon, an aircraft instrument. I made some code but i dont know how to mantain this shape inside the circle of the instrument (when move the mouse the shapes goes outside the…

---

## [I can't get a character to sit on top of a rect without falling through](https://discourse.processing.org/t/i-cant-get-a-character-to-sit-on-top-of-a-rect-without-falling-through/11839)

<div class="topic-metadata">

**Author:** [@danemacfadden](https://discourse.processing.org/u/danemacfadden)\
**Replies:** 5\
**Last updated:** [June 5, 2019, 4:55pm UTC](https://discourse.processing.org/t/i-cant-get-a-character-to-sit-on-top-of-a-rect-without-falling-through/11839 "2019-06-05T16:55:39Z")

</div>

Here’s my code: // Adventures of Dingding // By Dane MacFadden // 2019/06/03 ArrayList\<Platform\> platform; // Holds platforms Dingding dingding; // Character object void setup() { size(600, 400); platform = new Arr…

---

## [How to change the color of some irregular graphics in an image](https://discourse.processing.org/t/how-to-change-the-color-of-some-irregular-graphics-in-an-image/11825)

<div class="topic-metadata">

**Author:** [@h526450301](https://discourse.processing.org/u/h526450301)\
**Replies:** 1\
**Last updated:** [June 4, 2019, 9:15am UTC](https://discourse.processing.org/t/how-to-change-the-color-of-some-irregular-graphics-in-an-image/11825 "2019-06-04T09:15:02Z")

</div>

I just have a map with different colors to represent different communications like this: Now I need to change one of the communications’ color such as I just want to let the Old Town in the color red.How can I do this…

---

## [Mouse Clicked function and storing variables](https://discourse.processing.org/t/mouse-clicked-function-and-storing-variables/11823)

<div class="topic-metadata">

**Author:** [@Pbchocochipcheerios](https://discourse.processing.org/u/Pbchocochipcheerios)\
**Replies:** 1\
**Last updated:** [June 4, 2019, 5:43am UTC](https://discourse.processing.org/t/mouse-clicked-function-and-storing-variables/11823 "2019-06-04T05:43:58Z")

</div>

Hello! I am new to processing and was hoping someone can help. I am drew an object and need it to glide from one mouse click location to another. I used the mouseClicked function and stored the X and Y of when the mous…

---

## [Molecular Geometry 3D Rotation](https://discourse.processing.org/t/molecular-geometry-3d-rotation/11818)

<div class="topic-metadata">

**Author:** [@notcatfish2017](https://discourse.processing.org/u/notcatfish2017)\
**Replies:** 4\
**Last updated:** [June 4, 2019, 2:11am UTC](https://discourse.processing.org/t/molecular-geometry-3d-rotation/11818 "2019-06-04T02:11:56Z")

</div>

Hi, I’m using P3D to create 3D models of organic molecules. Currently, I’m working on a tetrahedral structure, where the angles formed by all of the bonds are 109.5 degrees (see 2nd diagram). In this case, I have the gr…

---

## [Enemy object not moving!](https://discourse.processing.org/t/enemy-object-not-moving/11814)

<div class="topic-metadata">

**Author:** [@sc4p3g0a7](https://discourse.processing.org/u/sc4p3g0a7)\
**Replies:** 6\
**Last updated:** [June 3, 2019, 11:36pm UTC](https://discourse.processing.org/t/enemy-object-not-moving/11814 "2019-06-03T23:36:38Z")

</div>

Hi. i decided one day to make the dinosaur game in the chrome browser. it all worked fine, until i made the cactus.(i suck at programming, so don’t judge) The problem is that he( the cactus) is not moving, even if i assi…

---

## [Mirror-drawing and following mouse](https://discourse.processing.org/t/mirror-drawing-and-following-mouse/11661)

<div class="topic-metadata">

**Author:** [@linebp](https://discourse.processing.org/u/linebp)\
**Replies:** 4\
**Last updated:** [June 3, 2019, 12:23am UTC](https://discourse.processing.org/t/mirror-drawing-and-following-mouse/11661 "2019-06-03T00:23:55Z")

</div>

Hello Processing forum, I’m trying to create a programme where I can draw mirrored lines. My code looks like this: void setup() { fullScreen(); background(255); noStroke(); translate (width/2, 0); } void dr…

---

## [Does anyone know how I can make that (mesh)](https://discourse.processing.org/t/does-anyone-know-how-i-can-make-that-mesh/11783)

<div class="topic-metadata">

**Author:** [@Eyvindr](https://discourse.processing.org/u/Eyvindr)\
**Replies:** 2\
**Last updated:** [June 3, 2019, 11:13am UTC](https://discourse.processing.org/t/does-anyone-know-how-i-can-make-that-mesh/11783 "2019-06-03T11:13:49Z")

</div>

Does anyone knows how to make one of these? I am really trying my best, but somehow can’t figure it out… I have to do this as a project in uni. I have to include the pattern in a letter. I would very much appreciate …

---

## [Noise grid stops moving after a while](https://discourse.processing.org/t/noise-grid-stops-moving-after-a-while/11704)

<div class="topic-metadata">

**Author:** [@madsogstrup](https://discourse.processing.org/u/madsogstrup)\
**Replies:** 3\
**Last updated:** [June 3, 2019, 5:16am UTC](https://discourse.processing.org/t/noise-grid-stops-moving-after-a-while/11704 "2019-06-03T05:16:13Z")

</div>

Hello! I have this code that is doing what i want. But i would like for it to keep “animating” in eternity. I think i know why i stops, but I don’t know how to explain it properly or do anything about it. :slight\_smile…

---

## [Problem with "String Index Out Of Bounds Exception"](https://discourse.processing.org/t/problem-with-string-index-out-of-bounds-exception/11790)

<div class="topic-metadata">

**Author:** [@ToastyOosty](https://discourse.processing.org/u/ToastyOosty)\
**Replies:** 5\
**Last updated:** [June 3, 2019, 12:57am UTC](https://discourse.processing.org/t/problem-with-string-index-out-of-bounds-exception/11790 "2019-06-03T00:57:12Z")

</div>

So I’m writing this code for a small project I’m working and I keep getting the error message “StringIndexOutOfBoundsException: String index out of range: 0” I won’t post the entire code cause its a bit long but here’s …

---

## [Updating void draw() while another function is in a loop](https://discourse.processing.org/t/updating-void-draw-while-another-function-is-in-a-loop/11787)

<div class="topic-metadata">

**Author:** [@SoulT](https://discourse.processing.org/u/SoulT)\
**Replies:** 2\
**Last updated:** [June 2, 2019, 8:53pm UTC](https://discourse.processing.org/t/updating-void-draw-while-another-function-is-in-a-loop/11787 "2019-06-02T20:53:12Z")

</div>

Hi guys, I’m having a bit of trouble with something. I have a FOR loop that’s running inside of a function. The loop loads a few file names from a website, and then adds them to a list. My goal is to have the program u…

---

## [Moving and cutting](https://discourse.processing.org/t/moving-and-cutting/11777)

<div class="topic-metadata">

**Author:** [@BallazX](https://discourse.processing.org/u/BallazX)\
**Replies:** 7\
**Last updated:** [June 2, 2019, 7:49pm UTC](https://discourse.processing.org/t/moving-and-cutting/11777 "2019-06-02T19:49:03Z")

</div>

Hey Guys, I’m trying to do some demo project. What I’d like to do is draw some lines and a rectangle. Those part of the lines will be invisible which are out of the rectangle. I give the end-coordinates of the lines by …

---

## [Data from txt file](https://discourse.processing.org/t/data-from-txt-file/11764)

<div class="topic-metadata">

**Author:** [@GuilhermeVolker](https://discourse.processing.org/u/GuilhermeVolker)\
**Replies:** 3\
**Last updated:** [June 2, 2019, 5:27am UTC](https://discourse.processing.org/t/data-from-txt-file/11764 "2019-06-02T05:27:08Z")

</div>

I have to read a file with 4000 lines or more, when i run this code the sketch reads something near to 500 lines only. Is there some kind of limitation? i’d try with double variables too but didan’t work. //global varia…

---

## [Trouble activating the four arrow keys at the same time](https://discourse.processing.org/t/trouble-activating-the-four-arrow-keys-at-the-same-time/11753)

<div class="topic-metadata">

**Author:** [@Yamanqui](https://discourse.processing.org/u/Yamanqui)\
**Replies:** 2\
**Last updated:** [June 1, 2019, 11:55am UTC](https://discourse.processing.org/t/trouble-activating-the-four-arrow-keys-at-the-same-time/11753 "2019-06-01T11:55:41Z")

</div>

I’m making a game that requires the user to press different combinations of the arrow keys for different moves. But I’m having trouble when they need to press 3 or 4 keys at the same time. I wrote a very simple example …

---

## [How draw rect() with texture with alpha channel?](https://discourse.processing.org/t/how-draw-rect-with-texture-with-alpha-channel/11755)

<div class="topic-metadata">

**Author:** [@erkosone](https://discourse.processing.org/u/erkosone)\
**Replies:** 3\
**Last updated:** [June 1, 2019, 11:11am UTC](https://discourse.processing.org/t/how-draw-rect-with-texture-with-alpha-channel/11755 "2019-06-01T11:11:51Z")

</div>

i have this problem… in 2d the problem not exists… but in 3d when i draw boxes… apears background color in sprites… sprites are drawed with a simple shape with rect()

---

## [Random and If Else help](https://discourse.processing.org/t/random-and-if-else-help/11718)

<div class="topic-metadata">

**Author:** [@b3pkay](https://discourse.processing.org/u/b3pkay)\
**Replies:** 10\
**Last updated:** [June 1, 2019, 12:22am UTC](https://discourse.processing.org/t/random-and-if-else-help/11718 "2019-06-01T00:22:09Z")

</div>

Hello, I am making a “drawing” program and running into an issue. I’ve written a smaller, less complex sample of the program pasted below and am hoping someone can help. Essentially, I want to draw rectangles within a ce…

---

## [Making things happen sequentially within an array](https://discourse.processing.org/t/making-things-happen-sequentially-within-an-array/11749)

<div class="topic-metadata">

**Author:** [@Hetoft](https://discourse.processing.org/u/Hetoft)\
**Replies:** 1\
**Last updated:** [May 31, 2019, 10:59pm UTC](https://discourse.processing.org/t/making-things-happen-sequentially-within-an-array/11749 "2019-05-31T22:59:41Z")

</div>

Hi there, I’m trying to display all the objects in an array, not all at once, but one after the other. Basically, what my code does is to load sequences of SVGs and then display them as one fluent animation. What I wan…

---

## [Create randomly placed circles loop not working(runtime error)](https://discourse.processing.org/t/create-randomly-placed-circles-loop-not-working-runtime-error/11719)

<div class="topic-metadata">

**Author:** [@dakito](https://discourse.processing.org/u/dakito)\
**Replies:** 3\
**Last updated:** [May 31, 2019, 10:39pm UTC](https://discourse.processing.org/t/create-randomly-placed-circles-loop-not-working-runtime-error/11719 "2019-05-31T22:39:34Z")

</div>

So I am making a game where you would click on randomly appearing circles, and for the sake of reusability and self-improvement I have chosen to use for loops and arrays for the first time. After some unexpected results…

---

## [Importing animated vector graphics?](https://discourse.processing.org/t/importing-animated-vector-graphics/11627)

<div class="topic-metadata">

**Author:** [@Hetoft](https://discourse.processing.org/u/Hetoft)\
**Replies:** 6\
**Last updated:** [May 31, 2019, 9:19pm UTC](https://discourse.processing.org/t/importing-animated-vector-graphics/11627 "2019-05-31T21:19:30Z")

</div>

Hi there, I did some small animations in After Effects and want them included in my Processing project. I know that I could display GIFs, but since AE allows me to export animated SVGs (as JSON files) by the help of a p…

---

## [Store the coordinates of the mouse clicks](https://discourse.processing.org/t/store-the-coordinates-of-the-mouse-clicks/11745)

<div class="topic-metadata">

**Author:** [@BallazX](https://discourse.processing.org/u/BallazX)\
**Replies:** 5\
**Last updated:** [May 31, 2019, 7:54pm UTC](https://discourse.processing.org/t/store-the-coordinates-of-the-mouse-clicks/11745 "2019-05-31T19:54:17Z")

</div>

Hello All, I try to draw some shapes and lines. What I’d like to do is draw the shape by clicking on the mouse. E.g: the coordinates of a line should be the mouseX and mouseY. Is there any solution to store the values o…

---

## [Data visualization – sketch set-up error](https://discourse.processing.org/t/data-visualization-sketch-set-up-error/11632)

<div class="topic-metadata">

**Author:** [@Darius](https://discourse.processing.org/u/Darius)\
**Replies:** 9\
**Last updated:** [May 31, 2019, 7:47pm UTC](https://discourse.processing.org/t/data-visualization-sketch-set-up-error/11632 "2019-05-31T19:47:18Z")

</div>

Hi there, I am building a very simple sketch to visualize text and data. It works when is like this(see below), but not when I use void setup and void draw (see second option after). does anyone know why? Thanks! Strin…

---

## [Draw a line without using line()](https://discourse.processing.org/t/draw-a-line-without-using-line/11715)

<div class="topic-metadata">

**Author:** [@BProcess](https://discourse.processing.org/u/BProcess)\
**Replies:** 3\
**Last updated:** [May 31, 2019, 6:03pm UTC](https://discourse.processing.org/t/draw-a-line-without-using-line/11715 "2019-05-31T18:03:30Z")

</div>

Hey guys, I’m new at processing and I would like to do a simple task: draw a line without using the line() function. I already have this code: void setup() { size(1300, 800); } float x1=100; float x2=200; float y1=1…

---

## [Changing background color after rotating object](https://discourse.processing.org/t/changing-background-color-after-rotating-object/11685)

<div class="topic-metadata">

**Author:** [@corbax](https://discourse.processing.org/u/corbax)\
**Replies:** 2\
**Last updated:** [May 31, 2019, 9:40am UTC](https://discourse.processing.org/t/changing-background-color-after-rotating-object/11685 "2019-05-31T09:40:04Z")

</div>

hello guys. I am new to processing. my question is how can I make my rotating object not to leave a trail behind him. I know that it can be done by using background() function but my background is gray and my object is …

---

## [Launching Circles In Processing Circles](https://discourse.processing.org/t/launching-circles-in-processing-circles/11643)

<div class="topic-metadata">

**Author:** [@s21ebutler](https://discourse.processing.org/u/s21ebutler)\
**Replies:** 5\
**Last updated:** [May 30, 2019, 11:30pm UTC](https://discourse.processing.org/t/launching-circles-in-processing-circles/11643 "2019-05-30T23:30:47Z")

</div>

I am doing a project for my computer Science class and I am having some serious trouble with it. I am trying to make it so that I can launch ellipses. Basically you click on the circle you want to launch then drag back, …

---

## [\[Processing 3\] Unable to Delete Files in /data through Java.io.File](https://discourse.processing.org/t/processing-3-unable-to-delete-files-in-data-through-java-io-file/11693)

<div class="topic-metadata">

**Author:** [@ILikePi](https://discourse.processing.org/u/ILikePi)\
**Replies:** 2\
**Last updated:** [May 30, 2019, 7:20pm UTC](https://discourse.processing.org/t/processing-3-unable-to-delete-files-in-data-through-java-io-file/11693 "2019-05-30T19:20:59Z")

</div>

This is the code… I think the issue is how I am using Java.io.File but I have no idea. String str = new Integer(i).toString(); String fileName1 = dataPath(str+".csv"); File f1 = new File(fileName1); …

---

## [Trying to make a SpaceInvaders-esque game and running into some problems, would appreciate help!](https://discourse.processing.org/t/trying-to-make-a-spaceinvaders-esque-game-and-running-into-some-problems-would-appreciate-help/11711)

<div class="topic-metadata">

**Author:** [@MasquedProgrammer](https://discourse.processing.org/u/MasquedProgrammer)\
**Replies:** 1\
**Last updated:** [May 30, 2019, 5:04pm UTC](https://discourse.processing.org/t/trying-to-make-a-spaceinvaders-esque-game-and-running-into-some-problems-would-appreciate-help/11711 "2019-05-30T17:04:41Z")

</div>

Hello, in school I have an IT class and am pretty new to programming, I can pretty much only do the basics. In any case, I’m making a Space Invaders-esque game and have a pretty annoying problem. Here is the (I think) re…

---

## [Running out of Memory](https://discourse.processing.org/t/running-out-of-memory/11701)

<div class="topic-metadata">

**Author:** [@MrPyro](https://discourse.processing.org/u/MrPyro)\
**Replies:** 0\
**Last updated:** [May 30, 2019, 6:16am UTC](https://discourse.processing.org/t/running-out-of-memory/11701 "2019-05-30T06:16:26Z")

</div>

Hi, For quite some time now, I have been trying to figure out a solution to my problem. I am running out of memory, storing PShape objects. Currently, I am adding around 250,000 child shapes to a main PShape object that…

---

## [3d animation to flip a card](https://discourse.processing.org/t/3d-animation-to-flip-a-card/11687)

<div class="topic-metadata">

**Author:** [@minican1997](https://discourse.processing.org/u/minican1997)\
**Replies:** 9\
**Last updated:** [May 30, 2019, 2:05am UTC](https://discourse.processing.org/t/3d-animation-to-flip-a-card/11687 "2019-05-30T02:05:17Z")

</div>

hello i need some help i am new in processing and i dont know how to make an animation to flip a card when i click on it i need to make a memory card game and to have an flip animation on it please help me :(( Card\[\]…

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

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