# Coding Questions

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

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

**Page:** 143

---

## [CLOSED - user types "Codes" - special strings, if correct something happens!](https://discourse.processing.org/t/closed-user-types-codes-special-strings-if-correct-something-happens/9605)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 19\
**Last updated:** [April 25, 2019, 7:44am UTC](https://discourse.processing.org/t/closed-user-types-codes-special-strings-if-correct-something-happens/9605 "2019-04-25T07:44:26Z")

</div>

Hey! What do i need to change to get it working? And make it so i can have multiple codes! (i know its just string list, but if u can do it for me :slight\_smile: ) int chr = 0; String code = "a"; String input = ""; in…

---

## [OutOfMemory Error when animating with PGraphic images](https://discourse.processing.org/t/outofmemory-error-when-animating-with-pgraphic-images/10591)

<div class="topic-metadata">

**Author:** [@Aeggy](https://discourse.processing.org/u/Aeggy)\
**Replies:** 12\
**Last updated:** [April 25, 2019, 4:09am UTC](https://discourse.processing.org/t/outofmemory-error-when-animating-with-pgraphic-images/10591 "2019-04-25T04:09:30Z")

</div>

So I’m creating 1000 PGraphic images and want to animate through them. I’m keeping them empty for this example. The problem is I run out of memory before animating through all of them once (as in it stops around the 800 …

---

## [Create your own adventure game -- adding images](https://discourse.processing.org/t/create-your-own-adventure-game-adding-images/10149)

<div class="topic-metadata">

**Author:** [@itejeji21](https://discourse.processing.org/u/itejeji21)\
**Replies:** 12\
**Last updated:** [April 24, 2019, 10:16pm UTC](https://discourse.processing.org/t/create-your-own-adventure-game-adding-images/10149 "2019-04-24T22:16:44Z")

</div>

I was making this choose your own adventure game and couldn’t figure out how to add images correlating to each situation (NOT options). I’m not done with the code, but could someone please help me out. class Pair { St…

---

## [Apply color filter to PGraphics](https://discourse.processing.org/t/apply-color-filter-to-pgraphics/10533)

<div class="topic-metadata">

**Author:** [@lu4425](https://discourse.processing.org/u/lu4425)\
**Replies:** 1\
**Last updated:** [April 24, 2019, 4:10pm UTC](https://discourse.processing.org/t/apply-color-filter-to-pgraphics/10533 "2019-04-24T16:10:25Z")

</div>

Help!! I need to assign at least two colors to the “walker” class. Try to draw a PGraphics in grayscale to then assign the colors but I do not know how to continue. How do I draw 2 PGraphics to then assign different col…

---

## [Can't seem a way to make game menu for simple gun game](https://discourse.processing.org/t/cant-seem-a-way-to-make-game-menu-for-simple-gun-game/10588)

<div class="topic-metadata">

**Author:** [@Icecrem](https://discourse.processing.org/u/Icecrem)\
**Replies:** 2\
**Last updated:** [April 24, 2019, 5:05am UTC](https://discourse.processing.org/t/cant-seem-a-way-to-make-game-menu-for-simple-gun-game/10588 "2019-04-24T05:05:30Z")

</div>

boolean down=true; boolean up=true; boolean bullet=true; float gunposition=350;//gun position float bulletY=650;//bullet position float bulletX=355;//bullet position float alienX=350;//alien positon float alienY=0;//alie…

---

## [Code with lots of images makes sketch slow to load](https://discourse.processing.org/t/code-with-lots-of-images-makes-sketch-slow-to-load/10580)

<div class="topic-metadata">

**Author:** [@l.wright](https://discourse.processing.org/u/l.wright)\
**Replies:** 2\
**Last updated:** [April 24, 2019, 1:11am UTC](https://discourse.processing.org/t/code-with-lots-of-images-makes-sketch-slow-to-load/10580 "2019-04-24T01:11:13Z")

</div>

Hi! I have created a sketch that makes a random image appear upon clicking but it is very slow to load the images. I have decreased the file size on all the images so none of them are particularly large. I have never don…

---

## [Enemy Detection](https://discourse.processing.org/t/enemy-detection/10509)

<div class="topic-metadata">

**Author:** [@ctrembla](https://discourse.processing.org/u/ctrembla)\
**Replies:** 9\
**Last updated:** [April 23, 2019, 7:01pm UTC](https://discourse.processing.org/t/enemy-detection/10509 "2019-04-23T19:01:32Z")

</div>

Hey I’m trying to make my first AI game. Is there a way to check to see if any item is within a certain range? I want my AI to only see 8 directions and whatever is in the radius of its x point and the furthest it can se…

---

## [Getting HTML and its info](https://discourse.processing.org/t/getting-html-and-its-info/10546)

<div class="topic-metadata">

**Author:** [@niljon](https://discourse.processing.org/u/niljon)\
**Replies:** 2\
**Last updated:** [April 23, 2019, 2:07pm UTC](https://discourse.processing.org/t/getting-html-and-its-info/10546 "2019-04-23T14:07:54Z")

</div>

Hi all. gonna start with that if there already is a topic about this please redirect me there but i didnt seem to find it by myself. im in need of help with getting information from a website and take out some informat…

---

## [AI Flappy Bird Processing Java](https://discourse.processing.org/t/ai-flappy-bird-processing-java/10513)

<div class="topic-metadata">

**Author:** [@ctrembla](https://discourse.processing.org/u/ctrembla)\
**Replies:** 54\
**Last updated:** [April 23, 2019, 4:29am UTC](https://discourse.processing.org/t/ai-flappy-bird-processing-java/10513 "2019-04-23T04:29:19Z")

</div>

Hi I’m trying to learn to build an AI from the flappy bird video from coding train. I got another game I’m using what I learn on, anyways I reached the part of the video where he saves the bird in js & tried several ways…

---

## [Using Emoji's on OSX](https://discourse.processing.org/t/using-emojis-on-osx/10349)

<div class="topic-metadata">

**Author:** [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Replies:** 5\
**Last updated:** [April 22, 2019, 5:17pm UTC](https://discourse.processing.org/t/using-emojis-on-osx/10349 "2019-04-22T17:17:59Z")

</div>

Is it possible to make something like this work: void setup() { size(200, 200); char\[\] chars = Character.toChars(128149); textFont(createFont("AppleColorEmoji", 32, true, chars)); textAlign(CENTER, CENTER); te…

---

## [Stamp tool in processing](https://discourse.processing.org/t/stamp-tool-in-processing/10298)

<div class="topic-metadata">

**Author:** [@helen1216](https://discourse.processing.org/u/helen1216)\
**Replies:** 2\
**Last updated:** [April 22, 2019, 5:03pm UTC](https://discourse.processing.org/t/stamp-tool-in-processing/10298 "2019-04-22T17:03:30Z")

</div>

Hi, I want to know if this idea is possible. I am trying to create a random stamping tool if I do a key press. I want to know if it’s possible to create a stamping tool based on newly created image like this. Now, I…

---

## [Draw a "sliced" circle shape](https://discourse.processing.org/t/draw-a-sliced-circle-shape/10524)

<div class="topic-metadata">

**Author:** [@smeskhishvili](https://discourse.processing.org/u/smeskhishvili)\
**Replies:** 5\
**Last updated:** [April 22, 2019, 8:14am UTC](https://discourse.processing.org/t/draw-a-sliced-circle-shape/10524 "2019-04-22T08:14:18Z")

</div>

Hello, I’m working on a project to create “sliced” circle, so that each slice would be separate shape so I would be able to fill with color. . . I’ve researched how circles are drawn with brazier’s but I can’t figure ou…

---

## [\[SOLVED\] Converting millis to Sec, Min, Hrs, Days](https://discourse.processing.org/t/solved-converting-millis-to-sec-min-hrs-days/10473)

<div class="topic-metadata">

**Author:** [@laptophead](https://discourse.processing.org/u/laptophead)\
**Replies:** 13\
**Last updated:** [April 21, 2019, 7:44pm UTC](https://discourse.processing.org/t/solved-converting-millis-to-sec-min-hrs-days/10473 "2019-04-21T19:44:07Z")

</div>

I am well aware of the built in time functions of processing, the ones that get you the computer clock time. However I have a situation where I get large amounts of milliseconds of timed processes , and I would like to …

---

## [Remnants on movement and picture off-screening](https://discourse.processing.org/t/remnants-on-movement-and-picture-off-screening/10435)

<div class="topic-metadata">

**Author:** [@FlyingApple](https://discourse.processing.org/u/FlyingApple)\
**Replies:** 6\
**Last updated:** [April 21, 2019, 4:40pm UTC](https://discourse.processing.org/t/remnants-on-movement-and-picture-off-screening/10435 "2019-04-21T16:40:26Z")

</div>

This may be a stupid question but if you import a paint file with a character (rectangle) that moves on the screen is there any better way to clear the remnants left behind by the old copy of the character except just re…

---

## [Click on shape in array](https://discourse.processing.org/t/click-on-shape-in-array/10515)

<div class="topic-metadata">

**Author:** [@Tims](https://discourse.processing.org/u/Tims)\
**Replies:** 2\
**Last updated:** [April 21, 2019, 12:13pm UTC](https://discourse.processing.org/t/click-on-shape-in-array/10515 "2019-04-21T12:13:57Z")

</div>

Hi everyone. I’m currently trying to create several shapes where each shape can be clicked on seperately. I currently have an array of rectangles which are being drawn onto the screen. I want to be able to click on a rec…

---

## [Hey guys if I want my text to be in the middle what can I change?](https://discourse.processing.org/t/hey-guys-if-i-want-my-text-to-be-in-the-middle-what-can-i-change/10346)

<div class="topic-metadata">

**Author:** [@fwtini](https://discourse.processing.org/u/fwtini)\
**Replies:** 7\
**Last updated:** [April 18, 2019, 6:24pm UTC](https://discourse.processing.org/t/hey-guys-if-i-want-my-text-to-be-in-the-middle-what-can-i-change/10346 "2019-04-18T18:24:50Z")

</div>

PFont myFont; String s1= ("OBECALP PHARMACY "); float angleSpeed= TWO\_PI/s1.length(); float letterX,letterY; int i,cntX,cntY; int radius =260; float z=random(TWO\_PI); float x=0; float y; float r =0; float offset; floa…

---

## [Arrange common items to spell out words](https://discourse.processing.org/t/arrange-common-items-to-spell-out-words/10498)

<div class="topic-metadata">

**Author:** [@rasmussen.bryan](https://discourse.processing.org/u/rasmussen.bryan)\
**Replies:** 0\
**Last updated:** [April 20, 2019, 3:22pm UTC](https://discourse.processing.org/t/arrange-common-items-to-spell-out-words/10498 "2019-04-20T15:22:26Z")

</div>

Hey I recently asked this on computergraphics.stachexchange.com but then I realized, I bet somebody has done this in processing - so I will copy the question below, it is quite verbose and detailed (maybe overly so) beca…

---

## [I need help for processing task](https://discourse.processing.org/t/i-need-help-for-processing-task/10252)

<div class="topic-metadata">

**Author:** [@derecH](https://discourse.processing.org/u/derecH)\
**Replies:** 5\
**Last updated:** [April 20, 2019, 11:44am UTC](https://discourse.processing.org/t/i-need-help-for-processing-task/10252 "2019-04-20T11:44:05Z")

</div>

Hi all! I need help for processing task. Condition: setup{} draw{} own Section drawing{} other own functions{} mousepressed{} keypressed{} project: Section Sketching Function (Incremental Algorithm or Midpoint A…

---

## [How to avoid that the background() call erase a previously drawn object?](https://discourse.processing.org/t/how-to-avoid-that-the-background-call-erase-a-previously-drawn-object/10444)

<div class="topic-metadata">

**Author:** [@danielrpma](https://discourse.processing.org/u/danielrpma)\
**Replies:** 4\
**Last updated:** [April 20, 2019, 11:06am UTC](https://discourse.processing.org/t/how-to-avoid-that-the-background-call-erase-a-previously-drawn-object/10444 "2019-04-20T11:06:39Z")

</div>

Hello, everyone! I want to make an animation where there are two circles orbiting some point, and I want to draw a line between the circles each 10 frames for example. The thing is, these lines are erased in the next fr…

---

## [2d platformer game, dont know how to implement a few features](https://discourse.processing.org/t/2d-platformer-game-dont-know-how-to-implement-a-few-features/10412)

<div class="topic-metadata">

**Author:** [@dakito](https://discourse.processing.org/u/dakito)\
**Replies:** 4\
**Last updated:** [April 20, 2019, 2:25am UTC](https://discourse.processing.org/t/2d-platformer-game-dont-know-how-to-implement-a-few-features/10412 "2019-04-20T02:25:59Z")

</div>

I dont know how to make proper collision with jumping and how to not allow the player to jump more than once. https://github.com/dakiito/platformer1

---

## [PDF export won't save with background for my 3d sketch](https://discourse.processing.org/t/pdf-export-wont-save-with-background-for-my-3d-sketch/10460)

<div class="topic-metadata">

**Author:** [@sorenkirk](https://discourse.processing.org/u/sorenkirk)\
**Replies:** 1\
**Last updated:** [April 20, 2019, 2:22am UTC](https://discourse.processing.org/t/pdf-export-wont-save-with-background-for-my-3d-sketch/10460 "2019-04-20T02:22:24Z")

</div>

I have read the Processing docs on PDF export for 3d sketches. For some reason, my sketch won’t save as a PDF with the specified background. It only saves on a white background. //Stuff for saving stage import processin…

---

## [Questions about code that involves curveVertex](https://discourse.processing.org/t/questions-about-code-that-involves-curvevertex/10405)

<div class="topic-metadata">

**Author:** [@Mikalaen](https://discourse.processing.org/u/Mikalaen)\
**Replies:** 2\
**Last updated:** [April 19, 2019, 11:44pm UTC](https://discourse.processing.org/t/questions-about-code-that-involves-curvevertex/10405 "2019-04-19T23:44:18Z")

</div>

Hi guys! I need some help here. I got a code sent to me by my teacher, so that i could “evolve” on it, but my problem is that i don’t understand the code and what the different factors and statements do?? I commented o…

---

## [Exclude child from PShape to create mask is it possible?](https://discourse.processing.org/t/exclude-child-from-pshape-to-create-mask-is-it-possible/10425)

<div class="topic-metadata">

**Author:** [@Stanlepunk](https://discourse.processing.org/u/Stanlepunk)\
**Replies:** 5\
**Last updated:** [April 19, 2019, 9:30am UTC](https://discourse.processing.org/t/exclude-child-from-pshape-to-create-mask-is-it-possible/10425 "2019-04-19T09:30:05Z")

</div>

I try to create a donnut with PShape, but this mission is more difficult than I think, I I don’t find a methode like pshape.exclude(group\_a) or pshape.remove(group\_a) or something like that there is a way do to that? PV…

---

## [Unclick and it goes back as it started -- a beginner needs help](https://discourse.processing.org/t/unclick-and-it-goes-back-as-it-started-a-beginner-needs-help/10448)

<div class="topic-metadata">

**Author:** [@dianap](https://discourse.processing.org/u/dianap)\
**Replies:** 3\
**Last updated:** [April 19, 2019, 5:11am UTC](https://discourse.processing.org/t/unclick-and-it-goes-back-as-it-started-a-beginner-needs-help/10448 "2019-04-19T05:11:13Z")

</div>

I´ve literally been an hour into Processing and I´ve made this void setup(){ size(500,400); background(#FA9E8D);} void draw(){ stroke(#FAD5BD); fill(#FAD5BD); ellipse(250, 200, 350, 350); stroke(#FA5D5D); fill(#FA5D…

---

## [Hallo! Can you explain me why my text doesn't spinning?](https://discourse.processing.org/t/hallo-can-you-explain-me-why-my-text-doesnt-spinning/10288)

<div class="topic-metadata">

**Author:** [@fwtini](https://discourse.processing.org/u/fwtini)\
**Replies:** 22\
**Last updated:** [April 18, 2019, 6:17pm UTC](https://discourse.processing.org/t/hallo-can-you-explain-me-why-my-text-doesnt-spinning/10288 "2019-04-18T18:17:37Z")

</div>

PFont myFont; String s1= ("OBECALP PHARMACY "); float angleSpeed= TWO\_PI/s1.length(); float letterX,letterY; int i,cntX,cntY; int radius =260; float z=random(TWO\_PI); float x; float y; //float rotX,rotY,rotZ; float r…

---

## [Now it stops spinning but it’s in the center haha now can i do to spinning =/](https://discourse.processing.org/t/now-it-stops-spinning-but-it-s-in-the-center-haha-now-can-i-do-to-spinning/10347)

<div class="topic-metadata">

**Author:** [@fwtini](https://discourse.processing.org/u/fwtini)\
**Replies:** 0\
**Last updated:** [April 16, 2019, 9:44am UTC](https://discourse.processing.org/t/now-it-stops-spinning-but-it-s-in-the-center-haha-now-can-i-do-to-spinning/10347 "2019-04-16T09:44:41Z")

</div>

Now it stops spinning but it’s in the center haha now can i do to spinning =/ PFont myFont; String s1= ("OBECALP PHARMACY "); float angleSpeed= TWO\_PI/s1.length(); float letterX,letterY; int i,cntX,cntY; int radius =26…

---

## [How to draw a static PointCloud from Kinect?](https://discourse.processing.org/t/how-to-draw-a-static-pointcloud-from-kinect/10401)

<div class="topic-metadata">

**Author:** [@zly1994411](https://discourse.processing.org/u/zly1994411)\
**Replies:** 2\
**Last updated:** [April 18, 2019, 4:53pm UTC](https://discourse.processing.org/t/how-to-draw-a-static-pointcloud-from-kinect/10401 "2019-04-18T16:53:42Z")

</div>

Hey guys, I’m working on a project that use Kinect. My idea is when event happened, the canvas will draw the PointCloud at that moment. I was trying to make an object , and when mouse clicked, pass the current depth arra…

---

## [Processing Freezes when it runs through a specific if statement](https://discourse.processing.org/t/processing-freezes-when-it-runs-through-a-specific-if-statement/10423)

<div class="topic-metadata">

**Author:** [@Vynarel](https://discourse.processing.org/u/Vynarel)\
**Replies:** 9\
**Last updated:** [April 18, 2019, 3:50pm UTC](https://discourse.processing.org/t/processing-freezes-when-it-runs-through-a-specific-if-statement/10423 "2019-04-18T15:50:51Z")

</div>

Hey there, I’m new to Processing and have been trying to do an assignment for it about swatting flies, I have the fly swatter and a fly appearing on the screen and managed to get the fly swatter to follow my mouse positi…

---

## [Constructor Argument for COLOR ~ Dan Shiffman book ~ exercise 8-6](https://discourse.processing.org/t/constructor-argument-for-color-dan-shiffman-book-exercise-8-6/10415)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 2\
**Last updated:** [April 18, 2019, 2:51pm UTC](https://discourse.processing.org/t/constructor-argument-for-color-dan-shiffman-book-exercise-8-6/10415 "2019-04-18T14:51:04Z")

</div>

I want the eyes to appear in RED in one iteration of the Zoog object, and to appear GREEN in the second iteration of the Zoog object. However the eyes are currently appearing BLACK in both iterations. What have I done …

---

## [Trouble with saving to Table](https://discourse.processing.org/t/trouble-with-saving-to-table/10150)

<div class="topic-metadata">

**Author:** [@laptophead](https://discourse.processing.org/u/laptophead)\
**Replies:** 9\
**Last updated:** [April 18, 2019, 8:07am UTC](https://discourse.processing.org/t/trouble-with-saving-to-table/10150 "2019-04-18T08:07:33Z")

</div>

I am trying to make an interface that would save grades for students. Then the data is saved to CSV. In the first column I have the student ID (SID)- next to it are the grades. What I wish for is that if I go back to…

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

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