# Coding Questions

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

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

**Page:** 169

---

## [Picture to load when a specific key isn’t pressed](https://discourse.processing.org/t/picture-to-load-when-a-specific-key-isn-t-pressed/4941)

<div class="topic-metadata">

**Author:** [@jensemand](https://discourse.processing.org/u/jensemand)\
**Replies:** 9\
**Last updated:** [October 28, 2018, 11:23am UTC](https://discourse.processing.org/t/picture-to-load-when-a-specific-key-isn-t-pressed/4941 "2018-10-28T11:23:43Z")

</div>

Hi I’m making a game and I need some help with a true/false line. I need picture to load when a specific key isn’t pressed (the key is ENTER).

---

## [How to initialise and use array in game assignment](https://discourse.processing.org/t/how-to-initialise-and-use-array-in-game-assignment/4273)

<div class="topic-metadata">

**Author:** [@FrankieZ](https://discourse.processing.org/u/FrankieZ)\
**Replies:** 15\
**Last updated:** [October 24, 2018, 11:40pm UTC](https://discourse.processing.org/t/how-to-initialise-and-use-array-in-game-assignment/4273 "2018-10-24T23:40:01Z")

</div>

Hi there, my assignment this time is an extension on my previous one (in the link above). It consists of 2 parts (I have done the first one): Scoring (use functions and loops) Every time an invader gets obliterated, …

---

## [Changing Scenes Once Off Screen?](https://discourse.processing.org/t/changing-scenes-once-off-screen/4934)

<div class="topic-metadata">

**Author:** [@Maxim](https://discourse.processing.org/u/Maxim)\
**Replies:** 2\
**Last updated:** [October 27, 2018, 6:30pm UTC](https://discourse.processing.org/t/changing-scenes-once-off-screen/4934 "2018-10-27T18:30:29Z")

</div>

so essentially, I want to make it so when a ship i have controlled with WASD goes greater than width, then the scene changes to another one, however the ship gets reset to the center of that new scene. Is that Possibe

---

## [Want to change value to color](https://discourse.processing.org/t/want-to-change-value-to-color/4935)

<div class="topic-metadata">

**Author:** [@anna\_mei](https://discourse.processing.org/u/anna_mei)\
**Replies:** 5\
**Last updated:** [October 27, 2018, 6:21pm UTC](https://discourse.processing.org/t/want-to-change-value-to-color/4935 "2018-10-27T18:21:59Z")

</div>

hi, I would like to alter the “value change” in this example from black -\> white to green -\> blue. I can not find a way to alter value into color. I want to animate a tear, that turns blue after I clicked the mouse. Coul…

---

## [Displaying pixels outside of the sketch window](https://discourse.processing.org/t/displaying-pixels-outside-of-the-sketch-window/4912)

<div class="topic-metadata">

**Author:** [@germaine](https://discourse.processing.org/u/germaine)\
**Replies:** 4\
**Last updated:** [October 27, 2018, 6:14pm UTC](https://discourse.processing.org/t/displaying-pixels-outside-of-the-sketch-window/4912 "2018-10-27T18:14:27Z")

</div>

Is this possible in Processing to display a shape or an image outside of the boundaries of the sketch window? Is that something regular Java can do? Thank you!

---

## [Can anyone else confirm? textFont overrides stroke opacity?](https://discourse.processing.org/t/can-anyone-else-confirm-textfont-overrides-stroke-opacity/4513)

<div class="topic-metadata">

**Author:** [@rapatski](https://discourse.processing.org/u/rapatski)\
**Replies:** 4\
**Last updated:** [October 27, 2018, 4:22pm UTC](https://discourse.processing.org/t/can-anyone-else-confirm-textfont-overrides-stroke-opacity/4513 "2018-10-27T16:22:24Z")

</div>

Hey guys, please see example below to try and recreate the behaviour I’m seeing: when setting the font to a font loaded with loadFont (as opposed to using createFont) all stroke opacity in the sketch is set to 255: PFon…

---

## [Help to clear a void](https://discourse.processing.org/t/help-to-clear-a-void/4920)

<div class="topic-metadata">

**Author:** [@jensemand](https://discourse.processing.org/u/jensemand)\
**Replies:** 2\
**Last updated:** [October 27, 2018, 12:27pm UTC](https://discourse.processing.org/t/help-to-clear-a-void/4920 "2018-10-27T12:27:49Z")

</div>

Hi I just wanted to know if you can clear a void after a certain amount of time or after you press a key

---

## [Processing Array Circle Art](https://discourse.processing.org/t/processing-array-circle-art/4888)

<div class="topic-metadata">

**Author:** [@chisholmem](https://discourse.processing.org/u/chisholmem)\
**Replies:** 15\
**Last updated:** [October 26, 2018, 5:53pm UTC](https://discourse.processing.org/t/processing-array-circle-art/4888 "2018-10-26T17:53:51Z")

</div>

Hi there, I am currently trying to make a drawing of multiple colored circles in an array. I have ints set for different sets of colors, but for some reason, I can only get two to work at a time. Can someone tell me wher…

---

## [Missing Points when drawing](https://discourse.processing.org/t/missing-points-when-drawing/4775)

<div class="topic-metadata">

**Author:** [@dgm3333](https://discourse.processing.org/u/dgm3333)\
**Replies:** 14\
**Last updated:** [October 26, 2018, 4:00pm UTC](https://discourse.processing.org/t/missing-points-when-drawing/4775 "2018-10-26T16:00:24Z")

</div>

I’m trying to run various snipits of code to draw things on Windows 10. However I keep getting points missing (this isn’t isolated to the following code, it happens regularly). Attached is just one example. The points…

---

## [selectInput selectOutput info](https://discourse.processing.org/t/selectinput-selectoutput-info/4453)

<div class="topic-metadata">

**Author:** [@FerrariLuigi](https://discourse.processing.org/u/FerrariLuigi)\
**Replies:** 2\
**Last updated:** [October 26, 2018, 3:30pm UTC](https://discourse.processing.org/t/selectinput-selectoutput-info/4453 "2018-10-26T15:30:56Z")

</div>

Dear all I have to use the selectInput function on my sketch. Unfortunately I can’t find a detailed description of it. I don’t understand, for example, how to direct the selectInput in a directory or how to use file f…

---

## [Making multiple of same image](https://discourse.processing.org/t/making-multiple-of-same-image/4406)

<div class="topic-metadata">

**Author:** [@ProcessingStarter](https://discourse.processing.org/u/ProcessingStarter)\
**Replies:** 2\
**Last updated:** [October 14, 2018, 1:44am UTC](https://discourse.processing.org/t/making-multiple-of-same-image/4406 "2018-10-14T01:44:52Z")

</div>

I am making a tic-tac-toe game and am trying to place an ‘X’ image into each box for starters. But when I Try to place an ‘X’ image more than once, the first one disappears. i made a switch case to place an X into every …

---

## [Array with 2 of the same value](https://discourse.processing.org/t/array-with-2-of-the-same-value/4892)

<div class="topic-metadata">

**Author:** [@Tristan](https://discourse.processing.org/u/Tristan)\
**Replies:** 3\
**Last updated:** [October 26, 2018, 11:18am UTC](https://discourse.processing.org/t/array-with-2-of-the-same-value/4892 "2018-10-26T11:18:20Z")

</div>

Hello, im trying to make an array using a for loop that contains two of the same values. It would like like this if you write it out. int \[\] cardSets= {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10,…

---

## [Could u mind help me make brick game?](https://discourse.processing.org/t/could-u-mind-help-me-make-brick-game/4600)

<div class="topic-metadata">

**Author:** [@nacTF](https://discourse.processing.org/u/nacTF)\
**Replies:** 4\
**Last updated:** [October 26, 2018, 7:37am UTC](https://discourse.processing.org/t/could-u-mind-help-me-make-brick-game/4600 "2018-10-26T07:37:45Z")

</div>

i want to make special brickgame It is characteristic that the brick line is continuously generated and comes down from the top. i can make normal brickgame but its very hard to me I want you to give me answers or hi…

---

## [Decrementing in draw problem](https://discourse.processing.org/t/decrementing-in-draw-problem/4879)

<div class="topic-metadata">

**Author:** [@Aquakitty](https://discourse.processing.org/u/Aquakitty)\
**Replies:** 3\
**Last updated:** [October 25, 2018, 5:51pm UTC](https://discourse.processing.org/t/decrementing-in-draw-problem/4879 "2018-10-25T17:51:25Z")

</div>

Hi, new to processing and programming with frames but not to programming so this is a bit embarrassing. I’ve managed to make ellipses that expand and contract with no problem by using a state, but I’ve had this other is…

---

## [Drawing tool, mouse cursor problem](https://discourse.processing.org/t/drawing-tool-mouse-cursor-problem/4862)

<div class="topic-metadata">

**Author:** [@seo](https://discourse.processing.org/u/seo)\
**Replies:** 5\
**Last updated:** [October 25, 2018, 11:59am UTC](https://discourse.processing.org/t/drawing-tool-mouse-cursor-problem/4862 "2018-10-25T11:59:05Z")

</div>

Hi! I am creating a simple drawing tool. I hope the user can intuitively know the size of the drawing tool through the cursor. However, the way I use is obscured by the picture in which the cursor is drawn. Is not there…

---

## [Start, Exit and other buttons: main menu -\> game](https://discourse.processing.org/t/start-exit-and-other-buttons-main-menu-game/4834)

<div class="topic-metadata">

**Author:** [@SolDrakibane](https://discourse.processing.org/u/SolDrakibane)\
**Replies:** 1\
**Last updated:** [October 25, 2018, 10:11am UTC](https://discourse.processing.org/t/start-exit-and-other-buttons-main-menu-game/4834 "2018-10-25T10:11:08Z")

</div>

Alright - i need to make a main menu and want to have a start button, exit button and a highscore button (which pops up another menu). The thing is, i know how to make a button. But i can’t figure out how to make this bu…

---

## [Badly formed character constant](https://discourse.processing.org/t/badly-formed-character-constant/4832)

<div class="topic-metadata">

**Author:** [@somedude](https://discourse.processing.org/u/somedude)\
**Replies:** 3\
**Last updated:** [October 25, 2018, 10:03am UTC](https://discourse.processing.org/t/badly-formed-character-constant/4832 "2018-10-25T10:03:53Z")

</div>

im programming a character that moves on a background with the arrow keys and im having an issue i’ll leave the code on the description PImage bg, personagem; int px, py; boolean cima, baixo, esq, dir; void setup() {…

---

## [About processing with HTML Parsing](https://discourse.processing.org/t/about-processing-with-html-parsing/4401)

<div class="topic-metadata">

**Author:** [@sailor](https://discourse.processing.org/u/sailor)\
**Replies:** 2\
**Last updated:** [October 25, 2018, 9:58am UTC](https://discourse.processing.org/t/about-processing-with-html-parsing/4401 "2018-10-25T09:58:42Z")

</div>

I knew this page, http://www.aharef.info/2006/05/websites\_as\_graphs.htm, (original page where the animation were) some years ago (a snapshot is available here: https://web.archive.org/web/20150508185058/http://www.aharef…

---

## [Change a Class without changing it’s code?](https://discourse.processing.org/t/change-a-class-without-changing-it-s-code/4748)

<div class="topic-metadata">

**Author:** [@Lexyth](https://discourse.processing.org/u/Lexyth)\
**Replies:** 6\
**Last updated:** [October 25, 2018, 9:51am UTC](https://discourse.processing.org/t/change-a-class-without-changing-it-s-code/4748 "2018-10-25T09:51:22Z")

</div>

I have the following problem, i Need to change a Class that i have to Import from outside, But i can only Import and not Access it to change it. I also can‘t (could, But is much more complicated Solution) extend a new cl…

---

## [selectInput() anomaly](https://discourse.processing.org/t/selectinput-anomaly/4504)

<div class="topic-metadata">

**Author:** [@moireGuy](https://discourse.processing.org/u/moireGuy)\
**Replies:** 1\
**Last updated:** [October 24, 2018, 8:30pm UTC](https://discourse.processing.org/t/selectinput-anomaly/4504 "2018-10-24T20:30:34Z")

</div>

Greetings all, I’ve encountered some anomalous behavior regarding the selectInput() function and the P3D renderer that I’m curious about. I’m running on a Windows 10 system. The following dummy code demonstrates the be…

---

## [What is the distance of the camera from the (x, y, 0) plane in P3D?](https://discourse.processing.org/t/what-is-the-distance-of-the-camera-from-the-x-y-0-plane-in-p3d/4388)

<div class="topic-metadata">

**Author:** [@Tsskyx](https://discourse.processing.org/u/Tsskyx)\
**Replies:** 3\
**Last updated:** [October 24, 2018, 8:05pm UTC](https://discourse.processing.org/t/what-is-the-distance-of-the-camera-from-the-x-y-0-plane-in-p3d/4388 "2018-10-24T20:05:20Z")

</div>

I’m making this simple 1st-person 3D environment and for that I need to know the distance of the camera (the 1st person) from the objects rendered on the screen. Alternatively, is there a way to move the camera so that …

---

## [Sorting algorithm method timeout occurred](https://discourse.processing.org/t/sorting-algorithm-method-timeout-occurred/4542)

<div class="topic-metadata">

**Author:** [@Marcus152](https://discourse.processing.org/u/Marcus152)\
**Replies:** 1\
**Last updated:** [October 24, 2018, 7:43pm UTC](https://discourse.processing.org/t/sorting-algorithm-method-timeout-occurred/4542 "2018-10-24T19:43:20Z")

</div>

Hey everybody! I’m trying to make a really stupid sorting algorithm as a joke, but I can’t seem to get it to work. It’s called “Supernatural Occurence Sort”, and basically, my idea was as follows: if nArr is sorted some…

---

## [Back/forward/extra mouse buttons](https://discourse.processing.org/t/back-forward-extra-mouse-buttons/4515)

<div class="topic-metadata">

**Author:** [@lmccandless](https://discourse.processing.org/u/lmccandless)\
**Replies:** 1\
**Last updated:** [October 24, 2018, 7:29pm UTC](https://discourse.processing.org/t/back-forward-extra-mouse-buttons/4515 "2018-10-24T19:29:24Z")

</div>

Trying to use the back/forward buttons on the side of my mouse, it doesn’t show up with mousePressed, key, or keyCode. Is this broken out anywhere?

---

## [ArrayList - would like to get it printed in a window](https://discourse.processing.org/t/arraylist-would-like-to-get-it-printed-in-a-window/4461)

<div class="topic-metadata">

**Author:** [@sljivan](https://discourse.processing.org/u/sljivan)\
**Replies:** 2\
**Last updated:** [October 24, 2018, 7:15pm UTC](https://discourse.processing.org/t/arraylist-would-like-to-get-it-printed-in-a-window/4461 "2018-10-24T19:15:07Z")

</div>

Hello guys, I would like to print list of COM ports list in a window, so user could pick one from the list. I used an example I found on the forum, and tried to upgrade it with my request. I have tryed this: int stat…

---

## [Time-base Pattern Help](https://discourse.processing.org/t/time-base-pattern-help/4398)

<div class="topic-metadata">

**Author:** [@ehasti21](https://discourse.processing.org/u/ehasti21)\
**Replies:** 1\
**Last updated:** [October 24, 2018, 6:47pm UTC](https://discourse.processing.org/t/time-base-pattern-help/4398 "2018-10-24T18:47:06Z")

</div>

Hello all, we are currently working on a time-based pattern project for class but i’ve manage to hit a wall working on my code. I am new to working in the program so i’m a tad confused. I would like to make it to where…

---

## [Looping counter inside function](https://discourse.processing.org/t/looping-counter-inside-function/4763)

<div class="topic-metadata">

**Author:** [@spade](https://discourse.processing.org/u/spade)\
**Replies:** 3\
**Last updated:** [October 24, 2018, 6:16pm UTC](https://discourse.processing.org/t/looping-counter-inside-function/4763 "2018-10-24T18:16:56Z")

</div>

Hi, I was trying to initiate a variable inside a function that saves a time reference so I know how much time has passed since it was used (to sync with the BPM). This is my function: void rainbow(int bpm){ float b…

---

## [Interaction of objects parameters](https://discourse.processing.org/t/interaction-of-objects-parameters/4750)

<div class="topic-metadata">

**Author:** [@LizrichVonEinzbern08](https://discourse.processing.org/u/LizrichVonEinzbern08)\
**Replies:** 2\
**Last updated:** [October 24, 2018, 5:22pm UTC](https://discourse.processing.org/t/interaction-of-objects-parameters/4750 "2018-10-24T17:22:30Z")

</div>

Particle p; Particle p1; void setup(){ //fullScreen(); size(640,320); p = new Particle(); p1 = new Particle(); } void draw(){ background(150); p.display(); p1.display(); } class Particle{ float x = rand…

---

## [Color threadsafe in Processing?](https://discourse.processing.org/t/color-threadsafe-in-processing/4563)

<div class="topic-metadata">

**Author:** [@gerome](https://discourse.processing.org/u/gerome)\
**Replies:** 11\
**Last updated:** [October 24, 2018, 5:15pm UTC](https://discourse.processing.org/t/color-threadsafe-in-processing/4563 "2018-10-24T17:15:49Z")

</div>

I have two threads running in one sketch and have the problem that the colors interfere and flicker. the background color changes by setFill of a pShape in one thread. I suppose that there is no “clean” solution because …

---

## [Help changing colours in my animation](https://discourse.processing.org/t/help-changing-colours-in-my-animation/4799)

<div class="topic-metadata">

**Author:** [@joe891](https://discourse.processing.org/u/joe891)\
**Replies:** 2\
**Last updated:** [October 24, 2018, 12:26pm UTC](https://discourse.processing.org/t/help-changing-colours-in-my-animation/4799 "2018-10-24T12:26:22Z")

</div>

Hi! I want my 3 triangle to randomly be changing colours throughout the whole animation. I’m a little stuck on where to go next but this is what I have so far. float x = 0; float speed = 1; float r = random(255); float …

---

## [Rotate a sinusoidal wave (2D traslation)](https://discourse.processing.org/t/rotate-a-sinusoidal-wave-2d-traslation/4796)

<div class="topic-metadata">

**Author:** [@saotome](https://discourse.processing.org/u/saotome)\
**Replies:** 12\
**Last updated:** [October 24, 2018, 10:21am UTC](https://discourse.processing.org/t/rotate-a-sinusoidal-wave-2d-traslation/4796 "2018-10-24T10:21:00Z")

</div>

Hello everybody This program simulate a sinusoidal wave running along x axis \`\` int xspacing = 16; // How far apart should each horizontal location be spaced int w; // Width of entire wave float theta …

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

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