# Coding Questions

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

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

**Page:** 88

---

## [Academic exercise HELP](https://discourse.processing.org/t/academic-exercise-help/22130)

<div class="topic-metadata">

**Author:** [@Nikos](https://discourse.processing.org/u/Nikos)\
**Replies:** 5\
**Last updated:** [June 25, 2020, 12:23am UTC](https://discourse.processing.org/t/academic-exercise-help/22130 "2020-06-25T00:23:00Z")

</div>

Hello! I’m a newbie on processing and I have a question about an academic exercise. I want to make diagonal points with degrading strokeWeight(starting at point 0,0 with the bigger point). I must use this semi completed…

---

## [Wait for selectFolder()](https://discourse.processing.org/t/wait-for-selectfolder/22122)

<div class="topic-metadata">

**Author:** [@F53](https://discourse.processing.org/u/F53)\
**Replies:** 4\
**Last updated:** [June 25, 2020, 12:02am UTC](https://discourse.processing.org/t/wait-for-selectfolder/22122 "2020-06-25T00:02:48Z")

</div>

I am writing a program to do mass image editing and would like to have the end user select an input and output folder when the program starts. I tried using selectFolder("Select a input folder:", "inputFolder"); and it …

---

## [Neural network help: AI doesn't improve](https://discourse.processing.org/t/neural-network-help-ai-doesnt-improve/5880)

<div class="topic-metadata">

**Author:** [@Lexyth](https://discourse.processing.org/u/Lexyth)\
**Replies:** 3\
**Last updated:** [June 24, 2020, 11:54pm UTC](https://discourse.processing.org/t/neural-network-help-ai-doesnt-improve/5880 "2020-06-24T23:54:42Z")

</div>

Hi, i made a very simple and basic (i thought, but might as well be skynet…) Neural Network. I am quite familiar with how it should work, although i never made one myself (though i copied a machine learning system, which…

---

## [Decrypt caesar cipher](https://discourse.processing.org/t/decrypt-caesar-cipher/22131)

<div class="topic-metadata">

**Author:** [@homeCoder](https://discourse.processing.org/u/homeCoder)\
**Replies:** 1\
**Last updated:** [June 24, 2020, 8:24pm UTC](https://discourse.processing.org/t/decrypt-caesar-cipher/22131 "2020-06-24T20:24:35Z")

</div>

thank you thank you very much

---

## [Game wont resume](https://discourse.processing.org/t/game-wont-resume/22112)

<div class="topic-metadata">

**Author:** [@qewer3322](https://discourse.processing.org/u/qewer3322)\
**Replies:** 7\
**Last updated:** [June 24, 2020, 8:42am UTC](https://discourse.processing.org/t/game-wont-resume/22112 "2020-06-24T08:42:27Z")

</div>

So I have a somewhat simple snake game code here: ArrayList\<Integer\> x = new ArrayList\<Integer\>(), y = new ArrayList\<Integer\>(); int w=30, h=30, blocks=20, direction = 2, foodx =15, foody = 15, fcl1=255, fcl2=255, fcl3=…

---

## [Pong game menu with stages](https://discourse.processing.org/t/pong-game-menu-with-stages/21893)

<div class="topic-metadata">

**Author:** [@mrporcessing](https://discourse.processing.org/u/mrporcessing)\
**Replies:** 3\
**Last updated:** [June 24, 2020, 1:55am UTC](https://discourse.processing.org/t/pong-game-menu-with-stages/21893 "2020-06-24T01:55:12Z")

</div>

Hi, I need help creating the menus with stages. Whenever I do it, voidKeypressed keeps getting highlighted. I’m not sure why. Also you can suggest any other changes. //all major variables int x,y,w,h,speedX,speedY;//cir…

---

## [Loop draw with rotating image](https://discourse.processing.org/t/loop-draw-with-rotating-image/22118)

<div class="topic-metadata">

**Author:** [@aerob](https://discourse.processing.org/u/aerob)\
**Replies:** 1\
**Last updated:** [June 23, 2020, 10:16pm UTC](https://discourse.processing.org/t/loop-draw-with-rotating-image/22118 "2020-06-23T22:16:29Z")

</div>

Hello guys, I am new to processing… but im having a lot of fun learning new ways of programming. In this particular code i have a png which rotates in a 90 degrees angle. what im missing is that the png starts in the to…

---

## [Image size formating: What is the best way to do it?](https://discourse.processing.org/t/image-size-formating-what-is-the-best-way-to-do-it/22104)

<div class="topic-metadata">

**Author:** [@AntiViral\_Builder](https://discourse.processing.org/u/AntiViral_Builder)\
**Replies:** 2\
**Last updated:** [June 23, 2020, 10:02pm UTC](https://discourse.processing.org/t/image-size-formating-what-is-the-best-way-to-do-it/22104 "2020-06-23T22:02:53Z")

</div>

This is not an AI question, but what I want to do is to take an image containing a character and format it to the size that my AI will accept which is 32,32. the problem is that when I use this: for (int i=0;i\<32;i++){ …

---

## [How to repeat 5 sec?](https://discourse.processing.org/t/how-to-repeat-5-sec/22113)

<div class="topic-metadata">

**Author:** [@lee1](https://discourse.processing.org/u/lee1)\
**Replies:** 1\
**Last updated:** [June 23, 2020, 9:47pm UTC](https://discourse.processing.org/t/how-to-repeat-5-sec/22113 "2020-06-23T21:47:57Z")

</div>

how can repeat every code 5 sec forver? i try to find about that, i cant find “repeat using time”

---

## [XML string with return sign](https://discourse.processing.org/t/xml-string-with-return-sign/22102)

<div class="topic-metadata">

**Author:** [@matheplica](https://discourse.processing.org/u/matheplica)\
**Replies:** 5\
**Last updated:** [June 23, 2020, 9:33pm UTC](https://discourse.processing.org/t/xml-string-with-return-sign/22102 "2020-06-23T21:33:53Z")

</div>

Hi, I put back in a XML file a string with many lines. But after record it I have only one lines. txt.setContent(t.getTxt()); //txt is my xml node What is missing ?

---

## [Accuracy of float numbers](https://discourse.processing.org/t/accuracy-of-float-numbers/22096)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 3\
**Last updated:** [June 23, 2020, 5:12pm UTC](https://discourse.processing.org/t/accuracy-of-float-numbers/22096 "2020-06-23T17:12:44Z")

</div>

The map function should produce a float (see code below). If one looks at the first 10 results, with i first and then i mapped between 85.0 and 170.0, we have: 85 85.0 86 87.0 87 89.0 88 91.0 89 93.0 90 95.0 91 97…

---

## [Font Changes in Processing](https://discourse.processing.org/t/font-changes-in-processing/22061)

<div class="topic-metadata">

**Author:** [@yhlaskerimov](https://discourse.processing.org/u/yhlaskerimov)\
**Replies:** 2\
**Last updated:** [June 23, 2020, 8:45am UTC](https://discourse.processing.org/t/font-changes-in-processing/22061 "2020-06-23T08:45:51Z")

</div>

Hello, I wanna change font smoother. For Example: My texts’ font is ‘xx’. When My Mouse reaches to my text it’s font has to change to ‘xx bold’ smoother. When I remove My Mouse from my text it has to be in initial font…

---

## [First Page Game](https://discourse.processing.org/t/first-page-game/22033)

<div class="topic-metadata">

**Author:** [@marika20](https://discourse.processing.org/u/marika20)\
**Replies:** 2\
**Last updated:** [June 21, 2020, 11:38pm UTC](https://discourse.processing.org/t/first-page-game/22033 "2020-06-21T23:38:52Z")

</div>

Hi everyone, I have a question: does anyone know how to put some sort of timer to insert a game interface? I’m creating a game where there is an interface that must be shown initially and then disappear … does anyone kn…

---

## [Saving specific frames into one PDF, using frameCount and array](https://discourse.processing.org/t/saving-specific-frames-into-one-pdf-using-framecount-and-array/22060)

<div class="topic-metadata">

**Author:** [@vvvr](https://discourse.processing.org/u/vvvr)\
**Replies:** 3\
**Last updated:** [June 22, 2020, 10:48pm UTC](https://discourse.processing.org/t/saving-specific-frames-into-one-pdf-using-framecount-and-array/22060 "2020-06-22T22:48:01Z")

</div>

Hi, I am new to Processing and using the examples in the PDF library I am trying to write a code for one of my artworks. I need to save into one PDF a particular selection of frames. I have adapted the code for the exam…

---

## [PShape.rotateZ() bug?](https://discourse.processing.org/t/pshape-rotatez-bug/17509)

<div class="topic-metadata">

**Author:** [@Tim\_Mortimer](https://discourse.processing.org/u/Tim_Mortimer)\
**Replies:** 7\
**Last updated:** [June 22, 2020, 8:14pm UTC](https://discourse.processing.org/t/pshape-rotatez-bug/17509 "2020-06-22T20:14:54Z")

</div>

Hi. New to Processing & this forum. Been playing with the former about a week or so, really loving it. Loving the video tutorials & OpenProcessing site: between these 2 resources & the Coding Train channel on Youtube,…

---

## [How to use mouseClicked to only effect one object in ArrayList?](https://discourse.processing.org/t/how-to-use-mouseclicked-to-only-effect-one-object-in-arraylist/22067)

<div class="topic-metadata">

**Author:** [@s.k9](https://discourse.processing.org/u/s.k9)\
**Replies:** 2\
**Last updated:** [June 22, 2020, 4:13pm UTC](https://discourse.processing.org/t/how-to-use-mouseclicked-to-only-effect-one-object-in-arraylist/22067 "2020-06-22T16:13:20Z")

</div>

Hi all, I am trying to make a simple game involving legos. The premise is the user presses ‘d’ to add legos and can click on them to move them around. On hovering over a lego, it changes color, and on click, the lego fo…

---

## [How to add texture (with an image) to a line?](https://discourse.processing.org/t/how-to-add-texture-with-an-image-to-a-line/22048)

<div class="topic-metadata">

**Author:** [@Vickydcl](https://discourse.processing.org/u/Vickydcl)\
**Replies:** 1\
**Last updated:** [June 22, 2020, 1:01am UTC](https://discourse.processing.org/t/how-to-add-texture-with-an-image-to-a-line/22048 "2020-06-22T01:01:45Z")

</div>

So i have this code (its a function that creates a line in a line object): void dibujarLinea() //draw color line { pushMatrix(); pushStyle(); strokeCap(PROJECT); strokeWeight( grosor ); translate( x …

---

## [Collision of two rectangles](https://discourse.processing.org/t/collision-of-two-rectangles/22010)

<div class="topic-metadata">

**Author:** [@jeyeffkay](https://discourse.processing.org/u/jeyeffkay)\
**Replies:** 5\
**Last updated:** [June 21, 2020, 6:58pm UTC](https://discourse.processing.org/t/collision-of-two-rectangles/22010 "2020-06-21T18:58:21Z")

</div>

Hey guys, I am corrently working on a flappy bird like game and I want to now how it is possible to detect a collusion. Currently the bird is just a rectangle. So I want to know how I in general can check if the rectang…

---

## [Incrementing inside a nested loop](https://discourse.processing.org/t/incrementing-inside-a-nested-loop/22034)

<div class="topic-metadata">

**Author:** [@pessotta](https://discourse.processing.org/u/pessotta)\
**Replies:** 3\
**Last updated:** [June 21, 2020, 1:02pm UTC](https://discourse.processing.org/t/incrementing-inside-a-nested-loop/22034 "2020-06-21T13:02:09Z")

</div>

Hello, I am trying to draw an array of rectangles in an incremented manner. I want them to increase as I click the mouse. Beginning with 2 they will increase horizontally, them move to the row below. I understand that t…

---

## [Load and Update pixels inside a function](https://discourse.processing.org/t/load-and-update-pixels-inside-a-function/21872)

<div class="topic-metadata">

**Author:** [@RenanRabelo](https://discourse.processing.org/u/RenanRabelo)\
**Replies:** 3\
**Last updated:** [June 21, 2020, 4:48am UTC](https://discourse.processing.org/t/load-and-update-pixels-inside-a-function/21872 "2020-06-21T04:48:05Z")

</div>

Inside the function line() there is an Load and Update pixels rigth? Is possible to use those functions (rect, line, point etc) but loading the pixels at the start of the draw function and updating at the end? I need t…

---

## [I want to know the trig maths for calculating the collision normal after collision](https://discourse.processing.org/t/i-want-to-know-the-trig-maths-for-calculating-the-collision-normal-after-collision/22017)

<div class="topic-metadata">

**Author:** [@Why\_I\_Use\_Processing](https://discourse.processing.org/u/Why_I_Use_Processing)\
**Replies:** 3\
**Last updated:** [June 20, 2020, 6:42pm UTC](https://discourse.processing.org/t/i-want-to-know-the-trig-maths-for-calculating-the-collision-normal-after-collision/22017 "2020-06-20T18:42:24Z")

</div>

I want that car shown below in the image to bounce off the tribune after collision. I already made the collision detections work, I just want to apply some physics after collision(collision normal, velocity component, e…

---

## [Help with physarum simulation](https://discourse.processing.org/t/help-with-physarum-simulation/21276)

<div class="topic-metadata">

**Author:** [@musiciantriescoding](https://discourse.processing.org/u/musiciantriescoding)\
**Replies:** 6\
**Last updated:** [June 19, 2020, 7:55pm UTC](https://discourse.processing.org/t/help-with-physarum-simulation/21276 "2020-06-19T19:55:36Z")

</div>

Hello everyone! Recently, physarum simulations have become quite popular. Check out Sage Jenson’s simulations for some beautiful visuals (https://sagejenson.com/physarum). I tried to simulate physarum as well using the …

---

## [How do i make the movement function for the player count only once so that they can be executed one by one only once?](https://discourse.processing.org/t/how-do-i-make-the-movement-function-for-the-player-count-only-once-so-that-they-can-be-executed-one-by-one-only-once/21944)

<div class="topic-metadata">

**Author:** [@sokuv](https://discourse.processing.org/u/sokuv)\
**Replies:** 4\
**Last updated:** [June 18, 2020, 3:51pm UTC](https://discourse.processing.org/t/how-do-i-make-the-movement-function-for-the-player-count-only-once-so-that-they-can-be-executed-one-by-one-only-once/21944 "2020-06-18T15:51:25Z")

</div>

I have a game currently which has a player and some obstacles, I want to navigate this player with some commands, but the problem is that the command get executed but the rectangle does not get updated so I have to do so…

---

## [Processing vs Rhino coordinates](https://discourse.processing.org/t/processing-vs-rhino-coordinates/21572)

<div class="topic-metadata">

**Author:** [@evilome](https://discourse.processing.org/u/evilome)\
**Replies:** 8\
**Last updated:** [June 19, 2020, 12:20pm UTC](https://discourse.processing.org/t/processing-vs-rhino-coordinates/21572 "2020-06-19T12:20:07Z")

</div>

Hello everyone, Understanding very little programming and facing a related problem and I need help for those who are available: I am working on the 3D animal head construction project from stainless wire using Rhino 6 +…

---

## [Switch case with two key pressed? Is it possible?](https://discourse.processing.org/t/switch-case-with-two-key-pressed-is-it-possible/21869)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 7\
**Last updated:** [June 19, 2020, 11:09am UTC](https://discourse.processing.org/t/switch-case-with-two-key-pressed-is-it-possible/21869 "2020-06-19T11:09:26Z")

</div>

Hello. I would like to switch case with a combination of two letter or letter, one of each. I did like that, but it doesn’t work void keyPressed() { if (key=='5' && key=='T'){ println ("T55555TTTT5555"); …

---

## [Mario game help!](https://discourse.processing.org/t/mario-game-help/21979)

<div class="topic-metadata">

**Author:** [@jasmine](https://discourse.processing.org/u/jasmine)\
**Replies:** 9\
**Last updated:** [June 18, 2020, 7:02pm UTC](https://discourse.processing.org/t/mario-game-help/21979 "2020-06-18T19:02:13Z")

</div>

How can I add enemies that the player needs to avoid int gameMode=0;//0 - menu, 1 - play game, 2 - instructions, 3 - character selection int selChar=1;//default character is “character 1” int level=1; color red=color(25…

---

## [getAttribute value from XML node](https://discourse.processing.org/t/getattribute-value-from-xml-node/21977)

<div class="topic-metadata">

**Author:** [@matheplica](https://discourse.processing.org/u/matheplica)\
**Replies:** 1\
**Last updated:** [June 18, 2020, 6:17pm UTC](https://discourse.processing.org/t/getattribute-value-from-xml-node/21977 "2020-06-18T18:17:56Z")

</div>

Hi, I’m trying to get the value of attribute in XML. Here’s the xml line : \<image x="20" y="190"\> How to have 20 in a variable ?

---

## [How make this movement?](https://discourse.processing.org/t/how-make-this-movement/21935)

<div class="topic-metadata">

**Author:** [@Lucaso](https://discourse.processing.org/u/Lucaso)\
**Replies:** 3\
**Last updated:** [June 18, 2020, 2:28pm UTC](https://discourse.processing.org/t/how-make-this-movement/21935 "2020-06-18T14:28:33Z")

</div>

Hi everyone! I’m new in this community and using Processing, so I’m going to explain what is my problem. I want make a “field road” effect, similar to the one shown in the following link: https://cs.brynmawr.edu/gxk20…

---

## [Lines movement help](https://discourse.processing.org/t/lines-movement-help/21862)

<div class="topic-metadata">

**Author:** [@marika20](https://discourse.processing.org/u/marika20)\
**Replies:** 7\
**Last updated:** [June 18, 2020, 1:25pm UTC](https://discourse.processing.org/t/lines-movement-help/21862 "2020-06-18T13:25:12Z")

</div>

Ciao, qualcuno saprebbe dirmi perchè non riesco a fare il movimento nella parte sinistra dello schermo? Riesco a far muove la parte destra con la linea e il rect(blu) ma la parte di sinistra quella con la linea e il rec…

---

## [At work with the class](https://discourse.processing.org/t/at-work-with-the-class/21954)

<div class="topic-metadata">

**Author:** [@marika20](https://discourse.processing.org/u/marika20)\
**Replies:** 4\
**Last updated:** [June 18, 2020, 1:03pm UTC](https://discourse.processing.org/t/at-work-with-the-class/21954 "2020-06-18T13:03:59Z")

</div>

Hi everyone I need a confirmation or a hand for a game: I am working with colored buttons and I need to understand if when I step on with the mouse they are selected and then transported within my sketch. Can anyone tel…

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

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