# Coding Questions

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

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

**Page:** 21

---

## [Error - Missing “)”](https://discourse.processing.org/t/error-missing/39841)

<div class="topic-metadata">

**Author:** [@Imerso](https://discourse.processing.org/u/Imerso)\
**Replies:** 5\
**Last updated:** [November 23, 2022, 9:00pm UTC](https://discourse.processing.org/t/error-missing/39841 "2022-11-23T21:00:06Z")

</div>

Hello. I am newbie in programming. I’m trying to learn to use it in my work in photography and visual arts. I’m trying to run a code but it always gives Error - Missing “)” in the parts that I’ll put below and I don’t kn…

---

## [Multiple page PDF and draw to screen?](https://discourse.processing.org/t/multiple-page-pdf-and-draw-to-screen/3719)

<div class="topic-metadata">

**Author:** [@stirman](https://discourse.processing.org/u/stirman)\
**Replies:** 8\
**Last updated:** [November 23, 2022, 5:04pm UTC](https://discourse.processing.org/t/multiple-page-pdf-and-draw-to-screen/3719 "2022-11-23T17:04:10Z")

</div>

Is it possible to render a drawing to a multiple page PDF and draw the image to the screen? I can do either or, obviously, but the combination errors out on this line in the draw loop… PGraphicsPDF pdf = (PGraphicsPDF)…

---

## [Collision between rectangles](https://discourse.processing.org/t/collision-between-rectangles/39834)

<div class="topic-metadata">

**Author:** [@turke1034](https://discourse.processing.org/u/turke1034)\
**Replies:** 4\
**Last updated:** [November 23, 2022, 2:51am UTC](https://discourse.processing.org/t/collision-between-rectangles/39834 "2022-11-23T02:51:04Z")

</div>

I am trying to make collision between rectangles in my game. The player can move with W, A, S, D and there are ‘blocks’ that the player is supposed to collide with. I’m able to make it so the player can collide normally …

---

## [Text random position](https://discourse.processing.org/t/text-random-position/39571)

<div class="topic-metadata">

**Author:** [@Moonshiner](https://discourse.processing.org/u/Moonshiner)\
**Replies:** 2\
**Last updated:** [November 22, 2022, 7:37pm UTC](https://discourse.processing.org/t/text-random-position/39571 "2022-11-22T19:37:02Z")

</div>

Hey guys, I’m new to processing. I need a text at a random Position. But text(“Hello”,random(1,500)); isn’t allowed. How do i do that ? Thank you in Advance

---

## [Distort a time graph sample. Transform a shape recorded for 2 seconds into a perfect movement](https://discourse.processing.org/t/distort-a-time-graph-sample-transform-a-shape-recorded-for-2-seconds-into-a-perfect-movement/39828)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 0\
**Last updated:** [November 22, 2022, 2:46pm UTC](https://discourse.processing.org/t/distort-a-time-graph-sample-transform-a-shape-recorded-for-2-seconds-into-a-perfect-movement/39828 "2022-11-22T14:46:41Z")

</div>

Dear everyones :wink: The idea is to record any movement for 2 sec, transform it to loop it (so that the movement is ‘full’) and play it back for exactly 2 sec. To replay the transformed movement, the movement must be d…

---

## [How do I change mouseX, mouseY default origin positions](https://discourse.processing.org/t/how-do-i-change-mousex-mousey-default-origin-positions/39780)

<div class="topic-metadata">

**Author:** [@Siyue](https://discourse.processing.org/u/Siyue)\
**Replies:** 7\
**Last updated:** [November 22, 2022, 3:27pm UTC](https://discourse.processing.org/t/how-do-i-change-mousex-mousey-default-origin-positions/39780 "2022-11-22T15:27:07Z")

</div>

hey guys, this is a very small question. and here is my code: void setup() { size(600, 800); background(20, 40, 80); } void draw() { stroke(30,200,100,40); line(mouseX,mouseY,300,30); } void mousePressed(){back…

---

## [I want to add wind force on this code and also if possible changing the colours in every movement.Can someone help me or give a idea of that?](https://discourse.processing.org/t/i-want-to-add-wind-force-on-this-code-and-also-if-possible-changing-the-colours-in-every-movement-can-someone-help-me-or-give-a-idea-of-that/39819)

<div class="topic-metadata">

**Author:** [@rocky](https://discourse.processing.org/u/rocky)\
**Replies:** 1\
**Last updated:** [November 21, 2022, 10:22pm UTC](https://discourse.processing.org/t/i-want-to-add-wind-force-on-this-code-and-also-if-possible-changing-the-colours-in-every-movement-can-someone-help-me-or-give-a-idea-of-that/39819 "2022-11-21T22:22:01Z")

</div>

Flock flock; void setup() { size(500,500); flock = new Flock(); for (int i=0; i\<100; i++) { Boid b = new Boid(width/1, height/1); flock.addBoid(b); } } void draw() { background(100); flock.run(); } class Boi…

---

## [Random running continously (Card Game, deck of cards)](https://discourse.processing.org/t/random-running-continously-card-game-deck-of-cards/39784)

<div class="topic-metadata">

**Author:** [@BrokenSpace](https://discourse.processing.org/u/BrokenSpace)\
**Replies:** 7\
**Last updated:** [November 21, 2022, 1:18pm UTC](https://discourse.processing.org/t/random-running-continously-card-game-deck-of-cards/39784 "2022-11-21T13:18:03Z")

</div>

I’m making a deck of cards. I have each image of the cards in a 2D array with each value of the array representing suit\[4\] and rank\[13\]. I’m trying to use random to randomly pull an image from it but it just cycles throu…

---

## [Importing PSurfaceAWT](https://discourse.processing.org/t/importing-psurfaceawt/39777)

<div class="topic-metadata">

**Author:** [@Svedblen](https://discourse.processing.org/u/Svedblen)\
**Replies:** 5\
**Last updated:** [November 20, 2022, 11:43am UTC](https://discourse.processing.org/t/importing-psurfaceawt/39777 "2022-11-20T11:43:00Z")

</div>

Hi! I’m new to Processing and also to Java (but not to SW otherwise). I’m trying to piece together a WindowAdapter, and eventually an window listener, but have trouble getting this import to work: import processing.awt…

---

## [Csv does not exist or could not be read (application)](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763)

<div class="topic-metadata">

**Author:** [@Jean-no](https://discourse.processing.org/u/Jean-no)\
**Replies:** 11\
**Last updated:** [November 20, 2022, 12:44am UTC](https://discourse.processing.org/t/csv-does-not-exist-or-could-not-be-read-application/39763 "2022-11-20T00:44:25Z")

</div>

Hi ! My program is quite simple : Table base = loadTable("base.csv"); println(base.getRowCount() + " total rows in table"); And it works well while running it from Processing. The base.csv file is in the data fol…

---

## [Spherical Coordinates and Angle back to Origin?](https://discourse.processing.org/t/spherical-coordinates-and-angle-back-to-origin/39770)

<div class="topic-metadata">

**Author:** [@ASHER](https://discourse.processing.org/u/ASHER)\
**Replies:** 2\
**Last updated:** [November 19, 2022, 12:53pm UTC](https://discourse.processing.org/t/spherical-coordinates-and-angle-back-to-origin/39770 "2022-11-19T12:53:58Z")

</div>

Alright, so I’ve been Googling for several days and cannot figure how to solve what I think is rather simple…? I’ve also searched the forum here and will list at the end some of the links I’ve explored. Context: In 2D I…

---

## [Halftone with custom shape or typography](https://discourse.processing.org/t/halftone-with-custom-shape-or-typography/39767)

<div class="topic-metadata">

**Author:** [@eddg101](https://discourse.processing.org/u/eddg101)\
**Replies:** 2\
**Last updated:** [November 18, 2022, 10:26am UTC](https://discourse.processing.org/t/halftone-with-custom-shape-or-typography/39767 "2022-11-18T10:26:12Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Does anyone know how to create half tone images with custom shapes or an imported shape? Also want to achieve this effect with typography, the …

---

## [Restart using key pressed](https://discourse.processing.org/t/restart-using-key-pressed/39765)

<div class="topic-metadata">

**Author:** [@akar](https://discourse.processing.org/u/akar)\
**Replies:** 5\
**Last updated:** [November 18, 2022, 3:49am UTC](https://discourse.processing.org/t/restart-using-key-pressed/39765 "2022-11-18T03:49:52Z")

</div>

//for the menu int toggle =1; int width=640; int height=360; void setup() { size(1280, 720); } void draw() { background(255); noStroke(); fill(0); float s=5.0; for (int i=0; i\<height; i++) { for (int j=0; j\<w…

---

## [I need help on my number guessing game](https://discourse.processing.org/t/i-need-help-on-my-number-guessing-game/39648)

<div class="topic-metadata">

**Author:** [@codinghelp](https://discourse.processing.org/u/codinghelp)\
**Replies:** 7\
**Last updated:** [November 17, 2022, 10:04pm UTC](https://discourse.processing.org/t/i-need-help-on-my-number-guessing-game/39648 "2022-11-17T22:04:04Z")

</div>

Hi, fellow Coders. I recently got this assignment and I’m halfway through it. It’s a number guessing game. void setup() { size(600,600); background(230,230,255); } int onum = int(random(0,9)); // onum = Origin…

---

## [How to animate a square with circular movement, varying rotation and scale](https://discourse.processing.org/t/how-to-animate-a-square-with-circular-movement-varying-rotation-and-scale/39733)

<div class="topic-metadata">

**Author:** [@Gerardo\_DiazL](https://discourse.processing.org/u/Gerardo_DiazL)\
**Replies:** 1\
**Last updated:** [November 17, 2022, 11:09am UTC](https://discourse.processing.org/t/how-to-animate-a-square-with-circular-movement-varying-rotation-and-scale/39733 "2022-11-17T11:09:17Z")

</div>

//ciclo de vida se translada a processing float rotate=0; void setup(){ size(800,800,P3D); stroke(255); noFill(); } void draw(){ //Limpiar el cuadro anterior de dibujo background(0); //identity float tx=width/…

---

## [Final Project - financial illustration imported from excel value table](https://discourse.processing.org/t/final-project-financial-illustration-imported-from-excel-value-table/39752)

<div class="topic-metadata">

**Author:** [@DanielProwess](https://discourse.processing.org/u/DanielProwess)\
**Replies:** 1\
**Last updated:** [November 17, 2022, 11:01am UTC](https://discourse.processing.org/t/final-project-financial-illustration-imported-from-excel-value-table/39752 "2022-11-17T11:01:08Z")

</div>

Hello, I am beginning a final project for my intro CS class. My goal is to create a program in processing that can take a monthly budget spreadsheet from excel and illustrate it as a multitude of charts. I’d like to hea…

---

## [Top Down View - Pokémon Like](https://discourse.processing.org/t/top-down-view-pokemon-like/39744)

<div class="topic-metadata">

**Author:** [@Afador](https://discourse.processing.org/u/Afador)\
**Replies:** 7\
**Last updated:** [November 16, 2022, 4:44pm UTC](https://discourse.processing.org/t/top-down-view-pokemon-like/39744 "2022-11-16T16:44:10Z")

</div>

I’ve been working on a top down 2d artsytle game, but every time I try to code the top down view I seem to always make it too complicated to reuse or it just flat out doesn’t work. I was hoping someone knew how to code …

---

## [How can i make the size of ellipse keeps the size after i released the mouse](https://discourse.processing.org/t/how-can-i-make-the-size-of-ellipse-keeps-the-size-after-i-released-the-mouse/39694)

<div class="topic-metadata">

**Author:** [@returng](https://discourse.processing.org/u/returng)\
**Replies:** 10\
**Last updated:** [November 16, 2022, 11:17am UTC](https://discourse.processing.org/t/how-can-i-make-the-size-of-ellipse-keeps-the-size-after-i-released-the-mouse/39694 "2022-11-16T11:17:11Z")

</div>

My task it that I have to make the size of the ellipse become smaller as I use mousePressed, but then I need it to keep the size after I released the mouse, not the original size. class Particle{ float x; //X Position …

---

## [Generating font characters from image and upscaling resolution afterwards](https://discourse.processing.org/t/generating-font-characters-from-image-and-upscaling-resolution-afterwards/39723)

<div class="topic-metadata">

**Author:** [@Empyreans](https://discourse.processing.org/u/Empyreans)\
**Replies:** 4\
**Last updated:** [November 16, 2022, 11:33am UTC](https://discourse.processing.org/t/generating-font-characters-from-image-and-upscaling-resolution-afterwards/39723 "2022-11-16T11:33:31Z")

</div>

Hello dear community, I am currently in the situation of creating an ASCII image from a source image. The resulting ASCII image is written to a PGraphics buffer that I save at the end. Of course I use the source images…

---

## [Changing in between figures with a key pressed](https://discourse.processing.org/t/changing-in-between-figures-with-a-key-pressed/39728)

<div class="topic-metadata">

**Author:** [@Katsucchi](https://discourse.processing.org/u/Katsucchi)\
**Replies:** 1\
**Last updated:** [November 16, 2022, 7:37am UTC](https://discourse.processing.org/t/changing-in-between-figures-with-a-key-pressed/39728 "2022-11-16T07:37:39Z")

</div>

Hello I am currently working on a coding assignment, where i am supposed to make 3 different figures, a Cube, a Cone and a Zylinder. Now i am stuck with a problem tho, a part of the assignment is to make the figures cha…

---

## [Help on Number Guess Game](https://discourse.processing.org/t/help-on-number-guess-game/39738)

<div class="topic-metadata">

**Author:** [@codinghelp](https://discourse.processing.org/u/codinghelp)\
**Replies:** 1\
**Last updated:** [November 16, 2022, 7:26am UTC](https://discourse.processing.org/t/help-on-number-guess-game/39738 "2022-11-16T07:26:38Z")

</div>

Hi, Thank you for your help! I’ve done it. After the player guesses correctly, it prompts them for Y to play again and N to exit. After they press Y how would you reset the char? Aka make a new number for them to guess. …

---

## [User input to instances of text](https://discourse.processing.org/t/user-input-to-instances-of-text/39719)

<div class="topic-metadata">

**Author:** [@brandedbow](https://discourse.processing.org/u/brandedbow)\
**Replies:** 1\
**Last updated:** [November 15, 2022, 4:56pm UTC](https://discourse.processing.org/t/user-input-to-instances-of-text/39719 "2022-11-15T16:56:27Z")

</div>

I’m trying to make a chat input space where the user can type in a string of text and when submitted it would appear as an object that is affected by physics. I am stuck because whenever I send a new string of text, the …

---

## [Lines spin animation](https://discourse.processing.org/t/lines-spin-animation/39711)

<div class="topic-metadata">

**Author:** [@add](https://discourse.processing.org/u/add)\
**Replies:** 3\
**Last updated:** [November 15, 2022, 10:50am UTC](https://discourse.processing.org/t/lines-spin-animation/39711 "2022-11-15T10:50:18Z")

</div>

hi! who knows why my lines are distorted after a few seconds after running, even if from the beginning everything works correctly? Thank you in advance float a,b; void setup() { size(100,100); frameRate= 30; } void …

---

## [Displaying Image on Top of Background - Cockpit view jump into hyperspace](https://discourse.processing.org/t/displaying-image-on-top-of-background-cockpit-view-jump-into-hyperspace/39709)

<div class="topic-metadata">

**Author:** [@carlymoj](https://discourse.processing.org/u/carlymoj)\
**Replies:** 3\
**Last updated:** [November 15, 2022, 10:43am UTC](https://discourse.processing.org/t/displaying-image-on-top-of-background-cockpit-view-jump-into-hyperspace/39709 "2022-11-15T10:43:32Z")

</div>

I am trying to create a starfield with an image of a cockpit in front as if the viewer is sitting in a cockpit jumping into hyperspace. I am using Daniel Shiffman’s starfield coding challenge as the inspiration. The code…

---

## [Custom Game project](https://discourse.processing.org/t/custom-game-project/39707)

<div class="topic-metadata">

**Author:** [@JHProcess](https://discourse.processing.org/u/JHProcess)\
**Replies:** 16\
**Last updated:** [November 15, 2022, 3:47am UTC](https://discourse.processing.org/t/custom-game-project/39707 "2022-11-15T03:47:31Z")

</div>

Hello everyone once again! I’m having a problem trying to make a game, i have my concept and have gotten some help from my professor but im still coming up with errors. The concept of the game is you control a bubble th…

---

## [Text and image display](https://discourse.processing.org/t/text-and-image-display/39710)

<div class="topic-metadata">

**Author:** [@add](https://discourse.processing.org/u/add)\
**Replies:** 1\
**Last updated:** [November 14, 2022, 10:07pm UTC](https://discourse.processing.org/t/text-and-image-display/39710 "2022-11-14T22:07:11Z")

</div>

hello. Please help me! I must do this program: Add a rectangle in which the key-input is entered. When the ENTER-key is pressed, show the image corresponding with the entered digit (only the first one if more than one d…

---

## [Help making a painting effect without refreshing background](https://discourse.processing.org/t/help-making-a-painting-effect-without-refreshing-background/39685)

<div class="topic-metadata">

**Author:** [@moffmix](https://discourse.processing.org/u/moffmix)\
**Replies:** 5\
**Last updated:** [November 14, 2022, 9:29pm UTC](https://discourse.processing.org/t/help-making-a-painting-effect-without-refreshing-background/39685 "2022-11-14T21:29:46Z")

</div>

Hi there! Full disclosure, this is a part of a larger assignment for my beginner’s processing class, so if you wouldn’t mind keeping any advice fairly simple I’d really appreciate that! Basically, I’m trying to mimic wh…

---

## [Glsl shader not showing any errors, but neither any output](https://discourse.processing.org/t/glsl-shader-not-showing-any-errors-but-neither-any-output/39628)

<div class="topic-metadata">

**Author:** [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Replies:** 2\
**Last updated:** [November 14, 2022, 12:32pm UTC](https://discourse.processing.org/t/glsl-shader-not-showing-any-errors-but-neither-any-output/39628 "2022-11-14T12:32:34Z")

</div>

When I use this shader, I see no errors, but neither any color is drawn. vert: #version 330 core layout (location = 0) in vec3 aPos; out vec4 vertexColor; void main() { gl\_Position = vec4(aPos, 1.0); vertex…

---

## [Help using rotateX() rotateY() and rotateZ() to make an object pitch yaw and roll](https://discourse.processing.org/t/help-using-rotatex-rotatey-and-rotatez-to-make-an-object-pitch-yaw-and-roll/39652)

<div class="topic-metadata">

**Author:** [@RomketBoi](https://discourse.processing.org/u/RomketBoi)\
**Replies:** 13\
**Last updated:** [November 13, 2022, 5:01pm UTC](https://discourse.processing.org/t/help-using-rotatex-rotatey-and-rotatez-to-make-an-object-pitch-yaw-and-roll/39652 "2022-11-13T17:01:20Z")

</div>

I have a program where I have a spaceship with pitch, yaw, and roll values and I want to rotate everything else to make it seem like the camera is attached to the ship. Currently, this is my code: rotateX(pitch); rotate…

---

## [Why do my ellipse become bigger when it "further away" processing](https://discourse.processing.org/t/why-do-my-ellipse-become-bigger-when-it-further-away-processing/39690)

<div class="topic-metadata">

**Author:** [@returng](https://discourse.processing.org/u/returng)\
**Replies:** 2\
**Last updated:** [November 13, 2022, 12:22pm UTC](https://discourse.processing.org/t/why-do-my-ellipse-become-bigger-when-it-further-away-processing/39690 "2022-11-13T12:22:13Z")

</div>

Hello, I have a problem the ellipse size becomes smaller when I use mousePressed but as it is further away it becomes bigger and bigger. float gravity = .4; int particle\_each\_time = 4; ArrayList\<Particle\> particle= new …

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

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