# Coding Questions

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

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

**Page:** 159

---

## [Problem program re-open when click icon](https://discourse.processing.org/t/problem-program-re-open-when-click-icon/6761)

<div class="topic-metadata">

**Author:** [@imdidi](https://discourse.processing.org/u/imdidi)\
**Replies:** 4\
**Last updated:** [December 22, 2018, 8:06pm UTC](https://discourse.processing.org/t/problem-program-re-open-when-click-icon/6761 "2018-12-22T20:06:56Z")

</div>

Hello everyone I’ve made a Processing program and I export it as a Linux file. My problem is that if my program is open and I re-click on the icon, the program opens a second time then a third time if I click again on …

---

## [Not sure how to check for location](https://discourse.processing.org/t/not-sure-how-to-check-for-location/6816)

<div class="topic-metadata">

**Author:** [@Jakpott29](https://discourse.processing.org/u/Jakpott29)\
**Replies:** 6\
**Last updated:** [December 22, 2018, 9:55am UTC](https://discourse.processing.org/t/not-sure-how-to-check-for-location/6816 "2018-12-22T09:55:47Z")

</div>

Im not entirely sure how to check for the location, what i did was i used an array and then some basic x,y variables to draw some rectangles to for a grid on the screen. Im just not sure how i can check for which box the…

---

## [Weird error nullPointerException](https://discourse.processing.org/t/weird-error-nullpointerexception/6814)

<div class="topic-metadata">

**Author:** [@akenaton](https://discourse.processing.org/u/akenaton)\
**Replies:** 3\
**Last updated:** [December 22, 2018, 9:44am UTC](https://discourse.processing.org/t/weird-error-nullpointerexception/6814 "2018-12-22T09:44:10Z")

</div>

I have a code in which i get 1/1000 times an error i cannot understand; as the code runs fine so many times i dont understand why this error is happening. And the error is not really clear to read: java.lang.NullPointer…

---

## [Open a Link on a browser with keyPressed](https://discourse.processing.org/t/open-a-link-on-a-browser-with-keypressed/6740)

<div class="topic-metadata">

**Author:** [@\_megss0](https://discourse.processing.org/u/_megss0)\
**Replies:** 10\
**Last updated:** [December 21, 2018, 11:50pm UTC](https://discourse.processing.org/t/open-a-link-on-a-browser-with-keypressed/6740 "2018-12-21T23:50:04Z")

</div>

i want to open a new tab with a link but using the fuction keyPressed something like; if i press CTRL+A open a tab on the browser with a specif link

---

## [Missing characters of font exported PDF](https://discourse.processing.org/t/missing-characters-of-font-exported-pdf/6736)

<div class="topic-metadata">

**Author:** [@lumicon9](https://discourse.processing.org/u/lumicon9)\
**Replies:** 4\
**Last updated:** [December 21, 2018, 3:05pm UTC](https://discourse.processing.org/t/missing-characters-of-font-exported-pdf/6736 "2018-12-21T15:05:29Z")

</div>

hi, i want to make some ascii art exported as pdf for larger print. …tried with several fonts using processing.pdf some arn’t working at all some do partly, especially the extra characters i’d like to work with are alw…

---

## [Irregular image to button](https://discourse.processing.org/t/irregular-image-to-button/6786)

<div class="topic-metadata">

**Author:** [@IMTDSN](https://discourse.processing.org/u/IMTDSN)\
**Replies:** 5\
**Last updated:** [December 21, 2018, 9:48am UTC](https://discourse.processing.org/t/irregular-image-to-button/6786 "2018-12-21T09:48:48Z")

</div>

Is it possible to use an irregular image as a button? That is, an image that along the X has different measures of Y, and vice versa, I can use to MousePressed ? Thanks!

---

## [Null Pointers that shouldnt be null](https://discourse.processing.org/t/null-pointers-that-shouldnt-be-null/6752)

<div class="topic-metadata">

**Author:** [@CallMeAza](https://discourse.processing.org/u/CallMeAza)\
**Replies:** 20\
**Last updated:** [December 20, 2018, 10:48am UTC](https://discourse.processing.org/t/null-pointers-that-shouldnt-be-null/6752 "2018-12-20T10:48:04Z")

</div>

Hello guys, i am getting a really weird error… And I hope you can help me. void show(int c) { noFill(); stroke(c); strokeWeight(2); ellipse(center.x, center.y, 2\*r, 2\*r); this.a.show(255); thi…

---

## [Integrate Sketch on website](https://discourse.processing.org/t/integrate-sketch-on-website/6778)

<div class="topic-metadata">

**Author:** [@res56](https://discourse.processing.org/u/res56)\
**Replies:** 0\
**Last updated:** [December 20, 2018, 9:05am UTC](https://discourse.processing.org/t/integrate-sketch-on-website/6778 "2018-12-20T09:05:32Z")

</div>

When i integrate my Sketch in html the Sketch is not displayed correctly. It is displayed magnified. My resolution is 1920x1080px and i set the same size for the Sketch. I am very grateful for help Check my sample on …

---

## [How to create nested polygon](https://discourse.processing.org/t/how-to-create-nested-polygon/6312)

<div class="topic-metadata">

**Author:** [@OliviaJinkela](https://discourse.processing.org/u/OliviaJinkela)\
**Replies:** 14\
**Last updated:** [December 19, 2018, 11:49pm UTC](https://discourse.processing.org/t/how-to-create-nested-polygon/6312 "2018-12-19T23:49:13Z")

</div>

Hi, I’m new to processing, and this is my first post. I has some problem with a processing assignment in school, so I hope everyone can help me to see how to approach to this problem. So basically I want to create a nes…

---

## [How can you block the key "Escape"](https://discourse.processing.org/t/how-can-you-block-the-key-escape/6765)

<div class="topic-metadata">

**Author:** [@fritzpal](https://discourse.processing.org/u/fritzpal)\
**Replies:** 2\
**Last updated:** [December 19, 2018, 7:57pm UTC](https://discourse.processing.org/t/how-can-you-block-the-key-escape/6765 "2018-12-19T19:57:41Z")

</div>

Hi, does somebody know how to block processing from closing the sketch when you press escape? I tried this but it did not work: void draw(){ if(key == ESC)key = 0; } Thank you

---

## [Launch() function on linux (Ubuntu)](https://discourse.processing.org/t/launch-function-on-linux-ubuntu/6725)

<div class="topic-metadata">

**Author:** [@phoebus](https://discourse.processing.org/u/phoebus)\
**Replies:** 3\
**Last updated:** [December 19, 2018, 7:36am UTC](https://discourse.processing.org/t/launch-function-on-linux-ubuntu/6725 "2018-12-19T07:36:38Z")

</div>

Hello :slight\_smile: I’m trying to use the launch() function in a stketch I developped and exported for Linux. The machine I am trying it on is using Ubuntu it says " On Linux, it first tries gnome-open, then kde-op…

---

## [Start functions displaced in time?](https://discourse.processing.org/t/start-functions-displaced-in-time/6718)

<div class="topic-metadata">

**Author:** [@Anaibuk](https://discourse.processing.org/u/Anaibuk)\
**Replies:** 5\
**Last updated:** [December 19, 2018, 12:53am UTC](https://discourse.processing.org/t/start-functions-displaced-in-time/6718 "2018-12-19T00:53:59Z")

</div>

Hey, I’m just starting processing at university, so I feel a little lost in my code. I want to start my first void line1 and then, after some seconds, start the second void line2 too. I know that it should be possible t…

---

## [Problem writing number on stripes. Drone interface](https://discourse.processing.org/t/problem-writing-number-on-stripes-drone-interface/6698)

<div class="topic-metadata">

**Author:** [@jcduino](https://discourse.processing.org/u/jcduino)\
**Replies:** 5\
**Last updated:** [December 18, 2018, 8:21pm UTC](https://discourse.processing.org/t/problem-writing-number-on-stripes-drone-interface/6698 "2018-12-18T20:21:11Z")

</div>

Hello I am implementing an interface for my drone and I am blocked in the algorithm that draws the course. The idea is to make vertical stripes along a landscape rectangle. The long lines are every 50px and they have t…

---

## [Rotate an image when it's moving with "if"](https://discourse.processing.org/t/rotate-an-image-when-its-moving-with-if/6633)

<div class="topic-metadata">

**Author:** [@Alexander](https://discourse.processing.org/u/Alexander)\
**Replies:** 3\
**Last updated:** [December 18, 2018, 5:25pm UTC](https://discourse.processing.org/t/rotate-an-image-when-its-moving-with-if/6633 "2018-12-18T17:25:43Z")

</div>

Hello! My name is Alex and i want to was a question. i’ ve been doing a race game the previous 2 days and i got to a serious problem. I have the menus, the track and a car, i made the car move.In the first place it’s hor…

---

## [Long, modulo and RSA-algorithm](https://discourse.processing.org/t/long-modulo-and-rsa-algorithm/6727)

<div class="topic-metadata">

**Author:** [@crizzer](https://discourse.processing.org/u/crizzer)\
**Replies:** 2\
**Last updated:** [December 18, 2018, 5:00pm UTC](https://discourse.processing.org/t/long-modulo-and-rsa-algorithm/6727 "2018-12-18T17:00:16Z")

</div>

As a school project, I have to make a program that can encrypt and decrypt code, whilst also registering the encoded code in a database. But I’ve encountered a problem: To encrypt a message using RSA, you need to lift …

---

## [I need help on Processing 3](https://discourse.processing.org/t/i-need-help-on-processing-3/6663)

<div class="topic-metadata">

**Author:** [@buddyduncan](https://discourse.processing.org/u/buddyduncan)\
**Replies:** 5\
**Last updated:** [December 18, 2018, 2:22am UTC](https://discourse.processing.org/t/i-need-help-on-processing-3/6663 "2018-12-18T02:22:21Z")

</div>

I am trying to create a maze but I can’t figure out how to make it so the ball doesn’t go through the walls. I have provided my code below, please help me by telling me what code to add. int x = 170; int y = 315; PImag…

---

## [\[RESOLVED\] Platformer player unable to fall in pits](https://discourse.processing.org/t/resolved-platformer-player-unable-to-fall-in-pits/6706)

<div class="topic-metadata">

**Author:** [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Replies:** 1\
**Last updated:** [December 18, 2018, 12:30am UTC](https://discourse.processing.org/t/resolved-platformer-player-unable-to-fall-in-pits/6706 "2018-12-18T00:30:55Z")

</div>

I am trying to make a basic platformer game, but the player is unable to fall in pits. It falls off of platforms, but not into pits. Does anybody know how to fix this? I have several files, so I put the code on github. …

---

## [Inserting a vertex into a PShape](https://discourse.processing.org/t/inserting-a-vertex-into-a-pshape/6620)

<div class="topic-metadata">

**Author:** [@William3954](https://discourse.processing.org/u/William3954)\
**Replies:** 3\
**Last updated:** [December 17, 2018, 8:51pm UTC](https://discourse.processing.org/t/inserting-a-vertex-into-a-pshape/6620 "2018-12-17T20:51:52Z")

</div>

Is it possible to insert a vertex into a PShape at a specific index point? Example, I have a PShape with 10 vertex, I want to add a vertex between v3 and v4 which would increase the PShape vertex count to 11. Currently,…

---

## [I need help with randomizing (javascript)](https://discourse.processing.org/t/i-need-help-with-randomizing-javascript/6704)

<div class="topic-metadata">

**Author:** [@Wuoahter](https://discourse.processing.org/u/Wuoahter)\
**Replies:** 1\
**Last updated:** [December 17, 2018, 8:48pm UTC](https://discourse.processing.org/t/i-need-help-with-randomizing-javascript/6704 "2018-12-17T20:48:22Z")

</div>

//tells collision of ball with paddle void contactPaddle() { //left paddle collision with ball if(x - w/2 \< paddleXL + paddleW/2 && y - h/2 \< paddleYL + paddleH/2 && y + h/2 \> paddleYL - paddleH/2) { if(speedX \< 0) { …

---

## [Random circles controlled by keypress](https://discourse.processing.org/t/random-circles-controlled-by-keypress/6580)

<div class="topic-metadata">

**Author:** [@jonzamarripa](https://discourse.processing.org/u/jonzamarripa)\
**Replies:** 3\
**Last updated:** [December 17, 2018, 7:01pm UTC](https://discourse.processing.org/t/random-circles-controlled-by-keypress/6580 "2018-12-17T19:01:50Z")

</div>

Hey guys, I am working on a code and I am stuck. The idea is for the random circles to stop when you press a key if not continue working until it stops. There’s an image running in the background. Eventually I want to t…

---

## [Game with typing random characters](https://discourse.processing.org/t/game-with-typing-random-characters/6588)

<div class="topic-metadata">

**Author:** [@ari\_y](https://discourse.processing.org/u/ari_y)\
**Replies:** 3\
**Last updated:** [December 17, 2018, 6:42pm UTC](https://discourse.processing.org/t/game-with-typing-random-characters/6588 "2018-12-17T18:42:50Z")

</div>

Urgent please help with assignment this class is making my gpa suffer! My assignment is to create a program that generates a random char value from 97 to 122 and then stores the number in a char variable. The screen wil…

---

## [Moving ellipse stop on black color](https://discourse.processing.org/t/moving-ellipse-stop-on-black-color/6572)

<div class="topic-metadata">

**Author:** [@Legate](https://discourse.processing.org/u/Legate)\
**Replies:** 2\
**Last updated:** [December 17, 2018, 6:14pm UTC](https://discourse.processing.org/t/moving-ellipse-stop-on-black-color/6572 "2018-12-17T18:14:19Z")

</div>

Hello friends, i need help with my school programming problem. We need to create ellipse/dot that automatically stops if it’s registers black color in it’s way. And starts following it’s path. Something like robots find…

---

## [I'm in a hurry! Dual cycle of how to move up and down](https://discourse.processing.org/t/im-in-a-hurry-dual-cycle-of-how-to-move-up-and-down/6640)

<div class="topic-metadata">

**Author:** [@lin](https://discourse.processing.org/u/lin)\
**Replies:** 5\
**Last updated:** [December 17, 2018, 2:08pm UTC](https://discourse.processing.org/t/im-in-a-hurry-dual-cycle-of-how-to-move-up-and-down/6640 "2018-12-17T14:08:51Z")

</div>

void setup() { size(640, 360); noStroke(); rectMode(CENTER); } void draw() { background(51); fill(255, 204); rect(mouseX, height/2, mouseY/2+10, mouseY/2+10); fill(255, 204); int inverseX = width-mouse…

---

## [Help with character spawning](https://discourse.processing.org/t/help-with-character-spawning/6687)

<div class="topic-metadata">

**Author:** [@Tarvis](https://discourse.processing.org/u/Tarvis)\
**Replies:** 1\
**Last updated:** [December 17, 2018, 6:08am UTC](https://discourse.processing.org/t/help-with-character-spawning/6687 "2018-12-17T06:08:11Z")

</div>

I haven’t been programming in processing or java that long, but I am trying to make a game where and enemy spawns at random inter volts, but my enemy program isn’t working. Any help? Thank you //var setup int high = 2; …

---

## [Anyone know how to Slow down my slideshow?](https://discourse.processing.org/t/anyone-know-how-to-slow-down-my-slideshow/6493)

<div class="topic-metadata">

**Author:** [@Halcyon](https://discourse.processing.org/u/Halcyon)\
**Replies:** 3\
**Last updated:** [December 16, 2018, 10:36pm UTC](https://discourse.processing.org/t/anyone-know-how-to-slow-down-my-slideshow/6493 "2018-12-16T22:36:20Z")

</div>

I am working on a slideshow that display my images repeatedly but the problem is that its showing it way too fast. How can I slow it down? Here is my code PImage\[\] images = new PImage\[4\]; int imageIndex = 0; int i=0;/…

---

## [How to make a complex interactive art work, including cover graphics, motion, variables, response, media, custom functions, array 7 elements](https://discourse.processing.org/t/how-to-make-a-complex-interactive-art-work-including-cover-graphics-motion-variables-response-media-custom-functions-array-7-elements/6675)

<div class="topic-metadata">

**Author:** [@hemi](https://discourse.processing.org/u/hemi)\
**Replies:** 1\
**Last updated:** [December 16, 2018, 10:25pm UTC](https://discourse.processing.org/t/how-to-make-a-complex-interactive-art-work-including-cover-graphics-motion-variables-response-media-custom-functions-array-7-elements/6675 "2018-12-16T22:25:05Z")

</div>

How to make a complex interactive art work, including cover graphics, motion, variables, response, media, custom functions, array 7 elements

---

## [Drawing Causes Out of Memory Errors](https://discourse.processing.org/t/drawing-causes-out-of-memory-errors/6453)

<div class="topic-metadata">

**Author:** [@dragon\_hatcher](https://discourse.processing.org/u/dragon_hatcher)\
**Replies:** 4\
**Last updated:** [December 15, 2018, 11:19pm UTC](https://discourse.processing.org/t/drawing-causes-out-of-memory-errors/6453 "2018-12-15T23:19:14Z")

</div>

So i posted this problem a little while ago by I did a bunch of testing and found out a whole lot more information. Basically I get an out of memory error after fifteen minutes (45224) frames. It always takes place on th…

---

## [Program freezing after draw() finished("Debugger busy..")](https://discourse.processing.org/t/program-freezing-after-draw-finished-debugger-busy/6348)

<div class="topic-metadata">

**Author:** [@jstsmedmb](https://discourse.processing.org/u/jstsmedmb)\
**Replies:** 2\
**Last updated:** [December 14, 2018, 5:40pm UTC](https://discourse.processing.org/t/program-freezing-after-draw-finished-debugger-busy/6348 "2018-12-14T17:40:42Z")

</div>

Hi there, I wanted to use this collision detection system http://jeffreythompson.org/collision-detection/circle-rect.php in an older code of mine because i thought it could make the if statements less complicated by ju…

---

## [Error in Processing program](https://discourse.processing.org/t/error-in-processing-program/6587)

<div class="topic-metadata">

**Author:** [@Smithy](https://discourse.processing.org/u/Smithy)\
**Replies:** 9\
**Last updated:** [December 14, 2018, 5:05pm UTC](https://discourse.processing.org/t/error-in-processing-program/6587 "2018-12-14T17:05:53Z")

</div>

Error in Processing program Error in Processing program, if you are a genius - come prove it :slight\_smile: Hi everyone, i am currently creating a game in which i have encountered a problem. My sketch isn’t able to run…

---

## [Transparency - tutorial](https://discourse.processing.org/t/transparency-tutorial/6598)

<div class="topic-metadata">

**Author:** [@fernando](https://discourse.processing.org/u/fernando)\
**Replies:** 6\
**Last updated:** [December 14, 2018, 3:58pm UTC](https://discourse.processing.org/t/transparency-tutorial/6598 "2018-12-14T15:58:28Z")

</div>

Hello The first code below is an example found in the interactivity tutorial. It draws rectangles with transparency. I modified this code to have the draw function do the work. See second code. However, the latter code …

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

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