# Coding Questions

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

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

**Page:** 151

---

## [How to rotate entire scene instead of all objects in scene (P3D)](https://discourse.processing.org/t/how-to-rotate-entire-scene-instead-of-all-objects-in-scene-p3d/8546)

<div class="topic-metadata">

**Author:** [@TheZipCreator](https://discourse.processing.org/u/TheZipCreator)\
**Replies:** 1\
**Last updated:** [February 20, 2019, 3:17am UTC](https://discourse.processing.org/t/how-to-rotate-entire-scene-instead-of-all-objects-in-scene-p3d/8546 "2019-02-20T03:17:57Z")

</div>

I have some code to make a scene and then I want to rotate the entire scene (not all the objects in the scene) When I run this code it rotates the cube and the skysphere seperately, but I want the entire scene to rotate…

---

## [Can\`t move PacMan](https://discourse.processing.org/t/can-t-move-pacman/8537)

<div class="topic-metadata">

**Author:** [@Obacht](https://discourse.processing.org/u/Obacht)\
**Replies:** 1\
**Last updated:** [February 19, 2019, 11:37pm UTC](https://discourse.processing.org/t/can-t-move-pacman/8537 "2019-02-19T23:37:13Z")

</div>

int xkoord = 200; int ykoord = 200; int summand = 10; int winkel1 = 40; int winkel2 = 320; void setup() { size (400, 400); frameRate(60); background(0); PacMan(); Waende(); } void PacMan() { fill ( 255, 255…

---

## [Level Change controlled by Buttons](https://discourse.processing.org/t/level-change-controlled-by-buttons/8517)

<div class="topic-metadata">

**Author:** [@DJ\_SCRATCH](https://discourse.processing.org/u/DJ_SCRATCH)\
**Replies:** 1\
**Last updated:** [February 19, 2019, 1:58am UTC](https://discourse.processing.org/t/level-change-controlled-by-buttons/8517 "2019-02-19T01:58:04Z")

</div>

Hi, I’m trying to create a very simple game where the player is given a choice between two buttons in every level, get it right and you move on get it wrong and the word “WRONG” flashes on the screen, but every time I c…

---

## [Help on line detection](https://discourse.processing.org/t/help-on-line-detection/8373)

<div class="topic-metadata">

**Author:** [@peter1](https://discourse.processing.org/u/peter1)\
**Replies:** 1\
**Last updated:** [February 19, 2019, 6:28pm UTC](https://discourse.processing.org/t/help-on-line-detection/8373 "2019-02-19T18:28:04Z")

</div>

Im working on a maze game, and cant find out how to detect if the ball hits the walls/lines! int x; int y; int s; void setup(){ size(500,500); background(0); noStroke(); x = 20; y = 20; s = 10; fill(0,0,2…

---

## [Use into setup() a float value from a method that finds it](https://discourse.processing.org/t/use-into-setup-a-float-value-from-a-method-that-finds-it/6343)

<div class="topic-metadata">

**Author:** [@netphysicist](https://discourse.processing.org/u/netphysicist)\
**Replies:** 49\
**Last updated:** [February 19, 2019, 12:23pm UTC](https://discourse.processing.org/t/use-into-setup-a-float-value-from-a-method-that-finds-it/6343 "2019-02-19T12:23:07Z")

</div>

Hello, i have made a function void findvalue() which calculates with maths a float value named intensity and then i call this function into the void setup…My problem is that when i use the value intensity inside the v…

---

## [Super mario game help](https://discourse.processing.org/t/super-mario-game-help/8470)

<div class="topic-metadata">

**Author:** [@LuciferMS666](https://discourse.processing.org/u/LuciferMS666)\
**Replies:** 4\
**Last updated:** [February 19, 2019, 11:46am UTC](https://discourse.processing.org/t/super-mario-game-help/8470 "2019-02-19T11:46:16Z")

</div>

Hello everyone, I created this discussion because I have a job to do on processing. So I decided to create a mario game only I would like to have your help (because I’m still a beginner). I would like you to help me for …

---

## [PShape.resetMatrix() not resetting rotation in P2D](https://discourse.processing.org/t/pshape-resetmatrix-not-resetting-rotation-in-p2d/8508)

<div class="topic-metadata">

**Author:** [@wqt](https://discourse.processing.org/u/wqt)\
**Replies:** 11\
**Last updated:** [February 19, 2019, 9:18am UTC](https://discourse.processing.org/t/pshape-resetmatrix-not-resetting-rotation-in-p2d/8508 "2019-02-19T09:18:57Z")

</div>

Hello everyone! I have a quite weird resetMatrix bug on PShape. It works fine in the default renderer, but in P2D it seems to reset only the translation and not the rotation. So what I am seeing is a spinning quad, inst…

---

## [Accessing two subclass within one class](https://discourse.processing.org/t/accessing-two-subclass-within-one-class/8457)

<div class="topic-metadata">

**Author:** [@Feltopi](https://discourse.processing.org/u/Feltopi)\
**Replies:** 4\
**Last updated:** [February 18, 2019, 10:05am UTC](https://discourse.processing.org/t/accessing-two-subclass-within-one-class/8457 "2019-02-18T10:05:49Z")

</div>

Hello, i dont know if its even possible, but here is my problem. My goal is find the best shape for my IRL construction and i would like to use genetic algorithm (yeah… high hopes) and for that so i want to make a rand…

---

## [Combobox with present mode](https://discourse.processing.org/t/combobox-with-present-mode/8276)

<div class="topic-metadata">

**Author:** [@akenaton](https://discourse.processing.org/u/akenaton)\
**Replies:** 17\
**Last updated:** [February 18, 2019, 9:48am UTC](https://discourse.processing.org/t/combobox-with-present-mode/8276 "2019-02-18T09:48:14Z")

</div>

i have an app that is quite ok; it s a very long and complicated thing but it runs, through a server and with multiple clients && rooms. I have tested it in a lot of situations; as everything looks fine now i try to exp…

---

## [Key != the pressed key when control is held](https://discourse.processing.org/t/key-the-pressed-key-when-control-is-held/2779)

<div class="topic-metadata">

**Author:** [@Warlax56](https://discourse.processing.org/u/Warlax56)\
**Replies:** 6\
**Last updated:** [February 18, 2019, 4:34am UTC](https://discourse.processing.org/t/key-the-pressed-key-when-control-is-held/2779 "2019-02-18T04:34:23Z")

</div>

I’m trying to implement copy and pasting into a node based programming language I’m making. An abreviated version of my code is something like this: void keyPressed() { if(key == 'c' || key == 'C'){ print("\\nC press…

---

## [I am trying to do intersections but nothing i do will allow it to work](https://discourse.processing.org/t/i-am-trying-to-do-intersections-but-nothing-i-do-will-allow-it-to-work/8452)

<div class="topic-metadata">

**Author:** [@Supergreek72](https://discourse.processing.org/u/Supergreek72)\
**Replies:** 4\
**Last updated:** [February 18, 2019, 2:00am UTC](https://discourse.processing.org/t/i-am-trying-to-do-intersections-but-nothing-i-do-will-allow-it-to-work/8452 "2019-02-18T02:00:04Z")

</div>

I have 2 cars and if they touch I want it to pick a new spot, the intersection command says it only uses integers but the random command i have says it only uses floats. i fixed this by adding a rounding command but i ca…

---

## [Tips for speeding up this sketch](https://discourse.processing.org/t/tips-for-speeding-up-this-sketch/8468)

<div class="topic-metadata">

**Author:** [@scottmetoyer](https://discourse.processing.org/u/scottmetoyer)\
**Replies:** 4\
**Last updated:** [February 17, 2019, 11:12pm UTC](https://discourse.processing.org/t/tips-for-speeding-up-this-sketch/8468 "2019-02-17T23:12:44Z")

</div>

I’m new to Processing, and have my project working but with some performance issues. Basically I have 10 images that I’m scaling and moving (with lerp) when a key is pressed. Eventually I’d like to get this up to 100 im…

---

## [\[SOLVED\] Uneven Data Entry by sketch](https://discourse.processing.org/t/solved-uneven-data-entry-by-sketch/8449)

<div class="topic-metadata">

**Author:** [@harvious](https://discourse.processing.org/u/harvious)\
**Replies:** 2\
**Last updated:** [February 16, 2019, 3:37pm UTC](https://discourse.processing.org/t/solved-uneven-data-entry-by-sketch/8449 "2019-02-16T15:37:32Z")

</div>

Hello all, In my sketch, I have a bunch of balls bouncing around. I am saving the X, Y values of each ball, and the XSpeed, and YSpeed value of each ball every time draw() runs. I use the following code : PrintWriter …

---

## [How to slow down drawing points](https://discourse.processing.org/t/how-to-slow-down-drawing-points/8234)

<div class="topic-metadata">

**Author:** [@davef\_dci](https://discourse.processing.org/u/davef_dci)\
**Replies:** 22\
**Last updated:** [February 15, 2019, 9:59pm UTC](https://discourse.processing.org/t/how-to-slow-down-drawing-points/8234 "2019-02-15T21:59:56Z")

</div>

Hey folks, New to processing. I’m reading a large number of X,Y points out of a CSV file and drawing them to the screen using the point command. inside a for loop The points represent GPS locations on a race track. I’d…

---

## [Running a circle pattern inside a given shape](https://discourse.processing.org/t/running-a-circle-pattern-inside-a-given-shape/8108)

<div class="topic-metadata">

**Author:** [@TomMoto](https://discourse.processing.org/u/TomMoto)\
**Replies:** 3\
**Last updated:** [February 15, 2019, 9:54pm UTC](https://discourse.processing.org/t/running-a-circle-pattern-inside-a-given-shape/8108 "2019-02-15T21:54:24Z")

</div>

Hi, I am cosidering myself still a beginner, trying to learn as much as I can. I would like to realize something but I m stuck. maybe someone has a tip or solution… Within my sketch I create little circles row by row.…

---

## [Individual stroke colours for each side of a rect](https://discourse.processing.org/t/individual-stroke-colours-for-each-side-of-a-rect/7937)

<div class="topic-metadata">

**Author:** [@KeirMeDear](https://discourse.processing.org/u/KeirMeDear)\
**Replies:** 3\
**Last updated:** [February 15, 2019, 6:12pm UTC](https://discourse.processing.org/t/individual-stroke-colours-for-each-side-of-a-rect/7937 "2019-02-15T18:12:18Z")

</div>

I was wondering if there was function that allows you to assign a unique colour value to each side of a rect - So for example the top stroke of a rect could be green and the bottom stroke of the rect could be red - I don…

---

## [Get counts from each cell in cavas in Processing](https://discourse.processing.org/t/get-counts-from-each-cell-in-cavas-in-processing/8238)

<div class="topic-metadata">

**Author:** [@harvious](https://discourse.processing.org/u/harvious)\
**Replies:** 6\
**Last updated:** [February 15, 2019, 6:10pm UTC](https://discourse.processing.org/t/get-counts-from-each-cell-in-cavas-in-processing/8238 "2019-02-15T18:10:52Z")

</div>

Hello all, I have been working on a simulation project for a while which involves N colliding balls in a 2D space. What I want to get is the count of the number of balls in each cell every frame and save it to a text fi…

---

## [Creating the brick breaker Game](https://discourse.processing.org/t/creating-the-brick-breaker-game/8251)

<div class="topic-metadata">

**Author:** [@jadenfigger](https://discourse.processing.org/u/jadenfigger)\
**Replies:** 1\
**Last updated:** [February 15, 2019, 6:06pm UTC](https://discourse.processing.org/t/creating-the-brick-breaker-game/8251 "2019-02-15T18:06:31Z")

</div>

I am trying to create brick breaker but when my ball moves it is really glitchy. The ball position keeps jumping to where it previously was. If anyone knows how to fix this issue could you please let me know. Here is my…

---

## [How do I get pixels to display ONE by ONE after a key is pressed?](https://discourse.processing.org/t/how-do-i-get-pixels-to-display-one-by-one-after-a-key-is-pressed/8242)

<div class="topic-metadata">

**Author:** [@bjente](https://discourse.processing.org/u/bjente)\
**Replies:** 1\
**Last updated:** [February 15, 2019, 5:44pm UTC](https://discourse.processing.org/t/how-do-i-get-pixels-to-display-one-by-one-after-a-key-is-pressed/8242 "2019-02-15T17:44:48Z")

</div>

Hello all, I’m new to processing and I’ve got a question about pixels. I want to write a program in which the user can press a key and if a key is pressed, ONE pixel of an image appears. Right now, if I press a key, the…

---

## [How to make processing press a key](https://discourse.processing.org/t/how-to-make-processing-press-a-key/8422)

<div class="topic-metadata">

**Author:** [@Supercube9307](https://discourse.processing.org/u/Supercube9307)\
**Replies:** 1\
**Last updated:** [February 15, 2019, 4:34pm UTC](https://discourse.processing.org/t/how-to-make-processing-press-a-key/8422 "2019-02-15T16:34:36Z")

</div>

Hi all, I have had this question for a long time: Is there any way to make processing act as if the user pressed a key? Ex: When a condition is true, the script would send a signal to the computer that the “P” key had j…

---

## [Making a large image move without lag?](https://discourse.processing.org/t/making-a-large-image-move-without-lag/8406)

<div class="topic-metadata">

**Author:** [@Schred](https://discourse.processing.org/u/Schred)\
**Replies:** 8\
**Last updated:** [February 15, 2019, 3:05pm UTC](https://discourse.processing.org/t/making-a-large-image-move-without-lag/8406 "2019-02-15T15:05:14Z")

</div>

Hey! So I’m trying to implement a background to my 2d platformer. The image moves with the player, just a lot slower. However, moving the image causes a lot of lag. This is my code(simplified): void draw(){ playerCla…

---

## [How to make a 2d Zoom and Pan](https://discourse.processing.org/t/how-to-make-a-2d-zoom-and-pan/1179)

<div class="topic-metadata">

**Author:** [@imaginativeCODE](https://discourse.processing.org/u/imaginativeCODE)\
**Replies:** 9\
**Last updated:** [February 15, 2019, 5:02am UTC](https://discourse.processing.org/t/how-to-make-a-2d-zoom-and-pan/1179 "2019-02-15T05:02:40Z")

</div>

I am trying to make a zoom in and out that the circle stays in the same place but more or less squares are shown. My first assumption is to scale the rects by zoom and then translate(MX + (Zoom / 2), MY + (Zoom / 2));. …

---

## [Reliable if statement switching with sin()](https://discourse.processing.org/t/reliable-if-statement-switching-with-sin/8399)

<div class="topic-metadata">

**Author:** [@mwmw](https://discourse.processing.org/u/mwmw)\
**Replies:** 7\
**Last updated:** [February 15, 2019, 2:23am UTC](https://discourse.processing.org/t/reliable-if-statement-switching-with-sin/8399 "2019-02-15T02:23:35Z")

</div>

Hello, I’m writing a basic DMX controller which has a few simple colour animations. One animation I’m working on currently uses a sin() function to oscillate the brightness value. When the brightness is 0 I want the hue…

---

## [Human-Form 3D Mocap - Graphics Code](https://discourse.processing.org/t/human-form-3d-mocap-graphics-code/8392)

<div class="topic-metadata">

**Author:** [@L11L](https://discourse.processing.org/u/L11L)\
**Replies:** 1\
**Last updated:** [February 14, 2019, 1:40pm UTC](https://discourse.processing.org/t/human-form-3d-mocap-graphics-code/8392 "2019-02-14T13:40:11Z")

</div>

I started using Processing three days ago. I am using Processing to capture the motion of a MPU6050-driven IMU sensor. I need a human form (or something that resembles human) to represent the data output of the IMU senso…

---

## [I don't know how to communicate with internet](https://discourse.processing.org/t/i-dont-know-how-to-communicate-with-internet/8381)

<div class="topic-metadata">

**Author:** [@AngelsApple](https://discourse.processing.org/u/AngelsApple)\
**Replies:** 4\
**Last updated:** [February 14, 2019, 8:14am UTC](https://discourse.processing.org/t/i-dont-know-how-to-communicate-with-internet/8381 "2019-02-14T08:14:56Z")

</div>

I’d like to write a code about data scrapping from internet I set the target as downloading my facebook images and friends list, but It seems too hard for me So now I’m trying to make easy sample that download google L…

---

## [Help on mirroring an image](https://discourse.processing.org/t/help-on-mirroring-an-image/8387)

<div class="topic-metadata">

**Author:** [@Plum](https://discourse.processing.org/u/Plum)\
**Replies:** 4\
**Last updated:** [February 14, 2019, 6:07am UTC](https://discourse.processing.org/t/help-on-mirroring-an-image/8387 "2019-02-14T06:07:20Z")

</div>

So I am currently doing some school assignments which involves me mirroring an image “pixel by pixel”. I got an example on how to flip the image, however i’m struggling to figure out how to mirror it. Here is the code t…

---

## [Incrementing/Decrementing Color Brightness](https://discourse.processing.org/t/incrementing-decrementing-color-brightness/8378)

<div class="topic-metadata">

**Author:** [@Diamaru](https://discourse.processing.org/u/Diamaru)\
**Replies:** 2\
**Last updated:** [February 14, 2019, 1:29am UTC](https://discourse.processing.org/t/incrementing-decrementing-color-brightness/8378 "2019-02-14T01:29:53Z")

</div>

Hello all, I am working on developing a drawing tool for one of my classes and I am having trouble with a specific part of the code. The color variable “x” should increment by 10 when the UP key is pressed and decrement …

---

## [Number Tile Game](https://discourse.processing.org/t/number-tile-game/8342)

<div class="topic-metadata">

**Author:** [@o0804337](https://discourse.processing.org/u/o0804337)\
**Replies:** 5\
**Last updated:** [February 13, 2019, 5:09am UTC](https://discourse.processing.org/t/number-tile-game/8342 "2019-02-13T05:09:12Z")

</div>

\`I am trying to make a tile game where you are supposed to put the numbers in order. So I couldn’t get the numbers into the last row and I trying to get them to move. There isn’t supposed to be a square on the bottom rig…

---

## [\[SOLVED\] Interpolating a continuous bezier curve](https://discourse.processing.org/t/solved-interpolating-a-continuous-bezier-curve/7905)

<div class="topic-metadata">

**Author:** [@Aleksi](https://discourse.processing.org/u/Aleksi)\
**Replies:** 6\
**Last updated:** [February 12, 2019, 11:25pm UTC](https://discourse.processing.org/t/solved-interpolating-a-continuous-bezier-curve/7905 "2019-02-12T23:25:56Z")

</div>

It’s relatively straightforward interpolating a single bezier curve. What I’m looking for is a way to interpolate a continuous bezier curve. I’m assuming it’s possible, and if I wasn’t pressed for time I’d probably figur…

---

## [Gallery with some images](https://discourse.processing.org/t/gallery-with-some-images/8295)

<div class="topic-metadata">

**Author:** [@akjunior](https://discourse.processing.org/u/akjunior)\
**Replies:** 4\
**Last updated:** [February 12, 2019, 5:55pm UTC](https://discourse.processing.org/t/gallery-with-some-images/8295 "2019-02-12T17:55:02Z")

</div>

ir, can i ask u a question? I wrote this code in processing, where you have something like gallery with some images. And if you click on one picture its enlarges. But right now, where ever I click, it is same picture whi…

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

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