# Coding Questions

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

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

**Page:** 84

---

## [First little game, feedback welcome](https://discourse.processing.org/t/first-little-game-feedback-welcome/22279)

<div class="topic-metadata">

**Author:** [@klap](https://discourse.processing.org/u/klap)\
**Replies:** 5\
**Last updated:** [August 13, 2020, 4:20pm UTC](https://discourse.processing.org/t/first-little-game-feedback-welcome/22279 "2020-08-13T16:20:48Z")

</div>

Hi, Here is a first small game I coded, just to start learning processing. I’m actually looking for feedback now on the code and on how to improve my coding style. It’s now been done with a ‘let’s-see-if-we-can-get-it-w…

---

## [Code to change the direction of the ball not working](https://discourse.processing.org/t/code-to-change-the-direction-of-the-ball-not-working/22549)

<div class="topic-metadata">

**Author:** [@BackTo](https://discourse.processing.org/u/BackTo)\
**Replies:** 9\
**Last updated:** [August 13, 2020, 12:51pm UTC](https://discourse.processing.org/t/code-to-change-the-direction-of-the-ball-not-working/22549 "2020-08-13T12:51:13Z")

</div>

Hi, I’ve got a plan for a silly bouncing ball sketch. I worked out the timer, but now my ball will not rebound of the edge off the screen. It either goes clean off, or at best gets stuck i the corner. I have used the sam…

---

## [Need some help with this program idea | i'm a beginner!](https://discourse.processing.org/t/need-some-help-with-this-program-idea-im-a-beginner/22793)

<div class="topic-metadata">

**Author:** [@coding\_beginner](https://discourse.processing.org/u/coding_beginner)\
**Replies:** 10\
**Last updated:** [August 13, 2020, 11:59am UTC](https://discourse.processing.org/t/need-some-help-with-this-program-idea-im-a-beginner/22793 "2020-08-13T11:59:17Z")

</div>

Hello, i’m a new user and a processing beginner, i’m writing a program and i need some help! My program idea is this: I draw a square (for now, more than one can be difficult -for me-), when i click on it i select the …

---

## [Trouble exporting 3D animation to SVG](https://discourse.processing.org/t/trouble-exporting-3d-animation-to-svg/23192)

<div class="topic-metadata">

**Author:** [@Lucianoinfanti](https://discourse.processing.org/u/Lucianoinfanti)\
**Replies:** 4\
**Last updated:** [August 12, 2020, 3:52am UTC](https://discourse.processing.org/t/trouble-exporting-3d-animation-to-svg/23192 "2020-08-12T03:52:19Z")

</div>

Hey, everyone. I’m just starting with coding and Processing, in particular. I’ve watched this great tutorial on how to make this nice 3D animation and I tried it myself. Everything worked great but I wanted to export th…

---

## [Full color spectrum](https://discourse.processing.org/t/full-color-spectrum/23171)

<div class="topic-metadata">

**Author:** [@qewer3322](https://discourse.processing.org/u/qewer3322)\
**Replies:** 2\
**Last updated:** [August 11, 2020, 7:01am UTC](https://discourse.processing.org/t/full-color-spectrum/23171 "2020-08-11T07:01:52Z")

</div>

So I’m experimenting with color pickers for my projects and so far I managed to make RGB sliders and an HSB color picker (pretty happy with this one). Im pleased with both of these but another thing I want to do is a col…

---

## [Animated grid loop](https://discourse.processing.org/t/animated-grid-loop/23154)

<div class="topic-metadata">

**Author:** [@brunobot](https://discourse.processing.org/u/brunobot)\
**Replies:** 5\
**Last updated:** [August 10, 2020, 4:33pm UTC](https://discourse.processing.org/t/animated-grid-loop/23154 "2020-08-10T16:33:20Z")

</div>

Hello! I’m new to Processing. Love it but some of the thinking is giving me a hard time. I’m trying to recreate this kind of visual effect here: I thought I could recreate this by creating a stripe of different co…

---

## [Basic graphing calculator makes strange lines inconsistently](https://discourse.processing.org/t/basic-graphing-calculator-makes-strange-lines-inconsistently/23123)

<div class="topic-metadata">

**Author:** [@Crysp](https://discourse.processing.org/u/Crysp)\
**Replies:** 7\
**Last updated:** [August 9, 2020, 9:55pm UTC](https://discourse.processing.org/t/basic-graphing-calculator-makes-strange-lines-inconsistently/23123 "2020-08-09T21:55:13Z")

</div>

Hi all, So I made this really basic graphing calculator that draws the form of whatever equation you give it (ex. it can draw a cubic function with axis lines). It almost works perfectly and exactly how I wanted, except…

---

## [Modifying a game: score, random, display](https://discourse.processing.org/t/modifying-a-game-score-random-display/22785)

<div class="topic-metadata">

**Author:** [@greenArtist7](https://discourse.processing.org/u/greenArtist7)\
**Replies:** 23\
**Last updated:** [August 8, 2020, 10:55pm UTC](https://discourse.processing.org/t/modifying-a-game-score-random-display/22785 "2020-08-08T22:55:28Z")

</div>

Hello, I’m currently taking a ‘Learning Processing’ course and I need some help with a game I’m trying to create. It is a 2 person game (Player 1 controls the keyboard, Player 2 controls the mouse). It is a take on the …

---

## [How can I make a color for the flower inside](https://discourse.processing.org/t/how-can-i-make-a-color-for-the-flower-inside/23127)

<div class="topic-metadata">

**Author:** [@Intissar](https://discourse.processing.org/u/Intissar)\
**Replies:** 2\
**Last updated:** [August 8, 2020, 8:33am UTC](https://discourse.processing.org/t/how-can-i-make-a-color-for-the-flower-inside/23127 "2020-08-08T08:33:42Z")

</div>

float xCenter = 600 /2; float yCenter = 600 /2; float scale = 200; float\[\] innerX; // store xPoints for the 6 points on the inner circle float\[\] innerY; // store yPoints for the 6 points on the inner circle float\[\] ou…

---

## [Trying to fill a shape with a pixel colour from a loaded image](https://discourse.processing.org/t/trying-to-fill-a-shape-with-a-pixel-colour-from-a-loaded-image/22996)

<div class="topic-metadata">

**Author:** [@jesspayne](https://discourse.processing.org/u/jesspayne)\
**Replies:** 7\
**Last updated:** [August 8, 2020, 4:53pm UTC](https://discourse.processing.org/t/trying-to-fill-a-shape-with-a-pixel-colour-from-a-loaded-image/22996 "2020-08-08T16:53:47Z")

</div>

Hi! Firstly please excuse my newbie question! Could anyone point me in the right direction please? I am trying to source a random pixel colour from a loaded image and load it in to a shape. I have spent a few hours look…

---

## [Running an External Program Within Processing + Overlay Images & Text](https://discourse.processing.org/t/running-an-external-program-within-processing-overlay-images-text/23118)

<div class="topic-metadata">

**Author:** [@YellowGTM](https://discourse.processing.org/u/YellowGTM)\
**Replies:** 5\
**Last updated:** [August 7, 2020, 7:56pm UTC](https://discourse.processing.org/t/running-an-external-program-within-processing-overlay-images-text/23118 "2020-08-07T19:56:13Z")

</div>

I’m reading and searching on JFrame, etc. Everyone seems to have a different application than what I’m searching. I’d like to run a 3rd party software within my Processing exe, and allow images and text to be placed o…

---

## [Launch() with additional Parameters](https://discourse.processing.org/t/launch-with-additional-parameters/23114)

<div class="topic-metadata">

**Author:** [@YellowGTM](https://discourse.processing.org/u/YellowGTM)\
**Replies:** 1\
**Last updated:** [August 7, 2020, 6:37pm UTC](https://discourse.processing.org/t/launch-with-additional-parameters/23114 "2020-08-07T18:37:41Z")

</div>

Is Processing able to handle Launch strings with added parameters such as the example below? This is a path copied from a program shortcut: “C:\\Program Files (x86)\\Navigator19\\PC\_Navigator\\PC\_Navigator.exe” --atlas=‘C:…

---

## [Random Number Generation without Repetition](https://discourse.processing.org/t/random-number-generation-without-repetition/4767)

<div class="topic-metadata">

**Author:** [@danielo](https://discourse.processing.org/u/danielo)\
**Replies:** 4\
**Last updated:** [August 7, 2020, 3:21pm UTC](https://discourse.processing.org/t/random-number-generation-without-repetition/4767 "2020-08-07T15:21:51Z")

</div>

I am trying to generate random numbers of a specified range (0-35, for example) without generating any number twice until all numbers have been generated once. Thank you for any guidance. Regards, Daniel

---

## [IndexOutOfBoundsException for Virtual Ecosystem](https://discourse.processing.org/t/indexoutofboundsexception-for-virtual-ecosystem/23081)

<div class="topic-metadata">

**Author:** [@LordCacops](https://discourse.processing.org/u/LordCacops)\
**Replies:** 3\
**Last updated:** [August 6, 2020, 3:02pm UTC](https://discourse.processing.org/t/indexoutofboundsexception-for-virtual-ecosystem/23081 "2020-08-06T15:02:29Z")

</div>

Hello. I am having trouble with a program, where there is a likelihood of it crashing due to an IndexOutOfBoundsException error from an arrayList. It is an ecosystem program that creates “animal objects” and adds them t…

---

## [Low frameRate, my code gives 10 - 15 frames](https://discourse.processing.org/t/low-framerate-my-code-gives-10-15-frames/23053)

<div class="topic-metadata">

**Author:** [@yhlaskerimov](https://discourse.processing.org/u/yhlaskerimov)\
**Replies:** 10\
**Last updated:** [August 6, 2020, 6:42am UTC](https://discourse.processing.org/t/low-framerate-my-code-gives-10-15-frames/23053 "2020-08-06T06:42:23Z")

</div>

Hello everyone. My code doesnt give me 30 frameRate even i dont do much thing there ! Help me please, thanks. String s = "belli"; PFont font; int tileCount = 25; float tileWidth, tileHeight; void setup() { size(800,…

---

## [Having trouble with making the Snake game](https://discourse.processing.org/t/having-trouble-with-making-the-snake-game/23064)

<div class="topic-metadata">

**Author:** [@i\_dont](https://discourse.processing.org/u/i_dont)\
**Replies:** 2\
**Last updated:** [August 6, 2020, 12:52am UTC](https://discourse.processing.org/t/having-trouble-with-making-the-snake-game/23064 "2020-08-06T00:52:00Z")

</div>

Hey this is my first time posting anything here or asking for help but I’m kinda stumped. I coded the game “Snake” and despite being very basic as I’m a beginner, it turned out pretty alright. The only real problem I’m h…

---

## [Understanding the Diffusion Curves Algorithm](https://discourse.processing.org/t/understanding-the-diffusion-curves-algorithm/21605)

<div class="topic-metadata">

**Author:** [@micycle](https://discourse.processing.org/u/micycle)\
**Replies:** 13\
**Last updated:** [August 4, 2020, 4:53pm UTC](https://discourse.processing.org/t/understanding-the-diffusion-curves-algorithm/21605 "2020-08-04T16:53:49Z")

</div>

Paper outcome above. I’m not going anything this complicated (beziers) yet, but just a simple working prototype of the diffusion part. The broad idea with Diffusion Curves is you specify some pixels in a canvas (su…

---

## [Creating collision](https://discourse.processing.org/t/creating-collision/23029)

<div class="topic-metadata">

**Author:** [@DeidaraLP](https://discourse.processing.org/u/DeidaraLP)\
**Replies:** 4\
**Last updated:** [August 4, 2020, 4:13pm UTC](https://discourse.processing.org/t/creating-collision/23029 "2020-08-04T16:13:36Z")

</div>

Hello /sub I’ve been trying to create a simple game based on different classes. However, i’m currently at a dead end, since i’m trying to create a collision detector between the player class and the asteroid class. How…

---

## [How to access SVG/PShape original width & height?](https://discourse.processing.org/t/how-to-access-svg-pshape-original-width-height/23027)

<div class="topic-metadata">

**Author:** [@Ruchi](https://discourse.processing.org/u/Ruchi)\
**Replies:** 0\
**Last updated:** [August 4, 2020, 7:40am UTC](https://discourse.processing.org/t/how-to-access-svg-pshape-original-width-height/23027 "2020-08-04T07:40:53Z")

</div>

import processing.svg.\*; float reso; void setup() { size(800, 800); reso = width; beginRecord(SVG,"a.svg"); } void draw() { background(0); PVector center = new PVector(reso/2,reso-5); //float center = re…

---

## [Creating an array of vectors in a line](https://discourse.processing.org/t/creating-an-array-of-vectors-in-a-line/22959)

<div class="topic-metadata">

**Author:** [@MelonMan](https://discourse.processing.org/u/MelonMan)\
**Replies:** 9\
**Last updated:** [August 4, 2020, 6:06am UTC](https://discourse.processing.org/t/creating-an-array-of-vectors-in-a-line/22959 "2020-08-04T06:06:54Z")

</div>

Hello! I’m new here, hopefully this is the right place to ask. I have an odd problem I’m trying to resolve. attempting to curve off a tutorial and turn the project into something of my own. The problem being; I have a …

---

## [Double hit on object collision and repeat trigger](https://discourse.processing.org/t/double-hit-on-object-collision-and-repeat-trigger/22970)

<div class="topic-metadata">

**Author:** [@chuchu](https://discourse.processing.org/u/chuchu)\
**Replies:** 2\
**Last updated:** [August 3, 2020, 9:41pm UTC](https://discourse.processing.org/t/double-hit-on-object-collision-and-repeat-trigger/22970 "2020-08-03T21:41:13Z")

</div>

Hello processing forum :slight\_smile: I’m making a small program that moves circles (‘buoys’) around the screen that are then triggered by expanding circles (‘waves’) in turn making more waves of their own. Waves have r…

---

## [Images Rotate Themselves](https://discourse.processing.org/t/images-rotate-themselves/23015)

<div class="topic-metadata">

**Author:** [@AngryPig](https://discourse.processing.org/u/AngryPig)\
**Replies:** 2\
**Last updated:** [August 3, 2020, 3:47pm UTC](https://discourse.processing.org/t/images-rotate-themselves/23015 "2020-08-03T15:47:09Z")

</div>

I was working on a larger project and noticed that every time I try import a photo that I rotated in Windows, it rotates it back. I have made a basic example with the same photo to test it and it still occurs. Does anyon…

---

## [Agnostic Transparencies](https://discourse.processing.org/t/agnostic-transparencies/22997)

<div class="topic-metadata">

**Author:** [@Aleksi](https://discourse.processing.org/u/Aleksi)\
**Replies:** 3\
**Last updated:** [August 2, 2020, 9:06pm UTC](https://discourse.processing.org/t/agnostic-transparencies/22997 "2020-08-02T21:06:43Z")

</div>

Hi there. Is there any way to draw transparent objects that allow them to stay transparent no matter which order they’re drawn? Here’s a gif demonstrating how the order in which they’re drawn affects an object’s transpa…

---

## [How do you choose what class you add to a list with a variable?](https://discourse.processing.org/t/how-do-you-choose-what-class-you-add-to-a-list-with-a-variable/22987)

<div class="topic-metadata">

**Author:** [@no\_spaces](https://discourse.processing.org/u/no_spaces)\
**Replies:** 4\
**Last updated:** [August 2, 2020, 8:36pm UTC](https://discourse.processing.org/t/how-do-you-choose-what-class-you-add-to-a-list-with-a-variable/22987 "2020-08-02T20:36:48Z")

</div>

So I want to do something like this, where you add a new instance of a class determined by a variable (trust me, I have a good reason for this, but I can’t tell…) Class type; dummy1 list\[\] = new dummy1\[3\]; void setup()…

---

## [Get User Input and Save It](https://discourse.processing.org/t/get-user-input-and-save-it/22935)

<div class="topic-metadata">

**Author:** [@greenArtist7](https://discourse.processing.org/u/greenArtist7)\
**Replies:** 11\
**Last updated:** [August 2, 2020, 11:10am UTC](https://discourse.processing.org/t/get-user-input-and-save-it/22935 "2020-08-02T11:10:53Z")

</div>

Hello, I need to create an app using processing for a homework assignment. I’m thinking about an app that requires the user to input text information, and use that to randomize a selection. What would be the best way fo…

---

## [Changing strokeweight / radius when mousePressed](https://discourse.processing.org/t/changing-strokeweight-radius-when-mousepressed/22871)

<div class="topic-metadata">

**Author:** [@karate29](https://discourse.processing.org/u/karate29)\
**Replies:** 13\
**Last updated:** [August 2, 2020, 12:40pm UTC](https://discourse.processing.org/t/changing-strokeweight-radius-when-mousepressed/22871 "2020-08-02T12:40:32Z")

</div>

I am trying to create a free hand drawing program. I already made the colors and when you press them it changes the color and you can draw with the selected color. The problem I am coming across is I want the user to be …

---

## [Storing points to create gradient of shapes](https://discourse.processing.org/t/storing-points-to-create-gradient-of-shapes/21635)

<div class="topic-metadata">

**Author:** [@mrbro](https://discourse.processing.org/u/mrbro)\
**Replies:** 8\
**Last updated:** [August 2, 2020, 9:14am UTC](https://discourse.processing.org/t/storing-points-to-create-gradient-of-shapes/21635 "2020-08-02T09:14:18Z")

</div>

Hi There! So I am trying to create a smooth gradation of polygons using storing. I need to dynamically change the amount of points and store them to fade consequently. However, the code changes all the polygons at t…

---

## [Removing objects from ArrayList doesnt work after index higher than 0](https://discourse.processing.org/t/removing-objects-from-arraylist-doesnt-work-after-index-higher-than-0/22930)

<div class="topic-metadata">

**Author:** [@Bastilling](https://discourse.processing.org/u/Bastilling)\
**Replies:** 5\
**Last updated:** [July 31, 2020, 3:26pm UTC](https://discourse.processing.org/t/removing-objects-from-arraylist-doesnt-work-after-index-higher-than-0/22930 "2020-07-31T15:26:45Z")

</div>

Hey! I have been using Processing recently to create small games just for fun since I am stuck at home a lot due to the Covid 19 Situation. So this is my first time posting on the forum because I ran into a problem this…

---

## [How do I maximize the sketch window?](https://discourse.processing.org/t/how-do-i-maximize-the-sketch-window/11620)

<div class="topic-metadata">

**Author:** [@notcatfish2017](https://discourse.processing.org/u/notcatfish2017)\
**Replies:** 12\
**Last updated:** [July 31, 2020, 4:00am UTC](https://discourse.processing.org/t/how-do-i-maximize-the-sketch-window/11620 "2020-07-31T04:00:11Z")

</div>

Hi, How do I maximize the sketch window? (not fullscreen) Thanks!

---

## [Is P3D inherently slow and/or is there a fast alternative?](https://discourse.processing.org/t/is-p3d-inherently-slow-and-or-is-there-a-fast-alternative/22889)

<div class="topic-metadata">

**Author:** [@capbap](https://discourse.processing.org/u/capbap)\
**Replies:** 7\
**Last updated:** [July 30, 2020, 9:25pm UTC](https://discourse.processing.org/t/is-p3d-inherently-slow-and-or-is-there-a-fast-alternative/22889 "2020-07-30T21:25:17Z")

</div>

I started making a simple 3d game in processing using P3D, but it lags severely when drawing more than about 5,000 textured rectangles. Here is the code that I am using to draw the rectangles. void disp(PImage img) { …

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

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