# Coding Questions

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

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

**Page:** 69

---

## [Countdown d, h, min, sec and ms?](https://discourse.processing.org/t/countdown-d-h-min-sec-and-ms/18145)

<div class="topic-metadata">

**Author:** [@Teljemo](https://discourse.processing.org/u/Teljemo)\
**Replies:** 13\
**Last updated:** [December 20, 2020, 1:48pm UTC](https://discourse.processing.org/t/countdown-d-h-min-sec-and-ms/18145 "2020-12-20T13:48:37Z")

</div>

Hi I googled this a fair amount now and cant really find a answer. Can someone point me in the right direction here :slight\_smile: I’ve just got a date for when we will have a visit from the man who owns our company. …

---

## [Struggling to implement a pause/delay within my for-loop](https://discourse.processing.org/t/struggling-to-implement-a-pause-delay-within-my-for-loop/26313)

<div class="topic-metadata">

**Author:** [@mon](https://discourse.processing.org/u/mon)\
**Replies:** 15\
**Last updated:** [December 20, 2020, 1:51am UTC](https://discourse.processing.org/t/struggling-to-implement-a-pause-delay-within-my-for-loop/26313 "2020-12-20T01:51:36Z")

</div>

Beginner here. I am developing a program that involves drawing a grid of cells, in a row-by-row fashion. I want the program to draw a row of cells, then pause for a short time (say 1 second) before moving down and drawi…

---

## [Help determining data type](https://discourse.processing.org/t/help-determining-data-type/26233)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 14\
**Last updated:** [December 19, 2020, 11:57pm UTC](https://discourse.processing.org/t/help-determining-data-type/26233 "2020-12-19T23:57:03Z")

</div>

Hi! I started doing the java coding challenges from edabit.com. There is a challenge where you need to filter out Strings from an array and only leave numbers. https://edabit.com/challenge/vNszi3mbJA5BhgGFX ( turn \[4,1…

---

## [Strange text-displacement within grid-spaced typography](https://discourse.processing.org/t/strange-text-displacement-within-grid-spaced-typography/26384)

<div class="topic-metadata">

**Author:** [@Namrad](https://discourse.processing.org/u/Namrad)\
**Replies:** 1\
**Last updated:** [December 19, 2020, 4:45pm UTC](https://discourse.processing.org/t/strange-text-displacement-within-grid-spaced-typography/26384 "2020-12-19T16:45:41Z")

</div>

Hello, The idea for a project I’m working on rests on the use of typography in a grid. I wanted to put one letter in the center (x) of every cell of this grid. The size of the letter would be determined/altered by an un…

---

## [How to bounce a ball off a randomly generated line?](https://discourse.processing.org/t/how-to-bounce-a-ball-off-a-randomly-generated-line/26379)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 1\
**Last updated:** [December 19, 2020, 11:13am UTC](https://discourse.processing.org/t/how-to-bounce-a-ball-off-a-randomly-generated-line/26379 "2020-12-19T11:13:39Z")

</div>

Hi! I recently made a bouncing ball program float x = 300, y = 300, r = 30, xs = 10, ys = 8, friction = 0.9; void setup() { size(600,600); } void draw() { background(0); circle(x,y,r\*2); x+=xs; y+=ys; i…

---

## [For-loop problem: space between rotating squares](https://discourse.processing.org/t/for-loop-problem-space-between-rotating-squares/26370)

<div class="topic-metadata">

**Author:** [@trelosti](https://discourse.processing.org/u/trelosti)\
**Replies:** 2\
**Last updated:** [December 19, 2020, 8:18am UTC](https://discourse.processing.org/t/for-loop-problem-space-between-rotating-squares/26370 "2020-12-19T08:18:01Z")

</div>

Good day, I am a beginner in Processing and programming in general, and recently my teacher gave me a task to implement the following thing in Processing: draw a big square consisting of smaller squares and move it acro…

---

## [bezierVertex() draws straight lines, not a curved line?](https://discourse.processing.org/t/beziervertex-draws-straight-lines-not-a-curved-line/3139)

<div class="topic-metadata">

**Author:** [@tony](https://discourse.processing.org/u/tony)\
**Replies:** 7\
**Last updated:** [December 18, 2020, 7:27pm UTC](https://discourse.processing.org/t/beziervertex-draws-straight-lines-not-a-curved-line/3139 "2020-12-18T19:27:15Z")

</div>

I thought I was using bezierVertex() correctly, but what the hey. void setup() { size(512,512); PShape bez = createShape(); bez.beginShape(); bez.noFill(); bez.stroke(255,0,0); bez.strokeWeight(2); bez.…

---

## [Png save and screen capture producing different results](https://discourse.processing.org/t/png-save-and-screen-capture-producing-different-results/26296)

<div class="topic-metadata">

**Author:** [@saltandonion](https://discourse.processing.org/u/saltandonion)\
**Replies:** 3\
**Last updated:** [December 18, 2020, 6:28pm UTC](https://discourse.processing.org/t/png-save-and-screen-capture-producing-different-results/26296 "2020-12-18T18:28:10Z")

</div>

has anyone else noticed saving a frame to png alters the colors from processing? i setup a code that just randomly creates 100 squares of random colors. i save the frame as a png and take a screen shot. the colors are s…

---

## [Scaling problem : newbie ahead :)](https://discourse.processing.org/t/scaling-problem-newbie-ahead/26367)

<div class="topic-metadata">

**Author:** [@galleon](https://discourse.processing.org/u/galleon)\
**Replies:** 4\
**Last updated:** [December 18, 2020, 5:05pm UTC](https://discourse.processing.org/t/scaling-problem-newbie-ahead/26367 "2020-12-18T17:05:06Z")

</div>

Hello all, I have started processing this morning even though I have a programming background. I am trying to do a very simple thing a square in a square :slight\_smile: This code is basically doing what I want. ce…

---

## [Odd behavior from curveVertex() - What am I doing wrong?](https://discourse.processing.org/t/odd-behavior-from-curvevertex-what-am-i-doing-wrong/26257)

<div class="topic-metadata">

**Author:** [@brendanbeck](https://discourse.processing.org/u/brendanbeck)\
**Replies:** 1\
**Last updated:** [December 15, 2020, 1:00pm UTC](https://discourse.processing.org/t/odd-behavior-from-curvevertex-what-am-i-doing-wrong/26257 "2020-12-15T13:00:07Z")

</div>

My curveVertex() calls seem to not be drawing points at my intended location. Notice for each iteration of draw(), I call curveVertex(0,0), yet no spline begins from the top left of the entire canvas. Am I using curveVer…

---

## [Making a game in processing - My first project](https://discourse.processing.org/t/making-a-game-in-processing-my-first-project/26216)

<div class="topic-metadata">

**Author:** [@GoWithTheFloe](https://discourse.processing.org/u/GoWithTheFloe)\
**Replies:** 4\
**Last updated:** [December 18, 2020, 2:29pm UTC](https://discourse.processing.org/t/making-a-game-in-processing-my-first-project/26216 "2020-12-18T14:29:23Z")

</div>

Hello guys. I’ve bee fighting a lot now to get the objects spawn right. The game have 3 elements spawning but the problem is to make them spawn after an object is pressed. I tried to use boolean but it won’t work and wi…

---

## [Help me add the Explode java example to a program](https://discourse.processing.org/t/help-me-add-the-explode-java-example-to-a-program/26345)

<div class="topic-metadata">

**Author:** [@megang](https://discourse.processing.org/u/megang)\
**Replies:** 1\
**Last updated:** [December 18, 2020, 10:12am UTC](https://discourse.processing.org/t/help-me-add-the-explode-java-example-to-a-program/26345 "2020-12-18T10:12:12Z")

</div>

Here is my program: PImage img0; PImage img1; PImage img2; PImage img3; ArrayList images; int width = 1280; int height = 850; void setup() { size(1280, 850); noFill(); stroke(255); frameRate(15); images = ne…

---

## [Help me with a scoring system?](https://discourse.processing.org/t/help-me-with-a-scoring-system/26338)

<div class="topic-metadata">

**Author:** [@reneetjuh](https://discourse.processing.org/u/reneetjuh)\
**Replies:** 12\
**Last updated:** [December 18, 2020, 9:51am UTC](https://discourse.processing.org/t/help-me-with-a-scoring-system/26338 "2020-12-18T09:51:08Z")

</div>

hey everyone reading this! so im wokring on a small project and im super stuck. How do I added a scoring system? so there is a mouse (animal) that’s on the mouse(pc) and I want him to collect cheese trough the game. N…

---

## [Adding a feature to a gravity simulator](https://discourse.processing.org/t/adding-a-feature-to-a-gravity-simulator/26278)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 4\
**Last updated:** [December 18, 2020, 9:44am UTC](https://discourse.processing.org/t/adding-a-feature-to-a-gravity-simulator/26278 "2020-12-18T09:44:29Z")

</div>

Hi! I started creating yet another project! It is a gravity simulator. It started out fine but when I added a feature that makes the two circles “solid” (they can’t overlap) it started going weird. It just bounces infin…

---

## [Typography, Font problem](https://discourse.processing.org/t/typography-font-problem/26342)

<div class="topic-metadata">

**Author:** [@toc\_toc\_toc](https://discourse.processing.org/u/toc_toc_toc)\
**Replies:** 3\
**Last updated:** [December 17, 2020, 9:24pm UTC](https://discourse.processing.org/t/typography-font-problem/26342 "2020-12-17T21:24:18Z")

</div>

Hello, I have got some problem with my typography, first when i load my font (in police generator) , I can’t have mort than 50pt for the size and so when I want to write it bigger with textSize() the rendering is blurre…

---

## [Load and display Table in "textbox"](https://discourse.processing.org/t/load-and-display-table-in-textbox/26305)

<div class="topic-metadata">

**Author:** [@hannes](https://discourse.processing.org/u/hannes)\
**Replies:** 6\
**Last updated:** [December 17, 2020, 3:12pm UTC](https://discourse.processing.org/t/load-and-display-table-in-textbox/26305 "2020-12-17T15:12:46Z")

</div>

Hey Guys, im struggling to load and display my .csv the right way. I have 4 columns, each with 10 words and I want to display each column in one textbox. (I found that textbox example here on the forums) I know how to …

---

## [Help with a exercise (making circle packing 3d)](https://discourse.processing.org/t/help-with-a-exercise-making-circle-packing-3d/26332)

<div class="topic-metadata">

**Author:** [@DariaSuzanne](https://discourse.processing.org/u/DariaSuzanne)\
**Replies:** 13\
**Last updated:** [December 17, 2020, 2:34pm UTC](https://discourse.processing.org/t/help-with-a-exercise-making-circle-packing-3d/26332 "2020-12-17T14:34:00Z")

</div>

Hello! I need help turning this 2d code into 3d. I have recently started using processing, so 3d processing is a bit of a stretch for me. I am basically just trying to turn the circles into spheres, nothing more extreme…

---

## [Creating a rose drawing with sine function and other trig functions](https://discourse.processing.org/t/creating-a-rose-drawing-with-sine-function-and-other-trig-functions/26315)

<div class="topic-metadata">

**Author:** [@SadCSstudent](https://discourse.processing.org/u/SadCSstudent)\
**Replies:** 12\
**Last updated:** [December 17, 2020, 12:55pm UTC](https://discourse.processing.org/t/creating-a-rose-drawing-with-sine-function-and-other-trig-functions/26315 "2020-12-17T12:55:00Z")

</div>

Hey its me again… I’m trying to create a rose drawing using a for loop(compulsory) AKA a polar curve but i cant point out whats wrong with my code.(this is not an assignment this is personal study) int STEPS=100; final…

---

## [Pacman game with grid and custom character](https://discourse.processing.org/t/pacman-game-with-grid-and-custom-character/26311)

<div class="topic-metadata">

**Author:** [@Lozza](https://discourse.processing.org/u/Lozza)\
**Replies:** 2\
**Last updated:** [December 17, 2020, 7:51am UTC](https://discourse.processing.org/t/pacman-game-with-grid-and-custom-character/26311 "2020-12-17T07:51:57Z")

</div>

Im making a pac-man game but with my own character(.png of the character’s run cycle), I’m using a grid to make the maze barriers but cant get my sprite’s walk cycle to appear on the grid, is there even a way to use cust…

---

## [Simple random string question](https://discourse.processing.org/t/simple-random-string-question/26273)

<div class="topic-metadata">

**Author:** [@SadCSstudent](https://discourse.processing.org/u/SadCSstudent)\
**Replies:** 8\
**Last updated:** [December 15, 2020, 6:21pm UTC](https://discourse.processing.org/t/simple-random-string-question/26273 "2020-12-15T18:21:35Z")

</div>

Hi, I’m trying to make the characters appear on the canvas one the character is pressed but they all seem to appear on the same location and overlap each other. int x=int(random(25,450)); int y=int(random(25,450)); St…

---

## [Trouble manipulating single cells in an array](https://discourse.processing.org/t/trouble-manipulating-single-cells-in-an-array/26291)

<div class="topic-metadata">

**Author:** [@Aerosault](https://discourse.processing.org/u/Aerosault)\
**Replies:** 2\
**Last updated:** [December 16, 2020, 2:14pm UTC](https://discourse.processing.org/t/trouble-manipulating-single-cells-in-an-array/26291 "2020-12-16T14:14:58Z")

</div>

Hello! I any currently working on a grid of gradients. Each gradient is a shape. I want to tie the right and left mouse clicks to expand or contract the width of the object the mouse is hovering over. I also want the row…

---

## [Collision with Spring Dynamics](https://discourse.processing.org/t/collision-with-spring-dynamics/26148)

<div class="topic-metadata">

**Author:** [@papaboo](https://discourse.processing.org/u/papaboo)\
**Replies:** 7\
**Last updated:** [December 16, 2020, 11:35am UTC](https://discourse.processing.org/t/collision-with-spring-dynamics/26148 "2020-12-16T11:35:59Z")

</div>

Hi I’m trying to enable bouncing balls effect with spring dynamics. I’ve tweaked the chain example a bit a here’s the code I’m working on: Spring2D s1, s2; float gravity = 9.0; float mass = 5; void setup() { size(…

---

## [Is there a trick to getting .otf fonts to work?](https://discourse.processing.org/t/is-there-a-trick-to-getting-otf-fonts-to-work/26277)

<div class="topic-metadata">

**Author:** [@CaseyJ](https://discourse.processing.org/u/CaseyJ)\
**Replies:** 2\
**Last updated:** [December 16, 2020, 12:22am UTC](https://discourse.processing.org/t/is-there-a-trick-to-getting-otf-fonts-to-work/26277 "2020-12-16T00:22:54Z")

</div>

Hello, Working on a project using the “Bookmania” font. It is an .otf font and I am on Windows 10 using Processing 3. For whatever reason it works fine on Mac OSX… https://allbestfonts.com/bookmania/ When I run the co…

---

## [Don\`t work void mousePressed](https://discourse.processing.org/t/don-t-work-void-mousepressed/26280)

<div class="topic-metadata">

**Author:** [@pundy](https://discourse.processing.org/u/pundy)\
**Replies:** 2\
**Last updated:** [December 15, 2020, 9:20pm UTC](https://discourse.processing.org/t/don-t-work-void-mousepressed/26280 "2020-12-15T21:20:45Z")

</div>

int K = 2; int L1 = 1; int P1 = 0; int L2 = 3; int P2 = 4; color k1,k2,l1,l2,p1,p2,l3,l4,p3,p4,len,len2,ban,ban2; void setup(){ size(500,500); background(145, 209, 189); k1=color(255,70,64); k2=color(194,53,48)…

---

## [Issues with arrayLists2](https://discourse.processing.org/t/issues-with-arraylists2/26221)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 5\
**Last updated:** [December 15, 2020, 8:13pm UTC](https://discourse.processing.org/t/issues-with-arraylists2/26221 "2020-12-15T20:13:03Z")

</div>

Hi! I am doing a customizable fractal tree program. I have some issues; Why does this happen? why this (“kinda”) works: ArrayList\<Float\> x = new ArrayList\<Float\>(); ArrayList\<Float\> y = new ArrayList\<Float\>(); ArrayLis…

---

## [Needing help to rotate the camera around an object by moving the mouse away from the middle of the screen](https://discourse.processing.org/t/needing-help-to-rotate-the-camera-around-an-object-by-moving-the-mouse-away-from-the-middle-of-the-screen/26247)

<div class="topic-metadata">

**Author:** [@SailorToei](https://discourse.processing.org/u/SailorToei)\
**Replies:** 1\
**Last updated:** [December 15, 2020, 3:23pm UTC](https://discourse.processing.org/t/needing-help-to-rotate-the-camera-around-an-object-by-moving-the-mouse-away-from-the-middle-of-the-screen/26247 "2020-12-15T15:23:00Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hello everybody, I want to create a game, where you can walk sideways straight forward etc, with the camera always 200 pixels behind the “Figur”…

---

## [Needing help for camera rotation in 3D with rotateY](https://discourse.processing.org/t/needing-help-for-camera-rotation-in-3d-with-rotatey/26195)

<div class="topic-metadata">

**Author:** [@SailorToei](https://discourse.processing.org/u/SailorToei)\
**Replies:** 1\
**Last updated:** [December 15, 2020, 3:20pm UTC](https://discourse.processing.org/t/needing-help-for-camera-rotation-in-3d-with-rotatey/26195 "2020-12-15T15:20:38Z")

</div>

Hello, I already asked a question about turning the movement direction withmovingthe mouse in3D. It was successfully answered. However, now I want to turn the camera as well. \< void kamera() { camera(xCam,yCam,zCam…

---

## [Parse SVG file from Adobe Illustrator](https://discourse.processing.org/t/parse-svg-file-from-adobe-illustrator/1226)

<div class="topic-metadata">

**Author:** [@josephh](https://discourse.processing.org/u/josephh)\
**Replies:** 11\
**Last updated:** [December 15, 2020, 11:31am UTC](https://discourse.processing.org/t/parse-svg-file-from-adobe-illustrator/1226 "2020-12-15T11:31:20Z")

</div>

Hello there, I’m trying to parse a SVG file exported from Adobe Illustrator by using the PShape method ps.getChild(index);. At the end I want to extract the coordinates and the size of all the rectangles. The problem …

---

## [Creating a clickable dynamic grid](https://discourse.processing.org/t/creating-a-clickable-dynamic-grid/26259)

<div class="topic-metadata">

**Author:** [@Reynaert98](https://discourse.processing.org/u/Reynaert98)\
**Replies:** 1\
**Last updated:** [December 15, 2020, 11:25am UTC](https://discourse.processing.org/t/creating-a-clickable-dynamic-grid/26259 "2020-12-15T11:25:57Z")

</div>

I have to create a dynamic grid for a memory game in which cards are placed within a rectangle on my screen which have to be clickable. Before the grid is drawn I have a starting screen in which the user has to select th…

---

## [Switching between scenes with buttons as choices](https://discourse.processing.org/t/switching-between-scenes-with-buttons-as-choices/19400)

<div class="topic-metadata">

**Author:** [@haree2000](https://discourse.processing.org/u/haree2000)\
**Replies:** 21\
**Last updated:** [December 15, 2020, 8:01am UTC](https://discourse.processing.org/t/switching-between-scenes-with-buttons-as-choices/19400 "2020-12-15T08:01:12Z")

</div>

Hi! I am sooo new to coding, I got to where I am through my friends and jumping around a lot but I am basically trying to make an interactive story and I found out how to make the text bubbles and to go to the next scen…

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

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