# Coding Questions

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

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

**Page:** 73

---

## [How to get the color value of an image, not that of what's drawn on the background](https://discourse.processing.org/t/how-to-get-the-color-value-of-an-image-not-that-of-whats-drawn-on-the-background/25642)

<div class="topic-metadata">

**Author:** [@papaboo](https://discourse.processing.org/u/papaboo)\
**Replies:** 1\
**Last updated:** [November 23, 2020, 7:53pm UTC](https://discourse.processing.org/t/how-to-get-the-color-value-of-an-image-not-that-of-whats-drawn-on-the-background/25642 "2020-11-23T19:53:16Z")

</div>

In this example, (no image, I’ve just used a background colour to demonstrate) the background colour value is 25 but when there’s a brush that overlays the background, mouseX and mouseY returns the value of what’s drawn …

---

## [Pixel sorting in processing 3.4](https://discourse.processing.org/t/pixel-sorting-in-processing-3-4/7479)

<div class="topic-metadata">

**Author:** [@thrm](https://discourse.processing.org/u/thrm)\
**Replies:** 6\
**Last updated:** [November 23, 2020, 5:08pm UTC](https://discourse.processing.org/t/pixel-sorting-in-processing-3-4/7479 "2020-11-23T17:08:25Z")

</div>

Hi I have a somewhat simple question (I think). Hope someone is able to help. I’m doing a project where I need to sort the pixels of an image by different parameters. As I’m very new to processing and self-learning I’m…

---

## [How to set random colors](https://discourse.processing.org/t/how-to-set-random-colors/25627)

<div class="topic-metadata">

**Author:** [@Ipboro](https://discourse.processing.org/u/Ipboro)\
**Replies:** 7\
**Last updated:** [November 23, 2020, 1:46pm UTC](https://discourse.processing.org/t/how-to-set-random-colors/25627 "2020-11-23T13:46:25Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hello, So I was wondering how can I (or if i can) randomize the colors in the set of code. This is my code for now, it is basiclly parametric l…

---

## [How to create a simple timer?](https://discourse.processing.org/t/how-to-create-a-simple-timer/3901)

<div class="topic-metadata">

**Author:** [@Schred](https://discourse.processing.org/u/Schred)\
**Replies:** 15\
**Last updated:** [November 23, 2020, 7:20am UTC](https://discourse.processing.org/t/how-to-create-a-simple-timer/3901 "2020-11-23T07:20:59Z")

</div>

Hello, I think this is a rather simple question, but how do I create a timer(or something like that), that tells the programm to do thing 1, and then, after half a second, do thing 2? I tried using the frameRate() comma…

---

## [Having trouble slowing my screen display](https://discourse.processing.org/t/having-trouble-slowing-my-screen-display/25453)

<div class="topic-metadata">

**Author:** [@luigipasto](https://discourse.processing.org/u/luigipasto)\
**Replies:** 15\
**Last updated:** [November 22, 2020, 10:52pm UTC](https://discourse.processing.org/t/having-trouble-slowing-my-screen-display/25453 "2020-11-22T22:52:17Z")

</div>

Hi, this is my first attempt at writing code. The goal seemed quite modest but I’m getting bogged down. I’m reading tabular data from a csv file, and writing to the screen one row of the table at the time. What I’d like …

---

## [Formula to calculate vector components proportional to distance (hairy circle)](https://discourse.processing.org/t/formula-to-calculate-vector-components-proportional-to-distance-hairy-circle/25613)

<div class="topic-metadata">

**Author:** [@fiveyearplan](https://discourse.processing.org/u/fiveyearplan)\
**Replies:** 0\
**Last updated:** [November 22, 2020, 6:00pm UTC](https://discourse.processing.org/t/formula-to-calculate-vector-components-proportional-to-distance-hairy-circle/25613 "2020-11-22T18:00:56Z")

</div>

Following my previous thread, what I need to find is a formula that calculates the vector components according to its distance from the centre of the circle. Looking at the image above, you see that the hairs move in …

---

## [Independently translate and rotate](https://discourse.processing.org/t/independently-translate-and-rotate/25606)

<div class="topic-metadata">

**Author:** [@Ginopalombi](https://discourse.processing.org/u/Ginopalombi)\
**Replies:** 2\
**Last updated:** [November 22, 2020, 2:39pm UTC](https://discourse.processing.org/t/independently-translate-and-rotate/25606 "2020-11-22T14:39:05Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hi, how can I translate and rotate object independetly? I don’t want to translate the object after a translated object…

---

## [How to make an object disappear on collision](https://discourse.processing.org/t/how-to-make-an-object-disappear-on-collision/25593)

<div class="topic-metadata">

**Author:** [@TheGullible1](https://discourse.processing.org/u/TheGullible1)\
**Replies:** 21\
**Last updated:** [November 21, 2020, 10:04pm UTC](https://discourse.processing.org/t/how-to-make-an-object-disappear-on-collision/25593 "2020-11-21T22:04:17Z")

</div>

i have a very simple code as I’m tryna learn collision detection as I want to use it in the future. //Falling Game Faller player; //declare instance variable Obstacle thing; void setup() { size(400, 600); player…

---

## [Encryption of username pipeline](https://discourse.processing.org/t/encryption-of-username-pipeline/25541)

<div class="topic-metadata">

**Author:** [@papaboo](https://discourse.processing.org/u/papaboo)\
**Replies:** 3\
**Last updated:** [November 21, 2020, 6:32pm UTC](https://discourse.processing.org/t/encryption-of-username-pipeline/25541 "2020-11-21T18:32:20Z")

</div>

Here’s the scheme for a desktop app that works only when the user is online, registered and has an active license. So basically, what I want to achieve is, when a user clicks the log-in button in the sketch window, I’d …

---

## [Letting a loop run forth and back](https://discourse.processing.org/t/letting-a-loop-run-forth-and-back/25552)

<div class="topic-metadata">

**Author:** [@serg](https://discourse.processing.org/u/serg)\
**Replies:** 2\
**Last updated:** [November 21, 2020, 5:40pm UTC](https://discourse.processing.org/t/letting-a-loop-run-forth-and-back/25552 "2020-11-21T17:40:27Z")

</div>

Currently I am trying to get a loop “running forth and back” in a Processing sketch. I can do it with mouseY for example – but I want to have it automatically: the rect(); should appear horizontally line by line… like 1…

---

## [Problem with alpha channel - editing photos and use parts to multiply](https://discourse.processing.org/t/problem-with-alpha-channel-editing-photos-and-use-parts-to-multiply/25574)

<div class="topic-metadata">

**Author:** [@Kylle](https://discourse.processing.org/u/Kylle)\
**Replies:** 11\
**Last updated:** [November 21, 2020, 12:25pm UTC](https://discourse.processing.org/t/problem-with-alpha-channel-editing-photos-and-use-parts-to-multiply/25574 "2020-11-21T12:25:45Z")

</div>

Hi I am quite new and rather unexperienced with Processing. I am trying to pick out a picture of a maple leaf from a photo and create a new image without the grass background in order to multiply the leaf image in a new…

---

## [How do I move this train?](https://discourse.processing.org/t/how-do-i-move-this-train/25560)

<div class="topic-metadata">

**Author:** [@Crimson-The-Saiyan](https://discourse.processing.org/u/Crimson-The-Saiyan)\
**Replies:** 9\
**Last updated:** [November 21, 2020, 12:03pm UTC](https://discourse.processing.org/t/how-do-i-move-this-train/25560 "2020-11-21T12:03:46Z")

</div>

Ok, so basically, I’m a begginer to Processing, I’m trying to make a train move for a school project, but I don’t know how, can anyone help me? Code: //Setting up the background void setup(){ size(1000,1000); } voi…

---

## [Comment inserer et visualiser une image?](https://discourse.processing.org/t/comment-inserer-et-visualiser-une-image/25582)

<div class="topic-metadata">

**Author:** [@nina](https://discourse.processing.org/u/nina)\
**Replies:** 1\
**Last updated:** [November 21, 2020, 1:32am UTC](https://discourse.processing.org/t/comment-inserer-et-visualiser-une-image/25582 "2020-11-21T01:32:20Z")

</div>

Bonjour à tous, Je voudrais savoir comment insérer et visualiser une image sur processing ? S’il vous plait pouvez vous m’aider . Je vous remercie d’avance. Cordialement, Nina

---

## [IOException in ProcessBuilder.start method during compile](https://discourse.processing.org/t/ioexception-in-processbuilder-start-method-during-compile/25578)

<div class="topic-metadata">

**Author:** [@srwlive](https://discourse.processing.org/u/srwlive)\
**Replies:** 1\
**Last updated:** [November 20, 2020, 8:21pm UTC](https://discourse.processing.org/t/ioexception-in-processbuilder-start-method-during-compile/25578 "2020-11-20T20:21:50Z")

</div>

Process runProgram(List\<String\> args) { ProcessBuilder pb = new ProcessBuilder(args); return pb.start(); } When I try to compile and run with processi…

---

## [How to make clone stamp tool as the photoshop?](https://discourse.processing.org/t/how-to-make-clone-stamp-tool-as-the-photoshop/25547)

<div class="topic-metadata">

**Author:** [@datacolor](https://discourse.processing.org/u/datacolor)\
**Replies:** 1\
**Last updated:** [November 20, 2020, 6:01am UTC](https://discourse.processing.org/t/how-to-make-clone-stamp-tool-as-the-photoshop/25547 "2020-11-20T06:01:23Z")

</div>

please format code with \</\> button \* homework policy \* asking questions The idea is with mouse pointer(as photoshop) clone pixel or pixels from the PImage1 to PImage2,please!!

---

## [Please help on copying pixels between two PImage](https://discourse.processing.org/t/please-help-on-copying-pixels-between-two-pimage/24350)

<div class="topic-metadata">

**Author:** [@datacolor](https://discourse.processing.org/u/datacolor)\
**Replies:** 4\
**Last updated:** [November 19, 2020, 11:58pm UTC](https://discourse.processing.org/t/please-help-on-copying-pixels-between-two-pimage/24350 "2020-11-19T23:58:49Z")

</div>

I have two images in two PImage the first image ( 1.jpg) consists of colored mosaics, while the second image also (2.jpg) consists only of a succession of pixels of a single color on a black background. Well, what I’m t…

---

## [Help me to bounce the ball of the paddle](https://discourse.processing.org/t/help-me-to-bounce-the-ball-of-the-paddle/25540)

<div class="topic-metadata">

**Author:** [@AzizurRahman](https://discourse.processing.org/u/AzizurRahman)\
**Replies:** 7\
**Last updated:** [November 19, 2020, 9:05pm UTC](https://discourse.processing.org/t/help-me-to-bounce-the-ball-of-the-paddle/25540 "2020-11-19T21:05:59Z")

</div>

Hi so far I wrote this code which has the ball bouncing from the edges.But I have the paddle here but i want it to make bouncing from the from the paddle I have literally no idea how make the ball bounce from the paddle.…

---

## [I need serious help with creating a pong game in processing for my college homework!](https://discourse.processing.org/t/i-need-serious-help-with-creating-a-pong-game-in-processing-for-my-college-homework/25545)

<div class="topic-metadata">

**Author:** [@TheGuga](https://discourse.processing.org/u/TheGuga)\
**Replies:** 1\
**Last updated:** [November 19, 2020, 8:30pm UTC](https://discourse.processing.org/t/i-need-serious-help-with-creating-a-pong-game-in-processing-for-my-college-homework/25545 "2020-11-19T20:30:43Z")

</div>

Hello everyone! Im being for help cause today is the deadline of the work a need to delivery. basically im creating a pong game in processing using java, but im having serious problems with the creation of a menu and s…

---

## [Multiple window with user input](https://discourse.processing.org/t/multiple-window-with-user-input/25515)

<div class="topic-metadata">

**Author:** [@MiguelSanches](https://discourse.processing.org/u/MiguelSanches)\
**Replies:** 4\
**Last updated:** [November 19, 2020, 9:12am UTC](https://discourse.processing.org/t/multiple-window-with-user-input/25515 "2020-11-19T09:12:03Z")

</div>

Hi all! I am trying to make a simple GUI with an option menu so that when a button is pressed, a second window opens and waits for the user to click on a button of that second window, before closing it and returning to …

---

## [Generating a hairy circle](https://discourse.processing.org/t/generating-a-hairy-circle/25481)

<div class="topic-metadata">

**Author:** [@fiveyearplan](https://discourse.processing.org/u/fiveyearplan)\
**Replies:** 5\
**Last updated:** [November 18, 2020, 4:05pm UTC](https://discourse.processing.org/t/generating-a-hairy-circle/25481 "2020-11-18T16:05:20Z")

</div>

My assignment is to generate a hair-like/fur-like texture. For this case, I’m creating a circle of this texture and I would like some advice on how to improve it. PGraphics create\_fur\_circle(int colour, int radius) { P…

---

## [How to jump the line when it reaches the limit of a window?](https://discourse.processing.org/t/how-to-jump-the-line-when-it-reaches-the-limit-of-a-window/25501)

<div class="topic-metadata">

**Author:** [@EmmanuelHra](https://discourse.processing.org/u/EmmanuelHra)\
**Replies:** 2\
**Last updated:** [November 18, 2020, 2:22pm UTC](https://discourse.processing.org/t/how-to-jump-the-line-when-it-reaches-the-limit-of-a-window/25501 "2020-11-18T14:22:52Z")

</div>

I am working in processing and I have to print the following: What I want to do is that when the limit of the window of a line break is reached and I write the letter just below the first P, I will make the line brea…

---

## [Fixing color to squares with eyedropper](https://discourse.processing.org/t/fixing-color-to-squares-with-eyedropper/25508)

<div class="topic-metadata">

**Author:** [@scooijmans](https://discourse.processing.org/u/scooijmans)\
**Replies:** 9\
**Last updated:** [November 18, 2020, 1:59pm UTC](https://discourse.processing.org/t/fixing-color-to-squares-with-eyedropper/25508 "2020-11-18T13:59:05Z")

</div>

Hi, I’m not very good at processing and am stuck with this code. I drew 5 squares with the color of the x and y position of the mouse. Next, I want to state that with the first mouseclick the color the mouse is on at th…

---

## [Space invaders game](https://discourse.processing.org/t/space-invaders-game/25489)

<div class="topic-metadata">

**Author:** [@TheGullible1](https://discourse.processing.org/u/TheGullible1)\
**Replies:** 18\
**Last updated:** [November 18, 2020, 12:29pm UTC](https://discourse.processing.org/t/space-invaders-game/25489 "2020-11-18T12:29:39Z")

</div>

Hi again, hope everyone is doing well… im stuck on trying to get my player to shoot bullets at the alien. main: my background is an everlasting background which will always carry on! PImage background; int x=0; //gl…

---

## [Issue with transfer from PDE to openprocessing](https://discourse.processing.org/t/issue-with-transfer-from-pde-to-openprocessing/25479)

<div class="topic-metadata">

**Author:** [@Divitiacus](https://discourse.processing.org/u/Divitiacus)\
**Replies:** 2\
**Last updated:** [November 17, 2020, 10:53pm UTC](https://discourse.processing.org/t/issue-with-transfer-from-pde-to-openprocessing/25479 "2020-11-17T22:53:33Z")

</div>

I wanted to start to use openprocessing to publish my sketches but it seems the transfer from PDE doesn’t work 1:1. Sketch: I get the error message that createShape is not defined. However it is (Line 203). I thought…

---

## [Problem while saving script in Processing](https://discourse.processing.org/t/problem-while-saving-script-in-processing/25495)

<div class="topic-metadata">

**Author:** [@DSp](https://discourse.processing.org/u/DSp)\
**Replies:** 1\
**Last updated:** [November 17, 2020, 8:48pm UTC](https://discourse.processing.org/t/problem-while-saving-script-in-processing/25495 "2020-11-17T20:48:29Z")

</div>

Hello I save a script in processing and when I open the file again, the script has not been saved and the file is empty. Do you have any ideas on what is going on?! Danae

---

## [Multiple type of boids flocking simulation](https://discourse.processing.org/t/multiple-type-of-boids-flocking-simulation/25439)

<div class="topic-metadata">

**Author:** [@ss999](https://discourse.processing.org/u/ss999)\
**Replies:** 2\
**Last updated:** [November 17, 2020, 1:17pm UTC](https://discourse.processing.org/t/multiple-type-of-boids-flocking-simulation/25439 "2020-11-17T13:17:54Z")

</div>

Hi, I am trying to create a flocking system based on Craig Reynolds Boids, which contain multiple type of boids. And each type of boids will interact with the other type of boids. Like this.( It is written by Husselma…

---

## [Radix 32+ Converter](https://discourse.processing.org/t/radix-32-converter/25435)

<div class="topic-metadata">

**Author:** [@HumanoidX](https://discourse.processing.org/u/HumanoidX)\
**Replies:** 4\
**Last updated:** [November 17, 2020, 4:03am UTC](https://discourse.processing.org/t/radix-32-converter/25435 "2020-11-17T04:03:11Z")

</div>

I want to convert any base to any base. I’m using this right now: void setup(){ println(baseConversion("JAVA",36,10)); } String baseConversion(String input,int fromBase,int toBase){ return reverseCase(Integer.toSt…

---

## [Collision with images](https://discourse.processing.org/t/collision-with-images/25475)

<div class="topic-metadata">

**Author:** [@TheGullible1](https://discourse.processing.org/u/TheGullible1)\
**Replies:** 2\
**Last updated:** [November 16, 2020, 10:57pm UTC](https://discourse.processing.org/t/collision-with-images/25475 "2020-11-16T22:57:26Z")

</div>

trying to use: //collision detection boolean Colarrow(arrow other){ return (abs(this.x-other.x) \<50 && abs(this.y-other.y)\<150); } this is how I’m trying to use it: arrow phil, grill; void setup(){ …

---

## [Implementing an image when it bounces off the wall it will show which direction its going to](https://discourse.processing.org/t/implementing-an-image-when-it-bounces-off-the-wall-it-will-show-which-direction-its-going-to/25469)

<div class="topic-metadata">

**Author:** [@TheGullible1](https://discourse.processing.org/u/TheGullible1)\
**Replies:** 9\
**Last updated:** [November 16, 2020, 10:17pm UTC](https://discourse.processing.org/t/implementing-an-image-when-it-bounces-off-the-wall-it-will-show-which-direction-its-going-to/25469 "2020-11-16T22:17:04Z")

</div>

So what im trying to do is when the image bounces of the wall it will show which direction its going to. (my images are arrows btw) eg if it bounces of the right wall the arrow will point left and vice versa and if it …

---

## [Need help with game project](https://discourse.processing.org/t/need-help-with-game-project/24993)

<div class="topic-metadata">

**Author:** [@claudinho7](https://discourse.processing.org/u/claudinho7)\
**Replies:** 43\
**Last updated:** [November 16, 2020, 9:01pm UTC](https://discourse.processing.org/t/need-help-with-game-project/24993 "2020-11-16T21:01:21Z")

</div>

hello, i’m working on a little game for a uni project and i got stuck trying to move an object using keyboards. depending where i move the void keypressed part the key might get spammed or not show at all, but the obje…

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

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