# Coding Questions

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

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

**Page:** 124

---

## [Changing a child classes characteristics](https://discourse.processing.org/t/changing-a-child-classes-characteristics/14731)

<div class="topic-metadata">

**Author:** [@SLINKYMAN](https://discourse.processing.org/u/SLINKYMAN)\
**Replies:** 3\
**Last updated:** [October 19, 2019, 5:04pm UTC](https://discourse.processing.org/t/changing-a-child-classes-characteristics/14731 "2019-10-19T17:04:08Z")

</div>

I need to use inheritance for a project of mine. Currently, I Have been looking at this example code to create a person. class Human implements Drawable{ int armAngle = 0; int angleChange = 5; final int ANGLE\_L…

---

## [Export SVG problems](https://discourse.processing.org/t/export-svg-problems/14796)

<div class="topic-metadata">

**Author:** [@Malvan](https://discourse.processing.org/u/Malvan)\
**Replies:** 1\
**Last updated:** [October 19, 2019, 11:44am UTC](https://discourse.processing.org/t/export-svg-problems/14796 "2019-10-19T11:44:53Z")

</div>

Hello there! I’m trying to export a frame from an animation from processing with .svg format, because i need that frame in a vector graphic format (because i’d like to print it), but so far i couldnt do it. Every time i …

---

## [End of file, the last end is giving me an error](https://discourse.processing.org/t/end-of-file-the-last-end-is-giving-me-an-error/14789)

<div class="topic-metadata">

**Author:** [@aprilsfooled](https://discourse.processing.org/u/aprilsfooled)\
**Replies:** 1\
**Last updated:** [October 19, 2019, 1:29am UTC](https://discourse.processing.org/t/end-of-file-the-last-end-is-giving-me-an-error/14789 "2019-10-19T01:29:55Z")

</div>

game.Players.PlayerAdded:Connect(function(player) tab\[player.Name\] = true end) local db = true local tab = {} script.Parent.Touched:Connect(function(hit) end) if hit.parent:FindFirstChild("Humanoid") ~= nil the…

---

## [I can't find the error in my code?](https://discourse.processing.org/t/i-cant-find-the-error-in-my-code/14771)

<div class="topic-metadata">

**Author:** [@someguy](https://discourse.processing.org/u/someguy)\
**Replies:** 9\
**Last updated:** [October 18, 2019, 3:20pm UTC](https://discourse.processing.org/t/i-cant-find-the-error-in-my-code/14771 "2019-10-18T15:20:44Z")

</div>

I’m very new to this and I feel stupid but I can’t for the love of me find what the mistake is in this code also I’m not sure how to quote it correctly so sorry! i get “missing ) after argument list” Int aichoice; boo…

---

## [Calling a function for making a string lowercase without predefined function](https://discourse.processing.org/t/calling-a-function-for-making-a-string-lowercase-without-predefined-function/14775)

<div class="topic-metadata">

**Author:** [@marcusshin](https://discourse.processing.org/u/marcusshin)\
**Replies:** 3\
**Last updated:** [October 18, 2019, 11:51am UTC](https://discourse.processing.org/t/calling-a-function-for-making-a-string-lowercase-without-predefined-function/14775 "2019-10-18T11:51:31Z")

</div>

Hello! I am currently stuck in a programming practice question where I am required to call a function for converting all uppercase strings into lowercase without using the toLowercase() predefined function. If you could …

---

## [Generative Art and Transitioning Between Images](https://discourse.processing.org/t/generative-art-and-transitioning-between-images/14769)

<div class="topic-metadata">

**Author:** [@e-sosa](https://discourse.processing.org/u/e-sosa)\
**Replies:** 4\
**Last updated:** [October 17, 2019, 11:28pm UTC](https://discourse.processing.org/t/generative-art-and-transitioning-between-images/14769 "2019-10-17T23:28:52Z")

</div>

Hey everyone! My code below is functional when applied to one image for this self contained particle system. I am wondering how I can transition to different images similarly to this youtube video: https://www.youtube.co…

---

## [Trying rotation angle easing, trouble crossing 0](https://discourse.processing.org/t/trying-rotation-angle-easing-trouble-crossing-0/14735)

<div class="topic-metadata">

**Author:** [@ddownn](https://discourse.processing.org/u/ddownn)\
**Replies:** 4\
**Last updated:** [October 17, 2019, 11:43pm UTC](https://discourse.processing.org/t/trying-rotation-angle-easing-trouble-crossing-0/14735 "2019-10-17T23:43:40Z")

</div>

I am trying to make a draggable clock hand that follows the mouse drag with easing. When dragging CW, after the drag crosses 0, the hand goes CCW to find the mouse, when dragging CCW, the hand will not cross 0. I have t…

---

## [Populate area with circles based on image no overlap](https://discourse.processing.org/t/populate-area-with-circles-based-on-image-no-overlap/14766)

<div class="topic-metadata">

**Author:** [@TimoL](https://discourse.processing.org/u/TimoL)\
**Replies:** 5\
**Last updated:** [October 17, 2019, 9:21pm UTC](https://discourse.processing.org/t/populate-area-with-circles-based-on-image-no-overlap/14766 "2019-10-17T21:21:38Z")

</div>

I’m sure I saw someone with the same question on here not too long ago, but I can’t find it for the life of me. I guess what Im trying to achieve is circle packing but with a more efficient way of filling the space rath…

---

## [Creating SVG only saves a single frame](https://discourse.processing.org/t/creating-svg-only-saves-a-single-frame/14509)

<div class="topic-metadata">

**Author:** [@Marinus](https://discourse.processing.org/u/Marinus)\
**Replies:** 6\
**Last updated:** [October 17, 2019, 8:59pm UTC](https://discourse.processing.org/t/creating-svg-only-saves-a-single-frame/14509 "2019-10-17T20:59:06Z")

</div>

Okay, so I have done the Coding Challenge #93 by Daniel Shiffman yesterday. It is a model to draw a line created by a double pendulum swing. Now I want to plot the result with my DIY pen plotter but I can’t for the life…

---

## [Random ellipses fading in](https://discourse.processing.org/t/random-ellipses-fading-in/14748)

<div class="topic-metadata">

**Author:** [@mellebond](https://discourse.processing.org/u/mellebond)\
**Replies:** 3\
**Last updated:** [October 17, 2019, 1:06pm UTC](https://discourse.processing.org/t/random-ellipses-fading-in/14748 "2019-10-17T13:06:46Z")

</div>

Hi! I’m having troubel combining two codes. I’d like to have ellipses fade in and then dissappear again. Thanks in advance! Code 1; (does the job OK but fades out. void setup() { size(1920,1080); //size(3840,2160…

---

## [Making of: Snake eating fruit](https://discourse.processing.org/t/making-of-snake-eating-fruit/14744)

<div class="topic-metadata">

**Author:** [@ImDaGr3en](https://discourse.processing.org/u/ImDaGr3en)\
**Replies:** 1\
**Last updated:** [October 16, 2019, 10:03pm UTC](https://discourse.processing.org/t/making-of-snake-eating-fruit/14744 "2019-10-16T22:03:25Z")

</div>

Hi everyone, I’m about to finish my Snake mini-game, everything works properly and I cane even say I added some cool features that make the game much better than the classic version! Anyways, I tried to make the Snake o…

---

## [Draw black and white diamonds](https://discourse.processing.org/t/draw-black-and-white-diamonds/4528)

<div class="topic-metadata">

**Author:** [@engg23369](https://discourse.processing.org/u/engg23369)\
**Replies:** 14\
**Last updated:** [October 16, 2019, 3:30pm UTC](https://discourse.processing.org/t/draw-black-and-white-diamonds/4528 "2019-10-16T15:30:25Z")

</div>

“In this section you should write a Processing program that creates a display window of 500 by 500 pixels, then uses a proper control structure to create a collection of many small black and white diamonds with the ind…

---

## [How to specify output size](https://discourse.processing.org/t/how-to-specify-output-size/14711)

<div class="topic-metadata">

**Author:** [@mikemcsharry](https://discourse.processing.org/u/mikemcsharry)\
**Replies:** 8\
**Last updated:** [October 15, 2019, 8:20pm UTC](https://discourse.processing.org/t/how-to-specify-output-size/14711 "2019-10-15T20:20:19Z")

</div>

I’m probably staring at the obvious answer but can’t see it. Down below id the simple code I’ve put together that reads this simple list and then creates a folder based on the contents of the list, in the folder is anot…

---

## [Making of: Snake with classes](https://discourse.processing.org/t/making-of-snake-with-classes/14716)

<div class="topic-metadata">

**Author:** [@ImDaGr3en](https://discourse.processing.org/u/ImDaGr3en)\
**Replies:** 1\
**Last updated:** [October 15, 2019, 3:32pm UTC](https://discourse.processing.org/t/making-of-snake-with-classes/14716 "2019-10-15T15:32:32Z")

</div>

Yeah, it’s me another time! I’m about in making a mimi-game based on the famous Snake, and it works using a lot of different things: I used a class called Snake to make a dynamic array of objects which represents the sn…

---

## [Glitching on purpose?](https://discourse.processing.org/t/glitching-on-purpose/14537)

<div class="topic-metadata">

**Author:** [@loni](https://discourse.processing.org/u/loni)\
**Replies:** 3\
**Last updated:** [October 14, 2019, 6:08pm UTC](https://discourse.processing.org/t/glitching-on-purpose/14537 "2019-10-14T18:08:52Z")

</div>

Does anyone know any common (or uncommon) errors that actually produce a visual (and not just one that makes the sketch unable to open)? I’m trying to collect processing “failure” imagery but I’m not really sure how I ca…

---

## [Cellular Automata based on pixelated images](https://discourse.processing.org/t/cellular-automata-based-on-pixelated-images/14424)

<div class="topic-metadata">

**Author:** [@luonglinhle](https://discourse.processing.org/u/luonglinhle)\
**Replies:** 5\
**Last updated:** [October 14, 2019, 4:43pm UTC](https://discourse.processing.org/t/cellular-automata-based-on-pixelated-images/14424 "2019-10-14T16:43:00Z")

</div>

Dear everyone, I am a newbie to processing. As I proceeds, I am very interested in the thinking of Cellular Automata (part of lesson from The Nature of Code by Daniel Shiffman). I really want to create a version based o…

---

## [Combine overlay graphics in draw](https://discourse.processing.org/t/combine-overlay-graphics-in-draw/14676)

<div class="topic-metadata">

**Author:** [@elcougario](https://discourse.processing.org/u/elcougario)\
**Replies:** 12\
**Last updated:** [October 14, 2019, 4:40pm UTC](https://discourse.processing.org/t/combine-overlay-graphics-in-draw/14676 "2019-10-14T16:40:22Z")

</div>

Hey guys, i’ve been working on this for a while, and I’m having difficulties inserting one of my functions into the loop, without it messing the rest or simply not showing. I just want to put dots over everything, but I …

---

## [Random keeps looping inside for](https://discourse.processing.org/t/random-keeps-looping-inside-for/14692)

<div class="topic-metadata">

**Author:** [@Shayton](https://discourse.processing.org/u/Shayton)\
**Replies:** 1\
**Last updated:** [October 14, 2019, 2:33pm UTC](https://discourse.processing.org/t/random-keeps-looping-inside-for/14692 "2019-10-14T14:33:33Z")

</div>

Hi! I’m making an Atari Breakout like game for a school project, and I’m having a lil problem I want the bricks’ colors be setted randomly p\[\] pelota = new p\[1\]; b\[\] bloques = new b\[100\]; void setup(){ size(900,600…

---

## [Problem with array of objects from a class](https://discourse.processing.org/t/problem-with-array-of-objects-from-a-class/14660)

<div class="topic-metadata">

**Author:** [@ImDaGr3en](https://discourse.processing.org/u/ImDaGr3en)\
**Replies:** 12\
**Last updated:** [October 14, 2019, 1:04pm UTC](https://discourse.processing.org/t/problem-with-array-of-objects-from-a-class/14660 "2019-10-14T13:04:31Z")

</div>

Hi everyone! I found some issue in declaring an array of objects from a class which I wrote in the code. I’m trying to make a Snake-like minigame, and I’m trying to declare an array of objects which should contain its c…

---

## [Just starting to code, and code returns java.lang.reflect.InvocationTargetException error](https://discourse.processing.org/t/just-starting-to-code-and-code-returns-java-lang-reflect-invocationtargetexception-error/14615)

<div class="topic-metadata">

**Author:** [@Truncation](https://discourse.processing.org/u/Truncation)\
**Replies:** 4\
**Last updated:** [October 14, 2019, 1:01pm UTC](https://discourse.processing.org/t/just-starting-to-code-and-code-returns-java-lang-reflect-invocationtargetexception-error/14615 "2019-10-14T13:01:17Z")

</div>

Just starting to do an elemental version of 2048, as a practice on recreations on other popular games. After coding the function structure and screen appearance, this error comes out of nowhere upon startup. The sketch…

---

## [Creating A Toolbar & Canvas Sketch](https://discourse.processing.org/t/creating-a-toolbar-canvas-sketch/14645)

<div class="topic-metadata">

**Author:** [@las6525](https://discourse.processing.org/u/las6525)\
**Replies:** 18\
**Last updated:** [October 14, 2019, 2:26am UTC](https://discourse.processing.org/t/creating-a-toolbar-canvas-sketch/14645 "2019-10-14T02:26:00Z")

</div>

Hi All, I need help, my code is way off. What is the best way to format a sketch that uses the constrain() function to divide the window into two parts; one being a toolbar and the other being a canvas? I need to limit …

---

## [Rotating a spiral using Framerate](https://discourse.processing.org/t/rotating-a-spiral-using-framerate/14675)

<div class="topic-metadata">

**Author:** [@fhop](https://discourse.processing.org/u/fhop)\
**Replies:** 1\
**Last updated:** [October 14, 2019, 12:28am UTC](https://discourse.processing.org/t/rotating-a-spiral-using-framerate/14675 "2019-10-14T00:28:48Z")

</div>

Hi all! I was wanting to rotate this spiral (made of ellipses) using framerate or some other means so the whole image slowly rotates. Any help or direction towards tutorials, similar questions etc would be helpful! Th…

---

## [Finding the closest neighbour between PVector objects in an array](https://discourse.processing.org/t/finding-the-closest-neighbour-between-pvector-objects-in-an-array/14655)

<div class="topic-metadata">

**Author:** [@johnsmith17](https://discourse.processing.org/u/johnsmith17)\
**Replies:** 3\
**Last updated:** [October 13, 2019, 4:50pm UTC](https://discourse.processing.org/t/finding-the-closest-neighbour-between-pvector-objects-in-an-array/14655 "2019-10-13T16:50:57Z")

</div>

Hi ive created an array which holds PVectors of points on a sketch, when mouse is pressed a point is created at mouseX and mouseY. im trying to connect each point to its closest neigbour in order to make a planar graph w…

---

## [Using width outside main file](https://discourse.processing.org/t/using-width-outside-main-file/14659)

<div class="topic-metadata">

**Author:** [@dVaGaymer](https://discourse.processing.org/u/dVaGaymer)\
**Replies:** 2\
**Last updated:** [October 13, 2019, 4:23pm UTC](https://discourse.processing.org/t/using-width-outside-main-file/14659 "2019-10-13T16:23:46Z")

</div>

I’m starting here, trying to program a simple pong, but there is a problem when I change the value of initial Player object position. I want to give the object (a racket) an initial position based on the window’s size, …

---

## [Where is this stroke coming from?](https://discourse.processing.org/t/where-is-this-stroke-coming-from/14545)

<div class="topic-metadata">

**Author:** [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Replies:** 5\
**Last updated:** [October 13, 2019, 9:13am UTC](https://discourse.processing.org/t/where-is-this-stroke-coming-from/14545 "2019-10-13T09:13:23Z")

</div>

I get a strange grey stroke when drawing, where is it coming from? PGraphics pg; void setup() { size(800, 600, P2D); pg = createGraphics(width, height, P2D); pg.beginDraw(); pg.background(255); pg.endDraw(…

---

## [How to expand this grid of 9 cropped images so it works for 900?](https://discourse.processing.org/t/how-to-expand-this-grid-of-9-cropped-images-so-it-works-for-900/14622)

<div class="topic-metadata">

**Author:** [@rebecca](https://discourse.processing.org/u/rebecca)\
**Replies:** 3\
**Last updated:** [October 12, 2019, 8:48pm UTC](https://discourse.processing.org/t/how-to-expand-this-grid-of-9-cropped-images-so-it-works-for-900/14622 "2019-10-12T20:48:26Z")

</div>

Hi, I’m very new to coding/processing and would love help with simplifying my code so that it can be expanded easily. Right now I have a grid of 9 images that are stacked on top of each other and then “cropped” using the…

---

## [Perlin Noise on a Sphere](https://discourse.processing.org/t/perlin-noise-on-a-sphere/1121)

<div class="topic-metadata">

**Author:** [@UtrimiqueTrebus12](https://discourse.processing.org/u/UtrimiqueTrebus12)\
**Replies:** 2\
**Last updated:** [June 21, 2018, 3:28pm UTC](https://discourse.processing.org/t/perlin-noise-on-a-sphere/1121 "2018-06-21T15:28:58Z")

</div>

I would need some help to apply a perlin noise correctly to a sphere. Here is my code. import peasy.\*; int resolution = 100; float r = 500; float lat,lon; float xoff,yoff; PVector\[\]\[\] globularLandscape; float rangeMin …

---

## [Draw line on image?](https://discourse.processing.org/t/draw-line-on-image/14587)

<div class="topic-metadata">

**Author:** [@darinb](https://discourse.processing.org/u/darinb)\
**Replies:** 12\
**Last updated:** [October 11, 2019, 9:37pm UTC](https://discourse.processing.org/t/draw-line-on-image/14587 "2019-10-11T21:37:53Z")

</div>

This maybe be the most newbie question of the day. :slight\_smile: The boiled down version: I want to display a photograph. Before I display it I want to draw a line, top to bottom, through the image. The line won’t be c…

---

## [Rotating vectors around the Y-axis](https://discourse.processing.org/t/rotating-vectors-around-the-y-axis/14613)

<div class="topic-metadata">

**Author:** [@solub](https://discourse.processing.org/u/solub)\
**Replies:** 1\
**Last updated:** [October 11, 2019, 4:58pm UTC](https://discourse.processing.org/t/rotating-vectors-around-the-y-axis/14613 "2019-10-11T16:58:00Z")

</div>

Dear all, I would need your help to compute the vectors of a 3D curl field. In 2D I used to: create a vector field in 2D place a bunch of points randomly in that field have the vectors pointing to their closest point …

---

## [Interactive Light up Grid Game](https://discourse.processing.org/t/interactive-light-up-grid-game/14606)

<div class="topic-metadata">

**Author:** [@JPG](https://discourse.processing.org/u/JPG)\
**Replies:** 4\
**Last updated:** [October 11, 2019, 3:14pm UTC](https://discourse.processing.org/t/interactive-light-up-grid-game/14606 "2019-10-11T15:14:27Z")

</div>

Hi everyone, The outline of the project is we create a simple 3 x 3 grid of boxes. Then what I want to achieve is a random box will light up and you have to put the mouse in that box. Then another box will light up and …

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

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