# Coding Questions

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

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

**Page:** 42

---

## [Assignment need help Due by 11:59pm](https://discourse.processing.org/t/assignment-need-help-due-by-11-59pm/32956)

<div class="topic-metadata">

**Author:** [@ineedtosleep](https://discourse.processing.org/u/ineedtosleep)\
**Replies:** 2\
**Last updated:** [October 22, 2021, 12:06am UTC](https://discourse.processing.org/t/assignment-need-help-due-by-11-59pm/32956 "2021-10-22T00:06:51Z")

</div>

Please help!!! I do not know how to make an animation with this!! what i had in mind is moving the whole thing towards the right making it a loop. I need to create a 15 sec short video.

---

## [My functions are giving me an error, wanting a semicolon somewhere](https://discourse.processing.org/t/my-functions-are-giving-me-an-error-wanting-a-semicolon-somewhere/32961)

<div class="topic-metadata">

**Author:** [@Timeless\_Mage](https://discourse.processing.org/u/Timeless_Mage)\
**Replies:** 4\
**Last updated:** [October 21, 2021, 5:44pm UTC](https://discourse.processing.org/t/my-functions-are-giving-me-an-error-wanting-a-semicolon-somewhere/32961 "2021-10-21T17:44:32Z")

</div>

These functions are giving me an error, asking for a semicolon, but when I add it, it doesn’t fix the error. \<\> int arrayTotal(int array\[\]) { int total= 0; for (int i= 0; i\<array.length; i++) { total+=array\[i\]; } …

---

## [Collsions and arrays (duplicate)](https://discourse.processing.org/t/collsions-and-arrays-duplicate/32985)

<div class="topic-metadata">

**Author:** [@Locohogo12](https://discourse.processing.org/u/Locohogo12)\
**Replies:** 0\
**Last updated:** [October 21, 2021, 12:26pm UTC](https://discourse.processing.org/t/collsions-and-arrays-duplicate/32985 "2021-10-21T12:26:41Z")

</div>

Help with collosions of objects and moving objects, with array backgrounds

---

## [Breaking up a String](https://discourse.processing.org/t/breaking-up-a-string/32939)

<div class="topic-metadata">

**Author:** [@dtools22](https://discourse.processing.org/u/dtools22)\
**Replies:** 17\
**Last updated:** [October 21, 2021, 11:34am UTC](https://discourse.processing.org/t/breaking-up-a-string/32939 "2021-10-21T11:34:34Z")

</div>

Hello All, So I’m messing around with some Fantasy Football data for a little coding project. I have a spread sheet that has the following information from a daily fantasy football contest I played in. A full lineup o…

---

## [Circles moving randomly and different to each-other + collision](https://discourse.processing.org/t/circles-moving-randomly-and-different-to-each-other-collision/32979)

<div class="topic-metadata">

**Author:** [@prada123](https://discourse.processing.org/u/prada123)\
**Replies:** 0\
**Last updated:** [October 21, 2021, 7:45am UTC](https://discourse.processing.org/t/circles-moving-randomly-and-different-to-each-other-collision/32979 "2021-10-21T07:45:27Z")

</div>

I’ve been trying to understand how the circles flowing from the right to the left can become random instead of being in the same line. the circles enter at random/different times. I’m new to processing and am stuck on th…

---

## [Making the bricks permanently disappear in Brickbreaker](https://discourse.processing.org/t/making-the-bricks-permanently-disappear-in-brickbreaker/32973)

<div class="topic-metadata">

**Author:** [@KMtz](https://discourse.processing.org/u/KMtz)\
**Replies:** 1\
**Last updated:** [October 21, 2021, 6:52am UTC](https://discourse.processing.org/t/making-the-bricks-permanently-disappear-in-brickbreaker/32973 "2021-10-21T06:52:00Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hi! I am a beginner working on a Brickbreaker game, but I encountered some problems trying to make bricks permanently disappear when the ball hit…

---

## [Calculate text length](https://discourse.processing.org/t/calculate-text-length/32885)

<div class="topic-metadata">

**Author:** [@yalaniv](https://discourse.processing.org/u/yalaniv)\
**Replies:** 8\
**Last updated:** [October 20, 2021, 3:46pm UTC](https://discourse.processing.org/t/calculate-text-length/32885 "2021-10-20T15:46:38Z")

</div>

Update: I found the command textAlign, but it doesn’t do what I need I want to create a loop that runs for example 50 times, And each time it write word in the center of the screen, in smaller font, Here is my code: …

---

## [Memory card game without classes](https://discourse.processing.org/t/memory-card-game-without-classes/32922)

<div class="topic-metadata">

**Author:** [@Lisanne](https://discourse.processing.org/u/Lisanne)\
**Replies:** 2\
**Last updated:** [October 20, 2021, 1:30am UTC](https://discourse.processing.org/t/memory-card-game-without-classes/32922 "2021-10-20T01:30:36Z")

</div>

Hello everyone, I’m making a memory card game in Processing. This is for a homework assignment. I’ve come pretty far with all the information online, but I’m stuck at a few problems. My game has a few requirements to m…

---

## [How to have line with a set length point towards a moving ellipse?](https://discourse.processing.org/t/how-to-have-line-with-a-set-length-point-towards-a-moving-ellipse/32860)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 16\
**Last updated:** [October 19, 2021, 10:33pm UTC](https://discourse.processing.org/t/how-to-have-line-with-a-set-length-point-towards-a-moving-ellipse/32860 "2021-10-19T22:33:32Z")

</div>

how to have the line with //this line behind it, always point towards the ellipse with // this ellipse behind it, while staying 100 pixels long? float sunx=300; float suny=60; int time=600; float begx= 300; float begy= …

---

## [Help with some Crosshairs](https://discourse.processing.org/t/help-with-some-crosshairs/32925)

<div class="topic-metadata">

**Author:** [@Blaze](https://discourse.processing.org/u/Blaze)\
**Replies:** 1\
**Last updated:** [October 19, 2021, 8:26pm UTC](https://discourse.processing.org/t/help-with-some-crosshairs/32925 "2021-10-19T20:26:48Z")

</div>

please format code with \</\> button \* homework policy \* asking questions So, as part of a class assessment I need to make a spooky halloween scene, so far my code is this / if((mouseX \>= 100) && (mouseX \<= 700) && (…

---

## [Make a formula from a String into a number](https://discourse.processing.org/t/make-a-formula-from-a-string-into-a-number/32452)

<div class="topic-metadata">

**Author:** [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Replies:** 6\
**Last updated:** [October 19, 2021, 4:43pm UTC](https://discourse.processing.org/t/make-a-formula-from-a-string-into-a-number/32452 "2021-10-19T16:43:44Z")

</div>

I’m currently trying to make a problem to calculate a Expression in a String. Until now I used a code like this: final ScriptEngine js=new ScriptEngineManager().getEngineByName("js"); String eq="5\*(2+1)"; try{ double e…

---

## [Make overlapping objects use transparency to blend colours, like a Venn Diagram](https://discourse.processing.org/t/make-overlapping-objects-use-transparency-to-blend-colours-like-a-venn-diagram/32930)

<div class="topic-metadata">

**Author:** [@GoodJuJu](https://discourse.processing.org/u/GoodJuJu)\
**Replies:** 4\
**Last updated:** [October 19, 2021, 3:20pm UTC](https://discourse.processing.org/t/make-overlapping-objects-use-transparency-to-blend-colours-like-a-venn-diagram/32930 "2021-10-19T15:20:45Z")

</div>

I have created a Venn diagram using Processing, however, I can either make solid RGB colours, or use an alpha value (RGBA) to give the objects transparency, but I wondered if there was an existing function inside Process…

---

## [Can anybody help me with the my assignment please](https://discourse.processing.org/t/can-anybody-help-me-with-the-my-assignment-please/32929)

<div class="topic-metadata">

**Author:** [@Chandan](https://discourse.processing.org/u/Chandan)\
**Replies:** 1\
**Last updated:** [October 19, 2021, 11:54am UTC](https://discourse.processing.org/t/can-anybody-help-me-with-the-my-assignment-please/32929 "2021-10-19T11:54:24Z")

</div>

Please send me the processing code as soon as possible. Here are my questions. There are 5 questions.

---

## [PGraphics with "for"](https://discourse.processing.org/t/pgraphics-with-for/32917)

<div class="topic-metadata">

**Author:** [@Karrajo](https://discourse.processing.org/u/Karrajo)\
**Replies:** 6\
**Last updated:** [October 19, 2021, 1:29am UTC](https://discourse.processing.org/t/pgraphics-with-for/32917 "2021-10-19T01:29:53Z")

</div>

Hi, I’m trying to convert some code to PGraphics because I want to save the result in a bigger size, but I’m using a “for” part, and I can’t find the right way to make that everything works like in the code without PGrap…

---

## [Stop player from going out of board](https://discourse.processing.org/t/stop-player-from-going-out-of-board/32858)

<div class="topic-metadata">

**Author:** [@kiddish](https://discourse.processing.org/u/kiddish)\
**Replies:** 10\
**Last updated:** [October 18, 2021, 5:36pm UTC](https://discourse.processing.org/t/stop-player-from-going-out-of-board/32858 "2021-10-18T17:36:32Z")

</div>

After a few tries, it still won’t get to work. Somewhat created a game in which the object collides with multiple stuff on the map. I have created a player, which is the image I can move with the cursor. What I actuall…

---

## [Gradient interpolation with 3+ points](https://discourse.processing.org/t/gradient-interpolation-with-3-points/32832)

<div class="topic-metadata">

**Author:** [@dirknbr](https://discourse.processing.org/u/dirknbr)\
**Replies:** 6\
**Last updated:** [October 18, 2021, 11:14am UTC](https://discourse.processing.org/t/gradient-interpolation-with-3-points/32832 "2021-10-18T11:14:09Z")

</div>

We have a n x n canvas and m (say 3) points in it. The m points/nodes all have different fixed RGB colors. The color of each dot in n x n is defined by the distance from any of the color nodes. So each dot is a mixture (…

---

## [Detect keypress while in a loop](https://discourse.processing.org/t/detect-keypress-while-in-a-loop/32850)

<div class="topic-metadata">

**Author:** [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Replies:** 2\
**Last updated:** [October 17, 2021, 6:00pm UTC](https://discourse.processing.org/t/detect-keypress-while-in-a-loop/32850 "2021-10-17T18:00:14Z")

</div>

I am making a program to make music. However the playfunction has the problem, that I can’t interrupt it. So I wanted to implement a key to abort the play function. Here is a example to show the problem. It also has the…

---

## [Shader texture sample wrap on x axis?](https://discourse.processing.org/t/shader-texture-sample-wrap-on-x-axis/32717)

<div class="topic-metadata">

**Author:** [@mercurus](https://discourse.processing.org/u/mercurus)\
**Replies:** 1\
**Last updated:** [October 16, 2021, 11:58pm UTC](https://discourse.processing.org/t/shader-texture-sample-wrap-on-x-axis/32717 "2021-10-16T23:58:08Z")

</div>

I’ve created a shader that computes/draws a Conway’s Game of Life. It takes in an image (CGoL data encoded as pixels), reads the current state, and draws the next state. And it works fine… except that I want the pixels/c…

---

## [Help with complex homework(Solved)](https://discourse.processing.org/t/help-with-complex-homework-solved/32837)

<div class="topic-metadata">

**Author:** [@Onipunch777](https://discourse.processing.org/u/Onipunch777)\
**Replies:** 26\
**Last updated:** [October 16, 2021, 11:23am UTC](https://discourse.processing.org/t/help-with-complex-homework-solved/32837 "2021-10-16T11:23:19Z")

</div>

Hi everyone, I would really appreciate the help trying to figure out this code. I have been working at it for hours and I haven’t gotten any progress on it at all. I hope that you are able to help in any kind of way. T…

---

## [How can I make a Boolean button, where I can click anywhere and an additional overlay will appear on top of my pattern?](https://discourse.processing.org/t/how-can-i-make-a-boolean-button-where-i-can-click-anywhere-and-an-additional-overlay-will-appear-on-top-of-my-pattern/32821)

<div class="topic-metadata">

**Author:** [@Anjiyuuki](https://discourse.processing.org/u/Anjiyuuki)\
**Replies:** 2\
**Last updated:** [October 15, 2021, 6:05pm UTC](https://discourse.processing.org/t/how-can-i-make-a-boolean-button-where-i-can-click-anywhere-and-an-additional-overlay-will-appear-on-top-of-my-pattern/32821 "2021-10-15T18:05:40Z")

</div>

int x= 0; int y= 0; int ov =60; boolean b= true; void setup(){ size(500,500); if (b){ for (x= 0; x\< width; x= x+ov) { for (y=0; y\< height; y=y+ov){ fill(random(255), random(0), random(0),50); ellipse( x,y, ov,…

---

## [How to create a clickable list of files?](https://discourse.processing.org/t/how-to-create-a-clickable-list-of-files/32797)

<div class="topic-metadata">

**Author:** [@bigboss97](https://discourse.processing.org/u/bigboss97)\
**Replies:** 6\
**Last updated:** [October 15, 2021, 3:50am UTC](https://discourse.processing.org/t/how-to-create-a-clickable-list-of-files/32797 "2021-10-15T03:50:19Z")

</div>

I want to allow user to select files from a fixed directory. I don’t want user to navigate to other places. How can I make a list of files where user can tap on a file to select? The list should be dynamic and can be up…

---

## [Guys how to make random rainbow colors in this script](https://discourse.processing.org/t/guys-how-to-make-random-rainbow-colors-in-this-script/32801)

<div class="topic-metadata">

**Author:** [@desciato](https://discourse.processing.org/u/desciato)\
**Replies:** 6\
**Last updated:** [October 14, 2021, 3:00pm UTC](https://discourse.processing.org/t/guys-how-to-make-random-rainbow-colors-in-this-script/32801 "2021-10-14T15:00:16Z")

</div>

Hello Guys can anyone help me how to make random rainbow colors in this script const margin = 25; function setup() { createCanvas(300, 400); noLoop(); strokeWeight(2); } function draw() { background(0); s…

---

## [Is possible to know if my mouse is on an svg?](https://discourse.processing.org/t/is-possible-to-know-if-my-mouse-is-on-an-svg/32825)

<div class="topic-metadata">

**Author:** [@TomLeVeritable](https://discourse.processing.org/u/TomLeVeritable)\
**Replies:** 2\
**Last updated:** [October 14, 2021, 2:48pm UTC](https://discourse.processing.org/t/is-possible-to-know-if-my-mouse-is-on-an-svg/32825 "2021-10-14T14:48:37Z")

</div>

Hello I would just like to know if it is possible to know when the mouse is on an SVG? For example as above is it possible to know when our mouse is over Michigan and when it is over Ohio, And how do we do the detection…

---

## [CS 1335 Processing java script](https://discourse.processing.org/t/cs-1335-processing-java-script/32769)

<div class="topic-metadata">

**Author:** [@amna24688](https://discourse.processing.org/u/amna24688)\
**Replies:** 2\
**Last updated:** [October 12, 2021, 3:52am UTC](https://discourse.processing.org/t/cs-1335-processing-java-script/32769 "2021-10-12T03:52:26Z")

</div>

Write code for the flip tile game; here is how the game is played : Basically there are 2 images… To begin with, one of the 2 images are randomly displayed in each cell of the grid. The user clicks on a cell to toggle…

---

## [I need help to spawn multiple objects at random moments](https://discourse.processing.org/t/i-need-help-to-spawn-multiple-objects-at-random-moments/32796)

<div class="topic-metadata">

**Author:** [@YP1702](https://discourse.processing.org/u/YP1702)\
**Replies:** 3\
**Last updated:** [October 13, 2021, 7:45pm UTC](https://discourse.processing.org/t/i-need-help-to-spawn-multiple-objects-at-random-moments/32796 "2021-10-13T19:45:51Z")

</div>

int grid = 15; Player player; Enemy enemy; float posx; float posy; void setup(){ size(1200,800); player = new Player(); frameRate(20); enemy = new Enemy(); } void draw(){ background(0); player.updat…

---

## [A simple SVG file display incompetely](https://discourse.processing.org/t/a-simple-svg-file-display-incompetely/32771)

<div class="topic-metadata">

**Author:** [@Load](https://discourse.processing.org/u/Load)\
**Replies:** 1\
**Last updated:** [October 12, 2021, 6:11pm UTC](https://discourse.processing.org/t/a-simple-svg-file-display-incompetely/32771 "2021-10-12T18:11:51Z")

</div>

Hello everyone! I am trying to write a simple SVG file which is a rounded rectangle,I use the PShape method to switch the SVG file to a PShape Object. Through the SVG can be displayed by Edge browser,in the Processing…

---

## [How can you avoid the same outcome twice when using random()?](https://discourse.processing.org/t/how-can-you-avoid-the-same-outcome-twice-when-using-random/32760)

<div class="topic-metadata">

**Author:** [@colehodl](https://discourse.processing.org/u/colehodl)\
**Replies:** 1\
**Last updated:** [October 11, 2021, 9:27pm UTC](https://discourse.processing.org/t/how-can-you-avoid-the-same-outcome-twice-when-using-random/32760 "2021-10-11T21:27:12Z")

</div>

So I created a random profile picture generator with a bunch of attributes, basically it creates a random number generator between 1 and 75, and decides which attribute to display based on which number is randomly chosen…

---

## [How can I make some random things less common then others?](https://discourse.processing.org/t/how-can-i-make-some-random-things-less-common-then-others/32747)

<div class="topic-metadata">

**Author:** [@colehodl](https://discourse.processing.org/u/colehodl)\
**Replies:** 4\
**Last updated:** [October 11, 2021, 4:16pm UTC](https://discourse.processing.org/t/how-can-i-make-some-random-things-less-common-then-others/32747 "2021-10-11T16:16:56Z")

</div>

hey! So I’ve been working on a random profile picture generator as an exercise trying to get better with processing. the character consists of 7 random attribute, and I want some attributes to be more common then others…

---

## [Clipping path in .svg file ignored in Processing](https://discourse.processing.org/t/clipping-path-in-svg-file-ignored-in-processing/32450)

<div class="topic-metadata">

**Author:** [@strfry](https://discourse.processing.org/u/strfry)\
**Replies:** 1\
**Last updated:** [October 10, 2021, 9:29pm UTC](https://discourse.processing.org/t/clipping-path-in-svg-file-ignored-in-processing/32450 "2021-10-10T21:29:26Z")

</div>

Hi everyone, I’m having yet another issue with svg files in processing (though I’m making progress). My current problem is that using my .svg file in processing ignores the clipping path. The clipping path does appear i…

---

## [Trig with triangles](https://discourse.processing.org/t/trig-with-triangles/920)

<div class="topic-metadata">

**Author:** [@Gbhinder](https://discourse.processing.org/u/Gbhinder)\
**Replies:** 5\
**Last updated:** [June 14, 2018, 1:38am UTC](https://discourse.processing.org/t/trig-with-triangles/920 "2018-06-14T01:38:39Z")

</div>

Hi, I’m trying to figure out how I would make a triangle rotate 360 degrees around a center point, I have it working for a circle that can spin around a central location at any given radius, but I cannot seem to figure o…

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

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