# Coding Questions

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

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

**Page:** 166

---

## [Need help on a short animation](https://discourse.processing.org/t/need-help-on-a-short-animation/5438)

<div class="topic-metadata">

**Author:** [@Robin73](https://discourse.processing.org/u/Robin73)\
**Replies:** 2\
**Last updated:** [November 11, 2018, 12:24pm UTC](https://discourse.processing.org/t/need-help-on-a-short-animation/5438 "2018-11-11T12:24:44Z")

</div>

so i had in mind to make spawn 3000 pac man at the same time in random (x;y) and i want them to go on the right. But when i try only one spawn in random(x;y) and he is nice going on the right but i can’t make spawn 3000 …

---

## [How to access all variables of a single class?](https://discourse.processing.org/t/how-to-access-all-variables-of-a-single-class/5409)

<div class="topic-metadata">

**Author:** [@Architector\_4](https://discourse.processing.org/u/Architector_4)\
**Replies:** 5\
**Last updated:** [November 11, 2018, 11:14am UTC](https://discourse.processing.org/t/how-to-access-all-variables-of-a-single-class/5409 "2018-11-11T11:14:56Z")

</div>

Say, for example, I have this class: class thing{ float x; float y; String z; String w; boolean omega; int foo; thing(){} //A meh constructor, I know. .\_. } And I want to repeat a specific set of code on …

---

## [Is there a way to have an image on top of animation?](https://discourse.processing.org/t/is-there-a-way-to-have-an-image-on-top-of-animation/5419)

<div class="topic-metadata">

**Author:** [@josie](https://discourse.processing.org/u/josie)\
**Replies:** 5\
**Last updated:** [November 11, 2018, 4:38am UTC](https://discourse.processing.org/t/is-there-a-way-to-have-an-image-on-top-of-animation/5419 "2018-11-11T04:38:55Z")

</div>

Hi, I’m very new to processing, so I’m sorry if I make many mistakes! I have to use processing for a project and I was able to get this down: Lines\[\] lines = new Lines\[100\]; void setup(){ size(800,800); for(int i = …

---

## [Processing's windows overlap Windows's toolbar - avoidable?](https://discourse.processing.org/t/processings-windows-overlap-windowss-toolbar-avoidable/5180)

<div class="topic-metadata">

**Author:** [@dtmr](https://discourse.processing.org/u/dtmr)\
**Replies:** 3\
**Last updated:** [November 10, 2018, 7:34pm UTC](https://discourse.processing.org/t/processings-windows-overlap-windowss-toolbar-avoidable/5180 "2018-11-10T19:34:51Z")

</div>

How to avoid overlapping of windows created by Processing with Windows 8 toolbar? App sets window size with size() Makes window resizable with surface.setResizable(true) Monitors Processing’s width/height variables and…

---

## [How can I play this?](https://discourse.processing.org/t/how-can-i-play-this/5286)

<div class="topic-metadata">

**Author:** [@alk5603](https://discourse.processing.org/u/alk5603)\
**Replies:** 6\
**Last updated:** [November 10, 2018, 9:39pm UTC](https://discourse.processing.org/t/how-can-i-play-this/5286 "2018-11-10T21:39:06Z")

</div>

How can I play this?

---

## [Learning GLSL - Example](https://discourse.processing.org/t/learning-glsl-example/5407)

<div class="topic-metadata">

**Author:** [@vjjv](https://discourse.processing.org/u/vjjv)\
**Replies:** 0\
**Last updated:** [November 10, 2018, 5:01pm UTC](https://discourse.processing.org/t/learning-glsl-example/5407 "2018-11-10T17:01:47Z")

</div>

Hi everybody! im learning GLSL, and i want to learn how can i port this example from shaderToy to processing. What i want is that feedback effect, i not intersting in geometry. So, i made a simple sketch with a sphere. A…

---

## [Loading created image into array(list) for further use (movement)](https://discourse.processing.org/t/loading-created-image-into-array-list-for-further-use-movement/5362)

<div class="topic-metadata">

**Author:** [@LordCacops](https://discourse.processing.org/u/LordCacops)\
**Replies:** 4\
**Last updated:** [November 10, 2018, 5:22pm UTC](https://discourse.processing.org/t/loading-created-image-into-array-list-for-further-use-movement/5362 "2018-11-10T17:22:51Z")

</div>

Howdy! This is my first post. I created this program that generates grids with colored squares. The colors are randomized. Each is a new object that I create with mousePressed(). When they are created they are get place…

---

## [Building a custom rangeslider-component](https://discourse.processing.org/t/building-a-custom-rangeslider-component/5399)

<div class="topic-metadata">

**Author:** [@timrodenbroeker](https://discourse.processing.org/u/timrodenbroeker)\
**Replies:** 3\
**Last updated:** [November 10, 2018, 2:26pm UTC](https://discourse.processing.org/t/building-a-custom-rangeslider-component/5399 "2018-11-10T14:26:09Z")

</div>

Hi coders! I’m trying to build a custom rangeslider and it drives me crazy. Most parts of the code work fine, but the function that updates the value of the slider when the mouse drags it returns slighty different value…

---

## [Can't acces class variables in function](https://discourse.processing.org/t/cant-acces-class-variables-in-function/5403)

<div class="topic-metadata">

**Author:** [@benja8151](https://discourse.processing.org/u/benja8151)\
**Replies:** 2\
**Last updated:** [November 10, 2018, 2:21pm UTC](https://discourse.processing.org/t/cant-acces-class-variables-in-function/5403 "2018-11-10T14:21:49Z")

</div>

Hello, before I start, I must say I’m pretty much a total newbie when it comes to programming in Processing, or in Java in general. As you can see, I have two shape classes, rectangle and circle. I’m trying to implement…

---

## [Thread hangs when no delay is used](https://discourse.processing.org/t/thread-hangs-when-no-delay-is-used/5352)

<div class="topic-metadata">

**Author:** [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Replies:** 11\
**Last updated:** [November 10, 2018, 11:07am UTC](https://discourse.processing.org/t/thread-hangs-when-no-delay-is-used/5352 "2018-11-10T11:07:45Z")

</div>

When I remove delay(1) in the code below then last\_frame will always be equal to frameCount and there is no movement. Why is that? PVector v = new PVector(); void setup() { thread("whyOwhy"); } void whyOwhy() { …

---

## [Counting things in draw()](https://discourse.processing.org/t/counting-things-in-draw/5396)

<div class="topic-metadata">

**Author:** [@germaine](https://discourse.processing.org/u/germaine)\
**Replies:** 1\
**Last updated:** [November 10, 2018, 8:45am UTC](https://discourse.processing.org/t/counting-things-in-draw/5396 "2018-11-10T08:45:57Z")

</div>

I have “liquid” (a rectangle) into which I am dropping “objects” (ellipses) of a regular size. When an object passes into the water, I want to add to the height of the water rectangle, and when I take an object out, I wa…

---

## [Instanced objects in multiple Arraylists for object organization?](https://discourse.processing.org/t/instanced-objects-in-multiple-arraylists-for-object-organization/5364)

<div class="topic-metadata">

**Author:** [@Birb](https://discourse.processing.org/u/Birb)\
**Replies:** 2\
**Last updated:** [November 10, 2018, 2:39am UTC](https://discourse.processing.org/t/instanced-objects-in-multiple-arraylists-for-object-organization/5364 "2018-11-10T02:39:35Z")

</div>

I have a problem and I’m trying to figure out the best way to approach it. I have a list of objects in an array, order matters. I would like to create sub-groups of those objects. Ideally, this would just be a matter of …

---

## [Load several XML to analyse them](https://discourse.processing.org/t/load-several-xml-to-analyse-them/5058)

<div class="topic-metadata">

**Author:** [@Pr0tonX](https://discourse.processing.org/u/Pr0tonX)\
**Replies:** 6\
**Last updated:** [November 9, 2018, 11:50pm UTC](https://discourse.processing.org/t/load-several-xml-to-analyse-them/5058 "2018-11-09T23:50:00Z")

</div>

Hi everyone, I’m trying to visualize some journeys wich are encoded in XML files. These files give me the position (lattitude and longitude), the date/time, and some others informations that I don’t need. I write a pr…

---

## [Fill in a nested loop](https://discourse.processing.org/t/fill-in-a-nested-loop/5394)

<div class="topic-metadata">

**Author:** [@Fei](https://discourse.processing.org/u/Fei)\
**Replies:** 4\
**Last updated:** [November 9, 2018, 11:29pm UTC](https://discourse.processing.org/t/fill-in-a-nested-loop/5394 "2018-11-09T23:29:58Z")

</div>

Hello, So I’m a little confused on how to manage what I’m trying to fill, and how, inside nested loops. I’m trying to have 3 rows of 20 circles each (to represent 60 seconds), where 1 circle is filled black every secon…

---

## [Happiness Meter](https://discourse.processing.org/t/happiness-meter/5326)

<div class="topic-metadata">

**Author:** [@ant](https://discourse.processing.org/u/ant)\
**Replies:** 15\
**Last updated:** [November 9, 2018, 8:06pm UTC](https://discourse.processing.org/t/happiness-meter/5326 "2018-11-09T20:06:07Z")

</div>

I am having trouble making a happiness meter. So I want to be able to have a timer aka my meter start counting down when I press the s key. Then if the happiness meter gets to low the rock image will change and if it get…

---

## [Pixels buffer and framerate](https://discourse.processing.org/t/pixels-buffer-and-framerate/5345)

<div class="topic-metadata">

**Author:** [@TTG](https://discourse.processing.org/u/TTG)\
**Replies:** 11\
**Last updated:** [November 9, 2018, 8:40am UTC](https://discourse.processing.org/t/pixels-buffer-and-framerate/5345 "2018-11-09T08:40:42Z")

</div>

Dear Team, When using pixels array i experience framerate drop (20 fps) after 4 or 5 draw() loops. when i use a void keypressed() the framerate doesnt drop and stays above 55 fps. (of course i require to press a ke…

---

## [Create multiple drawing object instances](https://discourse.processing.org/t/create-multiple-drawing-object-instances/5289)

<div class="topic-metadata">

**Author:** [@martinh](https://discourse.processing.org/u/martinh)\
**Replies:** 9\
**Last updated:** [November 9, 2018, 8:33am UTC](https://discourse.processing.org/t/create-multiple-drawing-object-instances/5289 "2018-11-09T08:33:01Z")

</div>

Hi all, new here. I would like to use P3 to create multiple unique drawing areas. All the examples I’ve seen the window is one large drawing area. Ideally I’d like to create a class of the ‘drawingArea’ with all the c…

---

## [Mesh ball generation](https://discourse.processing.org/t/mesh-ball-generation/4980)

<div class="topic-metadata">

**Author:** [@Darkar25](https://discourse.processing.org/u/Darkar25)\
**Replies:** 9\
**Last updated:** [November 9, 2018, 4:09am UTC](https://discourse.processing.org/t/mesh-ball-generation/4980 "2018-11-09T04:09:55Z")

</div>

Im trying to make something like that: I already made dots generation and border circle…but i dont know how to connect all dots between…i need to connect every dot to closest dots…i tried that myself but i got an OutO…

---

## [Shooting in a game](https://discourse.processing.org/t/shooting-in-a-game/5328)

<div class="topic-metadata">

**Author:** [@kinglucas](https://discourse.processing.org/u/kinglucas)\
**Replies:** 4\
**Last updated:** [November 8, 2018, 10:27pm UTC](https://discourse.processing.org/t/shooting-in-a-game/5328 "2018-11-08T22:27:05Z")

</div>

Hello, I am a beginner to programming and I really want this shooting code in my game but I don’t know how to put this code so that my character in my game shoots these bullets please help: //Objects Player player = new…

---

## [Best way to do this: tint(C, M, Y, K)?](https://discourse.processing.org/t/best-way-to-do-this-tint-c-m-y-k/5317)

<div class="topic-metadata">

**Author:** [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Replies:** 10\
**Last updated:** [November 8, 2018, 2:13pm UTC](https://discourse.processing.org/t/best-way-to-do-this-tint-c-m-y-k/5317 "2018-11-08T14:13:14Z")

</div>

Hello, I would like to be able to manipulate the CMYK channels of an image in Processing. (I realize that on a monitor the colors of an image are generated by RGB light, but I want to mimic the effects of the printing p…

---

## [A run away behavior](https://discourse.processing.org/t/a-run-away-behavior/5253)

<div class="topic-metadata">

**Author:** [@vincentstrebelle](https://discourse.processing.org/u/vincentstrebelle)\
**Replies:** 19\
**Last updated:** [November 8, 2018, 10:25am UTC](https://discourse.processing.org/t/a-run-away-behavior/5253 "2018-11-08T10:25:15Z")

</div>

hi everyone, i trie to make an run away behavior for my creature in my ecosystem. the situation is, if a predator (my mouse for now) come too close of a creature, the creature move away. i was wondering if i can use my…

---

## [textFont/text bugs of Processing 3.4](https://discourse.processing.org/t/textfont-text-bugs-of-processing-3-4/5122)

<div class="topic-metadata">

**Author:** [@zizhenc](https://discourse.processing.org/u/zizhenc)\
**Replies:** 4\
**Last updated:** [November 7, 2018, 10:13pm UTC](https://discourse.processing.org/t/textfont-text-bugs-of-processing-3-4/5122 "2018-11-07T22:13:24Z")

</div>

I believe I found a bug in Processing 3.4. The textFont will mess transparency in P3D render mode. I tested the following code in former Processing versions 3.37 and before, all works fine, just the 3.4 version has prob…

---

## [Timebonus doesn't reset](https://discourse.processing.org/t/timebonus-doesnt-reset/5319)

<div class="topic-metadata">

**Author:** [@kinglucas](https://discourse.processing.org/u/kinglucas)\
**Replies:** 19\
**Last updated:** [November 7, 2018, 4:17pm UTC](https://discourse.processing.org/t/timebonus-doesnt-reset/5319 "2018-11-07T16:17:58Z")

</div>

The time bonus doesn’t reset when I press ‘r’ to restart game how do I make sure that the timeBonus also resets with the points and amount of balls. int screensizex, screensizey; PImage img; int mode = 0; int INTRO = 0;…

---

## [Random functions from processing API for genetic algorithm?](https://discourse.processing.org/t/random-functions-from-processing-api-for-genetic-algorithm/5294)

<div class="topic-metadata">

**Author:** [@Hankg](https://discourse.processing.org/u/Hankg)\
**Replies:** 9\
**Last updated:** [November 7, 2018, 6:58am UTC](https://discourse.processing.org/t/random-functions-from-processing-api-for-genetic-algorithm/5294 "2018-11-07T06:58:13Z")

</div>

Hi! I want to build a program in which a class is constructed and then randomly adds, to itself, one of the various functions available in processing’s API. The result would be drawn to the screen (if in fact it calls a …

---

## [Developing a coding to move on a robot](https://discourse.processing.org/t/developing-a-coding-to-move-on-a-robot/5272)

<div class="topic-metadata">

**Author:** [@SteveTombs92](https://discourse.processing.org/u/SteveTombs92)\
**Replies:** 3\
**Last updated:** [November 7, 2018, 3:08am UTC](https://discourse.processing.org/t/developing-a-coding-to-move-on-a-robot/5272 "2018-11-07T03:08:03Z")

</div>

Hello Processing community. I am learning Processing by myself and I found some interesting exercises to develop coding, for a robot in this case. I have created the code. However, I am still do not know how I can trans…

---

## [Perlin Noise Loop Array](https://discourse.processing.org/t/perlin-noise-loop-array/5265)

<div class="topic-metadata">

**Author:** [@ronantuite](https://discourse.processing.org/u/ronantuite)\
**Replies:** 2\
**Last updated:** [November 6, 2018, 9:17pm UTC](https://discourse.processing.org/t/perlin-noise-loop-array/5265 "2018-11-06T21:17:58Z")

</div>

Ive been stuck on the problem of drawing an array of zig-zag lines that uses Perlin Nosie to create the zig-zag. Im drawing the lines in the draw function which updates the points on the line continuously, making the lin…

---

## [Developing a Robot Into Command Keys Function](https://discourse.processing.org/t/developing-a-robot-into-command-keys-function/5273)

<div class="topic-metadata">

**Author:** [@SteveTombs92](https://discourse.processing.org/u/SteveTombs92)\
**Replies:** 1\
**Last updated:** [November 6, 2018, 7:52pm UTC](https://discourse.processing.org/t/developing-a-robot-into-command-keys-function/5273 "2018-11-06T19:52:43Z")

</div>

Hello Processing friends. I have been learning Processing by myself and doing coding for robots. I am getting a lot of fun. However, I am getting frustrated because I has not been able to turn the code from mouse functio…

---

## [Creating the Code for A Robot with Command Keys](https://discourse.processing.org/t/creating-the-code-for-a-robot-with-command-keys/5274)

<div class="topic-metadata">

**Author:** [@SteveTombs92](https://discourse.processing.org/u/SteveTombs92)\
**Replies:** 1\
**Last updated:** [November 6, 2018, 7:51pm UTC](https://discourse.processing.org/t/creating-the-code-for-a-robot-with-command-keys/5274 "2018-11-06T19:51:47Z")

</div>

Hello Processing folks. I am learning Processing by myself. I am getting fun because I am creating robots. Nevertheless, I feel like overwhelmed because I has not been capable of turning this code from mouse function int…

---

## [Is "text()" a good idea for this game?](https://discourse.processing.org/t/is-text-a-good-idea-for-this-game/5234)

<div class="topic-metadata">

**Author:** [@Oighen](https://discourse.processing.org/u/Oighen)\
**Replies:** 7\
**Last updated:** [November 6, 2018, 10:27am UTC](https://discourse.processing.org/t/is-text-a-good-idea-for-this-game/5234 "2018-11-06T10:27:58Z")

</div>

Hi all, I’m trying to write a sketch, a sort of game, so that: At the beginning of the game the “\*” character is at the center of the screen and a certain number (nz=8) of a different character, “0”, are at the borde…

---

## [Please greatly teach me how to use the work to present it. I am very grateful](https://discourse.processing.org/t/please-greatly-teach-me-how-to-use-the-work-to-present-it-i-am-very-grateful/5195)

<div class="topic-metadata">

**Author:** [@alk5603](https://discourse.processing.org/u/alk5603)\
**Replies:** 10\
**Last updated:** [November 6, 2018, 10:24am UTC](https://discourse.processing.org/t/please-greatly-teach-me-how-to-use-the-work-to-present-it-i-am-very-grateful/5195 "2018-11-06T10:24:27Z")

</div>

I would like to ask you a lot like this triangle. How can I present it in a recursive way? How can I play?

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

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