# Coding Questions

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

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

**Page:** 107

---

## [Golf game mechanics](https://discourse.processing.org/t/golf-game-mechanics/18285)

<div class="topic-metadata">

**Author:** [@Dr.Dremur](https://discourse.processing.org/u/Dr.Dremur)\
**Replies:** 7\
**Last updated:** [March 3, 2020, 12:34am UTC](https://discourse.processing.org/t/golf-game-mechanics/18285 "2020-03-03T00:34:15Z")

</div>

This is my first post since I can’t find what I’m looking for, I am currently trying to create a 2D golf game for my Programming final, and would still like to continue it after its submitted. What I’m trying to accompl…

---

## [Creating a frame timer](https://discourse.processing.org/t/creating-a-frame-timer/18165)

<div class="topic-metadata">

**Author:** [@NotConsumable](https://discourse.processing.org/u/NotConsumable)\
**Replies:** 13\
**Last updated:** [February 27, 2020, 8:22am UTC](https://discourse.processing.org/t/creating-a-frame-timer/18165 "2020-02-27T08:22:30Z")

</div>

I am trying to create a timer that makes an ellipse disappear 2 seconds or 120 frames after the mouse has been pressed, the ellipse and text appear whenever i press my mouse, but they disappear far too fast about 1 frame…

---

## [Help - Cant figure this out](https://discourse.processing.org/t/help-cant-figure-this-out/18291)

<div class="topic-metadata">

**Author:** [@GKBeginner](https://discourse.processing.org/u/GKBeginner)\
**Replies:** 4\
**Last updated:** [March 2, 2020, 7:02am UTC](https://discourse.processing.org/t/help-cant-figure-this-out/18291 "2020-03-02T07:02:27Z")

</div>

This is supposed to produce vertical lines of varying colors and lengths and I can only get it to produce lines of the same color and length. I have looked at it over and over and I can’t figure out what I am doing wron…

---

## [Update the second text](https://discourse.processing.org/t/update-the-second-text/18275)

<div class="topic-metadata">

**Author:** [@MonteliaRO](https://discourse.processing.org/u/MonteliaRO)\
**Replies:** 10\
**Last updated:** [March 1, 2020, 6:41pm UTC](https://discourse.processing.org/t/update-the-second-text/18275 "2020-03-01T18:41:52Z")

</div>

I need Help i would update the second Text can everyone help me Text: int sekunde = second(); int minute = minute(); int stunde = hour(); int tag = day(); int monat = month(); int yahr = year(); void setup(){ fullS…

---

## [Splitting an ArrayList for each PVector (0,0) (updated)](https://discourse.processing.org/t/splitting-an-arraylist-for-each-pvector-0-0-updated/17883)

<div class="topic-metadata">

**Author:** [@AndreasRef](https://discourse.processing.org/u/AndreasRef)\
**Replies:** 16\
**Last updated:** [February 29, 2020, 6:11pm UTC](https://discourse.processing.org/t/splitting-an-arraylist-for-each-pvector-0-0-updated/17883 "2020-02-29T18:11:23Z")

</div>

Hi there :slight\_smile: I have an ArrayList of PVectors that I want to split into two separate ArrayLists. I have found out that you can split Lists using .sublist, but I have only managed to split my ArrayList into two…

---

## [Stroke weight selection](https://discourse.processing.org/t/stroke-weight-selection/18242)

<div class="topic-metadata">

**Author:** [@WeeBoEtte](https://discourse.processing.org/u/WeeBoEtte)\
**Replies:** 6\
**Last updated:** [March 1, 2020, 11:12am UTC](https://discourse.processing.org/t/stroke-weight-selection/18242 "2020-03-01T11:12:39Z")

</div>

I’m trying to make a drawing program with a tool bar, buttons, and a canvas. So far I got a lot done with help from everyone here on this forum, however, when I try click on the 2 line of my 3 line button, it draws the l…

---

## [Problem with hover on area curves](https://discourse.processing.org/t/problem-with-hover-on-area-curves/18120)

<div class="topic-metadata">

**Author:** [@Samizen](https://discourse.processing.org/u/Samizen)\
**Replies:** 3\
**Last updated:** [February 29, 2020, 4:54am UTC](https://discourse.processing.org/t/problem-with-hover-on-area-curves/18120 "2020-02-29T04:54:36Z")

</div>

I am creating a sketch with comparison of different social media uses. I have layered multiple area curves one in front of the other. My intention is to create a hover effect on the point of interest. The problem I ran i…

---

## [Getting my asteroids videogame to work](https://discourse.processing.org/t/getting-my-asteroids-videogame-to-work/17945)

<div class="topic-metadata">

**Author:** [@The-Coder](https://discourse.processing.org/u/The-Coder)\
**Replies:** 3\
**Last updated:** [February 29, 2020, 10:02pm UTC](https://discourse.processing.org/t/getting-my-asteroids-videogame-to-work/17945 "2020-02-29T22:02:46Z")

</div>

I am try to make a sideways meteor dodging game where you are a spaceship that avoids asteroids that fly towards you from the left. My problem is that I have not been able to make a larger than 1 pixel hit box for the as…

---

## [Circumscribe perlin cloud](https://discourse.processing.org/t/circumscribe-perlin-cloud/12152)

<div class="topic-metadata">

**Author:** [@excalibas](https://discourse.processing.org/u/excalibas)\
**Replies:** 3\
**Last updated:** [February 29, 2020, 3:55pm UTC](https://discourse.processing.org/t/circumscribe-perlin-cloud/12152 "2020-02-29T15:55:00Z")

</div>

Hello, I am trying to draw something that looks like a cloud. I like the effect I get with using perlin noise like this: float t1 = 0.0; float t2 = 10000; void setup(){ size(700,700); noLoop(); loadPixels(); } …

---

## [It won't select colors or stroke weight when I make the draw-program only draw in a specific area](https://discourse.processing.org/t/it-wont-select-colors-or-stroke-weight-when-i-make-the-draw-program-only-draw-in-a-specific-area/18122)

<div class="topic-metadata">

**Author:** [@WeeBoEtte](https://discourse.processing.org/u/WeeBoEtte)\
**Replies:** 7\
**Last updated:** [February 29, 2020, 2:44pm UTC](https://discourse.processing.org/t/it-wont-select-colors-or-stroke-weight-when-i-make-the-draw-program-only-draw-in-a-specific-area/18122 "2020-02-29T14:44:57Z")

</div>

I am trying to make a drawing program where it only draws in a rectangle made in setup. I want to still be able to use my color, size, and clearing ability that I made, but I can’t figure it out. Any tips would be great. …

---

## [Generating natural-looking terrain from a few known peaks](https://discourse.processing.org/t/generating-natural-looking-terrain-from-a-few-known-peaks/18233)

<div class="topic-metadata">

**Author:** [@dandotdot](https://discourse.processing.org/u/dandotdot)\
**Replies:** 1\
**Last updated:** [February 29, 2020, 1:39am UTC](https://discourse.processing.org/t/generating-natural-looking-terrain-from-a-few-known-peaks/18233 "2020-02-29T01:39:50Z")

</div>

Hi clever people, I’m trying to find the best way to generate terrain that looks natural-ish (Which I suppose mainly means peaks descending as valleys and ridges, rather than a single plane). I know the heights of a bu…

---

## [Help with click to shoot](https://discourse.processing.org/t/help-with-click-to-shoot/18195)

<div class="topic-metadata">

**Author:** [@roguecode](https://discourse.processing.org/u/roguecode)\
**Replies:** 6\
**Last updated:** [February 28, 2020, 10:52pm UTC](https://discourse.processing.org/t/help-with-click-to-shoot/18195 "2020-02-28T22:52:33Z")

</div>

hello i need help with my code. i need to be able to click the picture with the cross hair and for it to fall but nothing ive done seems to work. if possible could you guys show me how to do it using a while loop? also h…

---

## [I want to make stickmans move](https://discourse.processing.org/t/i-want-to-make-stickmans-move/18204)

<div class="topic-metadata">

**Author:** [@seojin051005](https://discourse.processing.org/u/seojin051005)\
**Replies:** 2\
**Last updated:** [February 28, 2020, 8:38am UTC](https://discourse.processing.org/t/i-want-to-make-stickmans-move/18204 "2020-02-28T08:38:57Z")

</div>

Hello, I’m currently learning how to use processing in the school for an upcoming big project- making an advertisement for sports day. For my advert, I want to make my stickman running by animating the stickmans, but I d…

---

## [Slower and laggy Processing 3 sketch with a larger window](https://discourse.processing.org/t/slower-and-laggy-processing-3-sketch-with-a-larger-window/17975)

<div class="topic-metadata">

**Author:** [@Ackados](https://discourse.processing.org/u/Ackados)\
**Replies:** 1\
**Last updated:** [February 28, 2020, 1:30am UTC](https://discourse.processing.org/t/slower-and-laggy-processing-3-sketch-with-a-larger-window/17975 "2020-02-28T01:30:49Z")

</div>

I am trying to create an app that can be resized depending on the user’s preference. The app for now is going to be a grid that can be moved around. At the default (and small) size, it runs pretty well and fast. But whe…

---

## [Help game code question](https://discourse.processing.org/t/help-game-code-question/18197)

<div class="topic-metadata">

**Author:** [@lupos](https://discourse.processing.org/u/lupos)\
**Replies:** 8\
**Last updated:** [February 27, 2020, 9:26pm UTC](https://discourse.processing.org/t/help-game-code-question/18197 "2020-02-27T21:26:43Z")

</div>

I am working on a game in processing for my university project but I have a problem. when the game patterns change their positions wont reset. if you let the pattern loop you will see what I mean can anyone help me? cod…

---

## [Make smiley go bigger or smaller without changing](https://discourse.processing.org/t/make-smiley-go-bigger-or-smaller-without-changing/18173)

<div class="topic-metadata">

**Author:** [@M.juliet](https://discourse.processing.org/u/M.juliet)\
**Replies:** 3\
**Last updated:** [February 27, 2020, 3:48pm UTC](https://discourse.processing.org/t/make-smiley-go-bigger-or-smaller-without-changing/18173 "2020-02-27T15:48:09Z")

</div>

Hi, I’m writing some code where I need to draw smiley’s. Now I already have the smiley’s but I need to change the position and the size of the smiley with functions. The only thing I still need to do is change the size b…

---

## [I am getting an "expecting EOF found }" error, how do I fix this?](https://discourse.processing.org/t/i-am-getting-an-expecting-eof-found-error-how-do-i-fix-this/18115)

<div class="topic-metadata">

**Author:** [@The-Coder](https://discourse.processing.org/u/The-Coder)\
**Replies:** 6\
**Last updated:** [February 26, 2020, 8:30pm UTC](https://discourse.processing.org/t/i-am-getting-an-expecting-eof-found-error-how-do-i-fix-this/18115 "2020-02-26T20:30:47Z")

</div>

//Asteroid Dodge void setup() { background(0, 0, 0); size(1000, 900); noLoop(); print ("press the mouse to start the game use the arrow keys to move your ship"); } void draw() { // controls game states float …

---

## [How can I constantly save variables in tables as the program runs?](https://discourse.processing.org/t/how-can-i-constantly-save-variables-in-tables-as-the-program-runs/18160)

<div class="topic-metadata">

**Author:** [@abdullahmq](https://discourse.processing.org/u/abdullahmq)\
**Replies:** 3\
**Last updated:** [February 27, 2020, 8:06am UTC](https://discourse.processing.org/t/how-can-i-constantly-save-variables-in-tables-as-the-program-runs/18160 "2020-02-27T08:06:42Z")

</div>

Hi, I am using saveTable() function in my code and the problem I am getting is that my table is constantly saved after every 20 seconds but after about 400 rows I start to get rows with only zeros…I am really confused…re…

---

## [Chunk loading possibility's](https://discourse.processing.org/t/chunk-loading-possibilitys/18146)

<div class="topic-metadata">

**Author:** [@Phaleron](https://discourse.processing.org/u/Phaleron)\
**Replies:** 3\
**Last updated:** [February 26, 2020, 10:16pm UTC](https://discourse.processing.org/t/chunk-loading-possibilitys/18146 "2020-02-26T22:16:35Z")

</div>

Hi all, I am struggling a bit deciding what i should use with my chunk loading system. my initial idea was to cycle trough all possible locations around the player, check if the chunk already exist, if not, create a ne…

---

## [Why does this code run as desired but the flow of colors seems backwards](https://discourse.processing.org/t/why-does-this-code-run-as-desired-but-the-flow-of-colors-seems-backwards/18149)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 12\
**Last updated:** [February 26, 2020, 9:51pm UTC](https://discourse.processing.org/t/why-does-this-code-run-as-desired-but-the-flow-of-colors-seems-backwards/18149 "2020-02-26T21:51:39Z")

</div>

I guess this is primarily a question about flow of the program – aka what’s going on under the hood. The code does run and mouse interaction is as desired, but I don’t understand why. Probably something simple I’m not se…

---

## [Generative photo collage](https://discourse.processing.org/t/generative-photo-collage/18129)

<div class="topic-metadata">

**Author:** [@jeaan](https://discourse.processing.org/u/jeaan)\
**Replies:** 2\
**Last updated:** [February 26, 2020, 2:17pm UTC](https://discourse.processing.org/t/generative-photo-collage/18129 "2020-02-26T14:17:18Z")

</div>

I’m attempting to create a visual collage with the same effect as this one: Multiplicity + Masking + Cropping + Size Variation + Random Placement are the key factors I’d like to integrate.I’m new to Processing so I’m …

---

## [Random walker through points](https://discourse.processing.org/t/random-walker-through-points/18040)

<div class="topic-metadata">

**Author:** [@Giyomu](https://discourse.processing.org/u/Giyomu)\
**Replies:** 15\
**Last updated:** [February 26, 2020, 10:50am UTC](https://discourse.processing.org/t/random-walker-through-points/18040 "2020-02-26T10:50:30Z")

</div>

Hi there, I am working on a random walker through points, and I am struggling to get the next closest point in the walker class. The idea is to have one or few random walkers going from point to point until there is no…

---

## [Why won't this run? (keyPressed)](https://discourse.processing.org/t/why-wont-this-run-keypressed/18082)

<div class="topic-metadata">

**Author:** [@ebec4](https://discourse.processing.org/u/ebec4)\
**Replies:** 25\
**Last updated:** [February 26, 2020, 1:46pm UTC](https://discourse.processing.org/t/why-wont-this-run-keypressed/18082 "2020-02-26T13:46:11Z")

</div>

void setup() { frameRate(10); size(500, 500); } void draw() { background(200); if (keyPressed) { if (key == CODED) { if (keyCode == UP) { color c20=color(108,52,131); //PUR…

---

## [Varying scale at frameCount](https://discourse.processing.org/t/varying-scale-at-framecount/17896)

<div class="topic-metadata">

**Author:** [@ChrisHaz3ll](https://discourse.processing.org/u/ChrisHaz3ll)\
**Replies:** 2\
**Last updated:** [February 26, 2020, 8:41am UTC](https://discourse.processing.org/t/varying-scale-at-framecount/17896 "2020-02-26T08:41:30Z")

</div>

I have an animation that graduates between colours at intervals… I’m also exploring how to adjust the scale at varying points along frameCount… I’ve tried tinkering with scale at different points (both within the for loo…

---

## [Drawing hexagon grid radially from center](https://discourse.processing.org/t/drawing-hexagon-grid-radially-from-center/17874)

<div class="topic-metadata">

**Author:** [@ddownn](https://discourse.processing.org/u/ddownn)\
**Replies:** 2\
**Last updated:** [February 26, 2020, 12:54am UTC](https://discourse.processing.org/t/drawing-hexagon-grid-radially-from-center/17874 "2020-02-26T00:54:58Z")

</div>

Is there a single formula I can use for dist that will bring these red hexagons to the right place? dist = unitDiameter \* 0.75 works for ringNum\[2\], then the more distant rings start getting too close. PVector figureCe…

---

## [Beginner: help with classes and game](https://discourse.processing.org/t/beginner-help-with-classes-and-game/18074)

<div class="topic-metadata">

**Author:** [@amprocessing](https://discourse.processing.org/u/amprocessing)\
**Replies:** 7\
**Last updated:** [February 25, 2020, 11:01pm UTC](https://discourse.processing.org/t/beginner-help-with-classes-and-game/18074 "2020-02-25T23:01:58Z")

</div>

So I am making a small maze game. I want to add objects that when the ball touches it, they die. I have been practicing on another sketch. I’ve used classes for the aliens and the ball, as I thought this would be the bes…

---

## [Weird rectangle](https://discourse.processing.org/t/weird-rectangle/18073)

<div class="topic-metadata">

**Author:** [@bugotc14](https://discourse.processing.org/u/bugotc14)\
**Replies:** 6\
**Last updated:** [February 25, 2020, 8:40pm UTC](https://discourse.processing.org/t/weird-rectangle/18073 "2020-02-25T20:40:01Z")

</div>

run the code and see, IDK why but the rectangle position is so weird, I tried to make a button and make it in the middle but for some reason, it won’t work int rectSizeX = 300,rectSizeY = 250; // X and Y size of re…

---

## [Applying bounds to a force directed graph](https://discourse.processing.org/t/applying-bounds-to-a-force-directed-graph/18045)

<div class="topic-metadata">

**Author:** [@dandotdot](https://discourse.processing.org/u/dandotdot)\
**Replies:** 4\
**Last updated:** [February 25, 2020, 9:47am UTC](https://discourse.processing.org/t/applying-bounds-to-a-force-directed-graph/18045 "2020-02-25T09:47:43Z")

</div>

Hi there, I have a sketch that uses a force directed graph code example I found, but there’s nothing in it to stop clusters of nodes drifting off-screen due to the repulsive force, and the fact that clusters are not alw…

---

## [Monitoring process of ffmpeg in processing](https://discourse.processing.org/t/monitoring-process-of-ffmpeg-in-processing/17950)

<div class="topic-metadata">

**Author:** [@tribblesontoast](https://discourse.processing.org/u/tribblesontoast)\
**Replies:** 7\
**Last updated:** [February 25, 2020, 5:32am UTC](https://discourse.processing.org/t/monitoring-process-of-ffmpeg-in-processing/17950 "2020-02-25T05:32:10Z")

</div>

Hi all, I’m using ffmpeg to output audio tracks from videos using the example by Hamoid found here but slightly modified (code below). What I would like to do is to pipe the progress from ffmpeg back into processing so…

---

## [Drawing connected lines with keystroke commands](https://discourse.processing.org/t/drawing-connected-lines-with-keystroke-commands/17947)

<div class="topic-metadata">

**Author:** [@MichelO](https://discourse.processing.org/u/MichelO)\
**Replies:** 8\
**Last updated:** [February 24, 2020, 2:09pm UTC](https://discourse.processing.org/t/drawing-connected-lines-with-keystroke-commands/17947 "2020-02-24T14:09:53Z")

</div>

I have been trying to write a code that will allow me to press numbers keys and draw lines of that length, each connected to the one before. Ideally, the image would rotate 90 degrees between each line segment. In other …

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

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