# Coding Questions

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

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

**Page:** 7

---

## [How make game independent of frame rate](https://discourse.processing.org/t/how-make-game-independent-of-frame-rate/44312)

<div class="topic-metadata">

**Author:** [@payalo](https://discourse.processing.org/u/payalo)\
**Replies:** 1\
**Last updated:** [April 18, 2024, 4:40pm UTC](https://discourse.processing.org/t/how-make-game-independent-of-frame-rate/44312 "2024-04-18T16:40:18Z")

</div>

how i can make game independent of frame rate? example: frame rate is 360 = all functions are perform 360 times per second frame rate is 240 = all functions are perform 240 times per second frame rate is 120 = all fu…

---

## [P5.js translation to Processing (saving frames)](https://discourse.processing.org/t/p5-js-translation-to-processing-saving-frames/44267)

<div class="topic-metadata">

**Author:** [@humano](https://discourse.processing.org/u/humano)\
**Replies:** 7\
**Last updated:** [April 13, 2024, 1:29pm UTC](https://discourse.processing.org/t/p5-js-translation-to-processing-saving-frames/44267 "2024-04-13T13:29:10Z")

</div>

Hello! I am working with an open processing sketch of constructivist art. I have translated to processing and I am trying to save a picture everytime the animation stops, but it makes the sketch so slow and it rewrite t…

---

## [Keep appearing missing operator, semicolon or} near waveCircle](https://discourse.processing.org/t/keep-appearing-missing-operator-semicolon-or-near-wavecircle/44263)

<div class="topic-metadata">

**Author:** [@lalala](https://discourse.processing.org/u/lalala)\
**Replies:** 1\
**Last updated:** [April 10, 2024, 4:21pm UTC](https://discourse.processing.org/t/keep-appearing-missing-operator-semicolon-or-near-wavecircle/44263 "2024-04-10T16:21:10Z")

</div>

hi everyone, as the title says, an error will appear everytime i want to run the coding, ut i checked several times and cant find the problem, please help me… float step=TWO\_PI/10; float t=0; void setup() { size(400…

---

## [Movie.width and movie.length do not always work depending on movie](https://discourse.processing.org/t/movie-width-and-movie-length-do-not-always-work-depending-on-movie/44260)

<div class="topic-metadata">

**Author:** [@lucedan](https://discourse.processing.org/u/lucedan)\
**Replies:** 1\
**Last updated:** [April 10, 2024, 8:26am UTC](https://discourse.processing.org/t/movie-width-and-movie-length-do-not-always-work-depending-on-movie/44260 "2024-04-10T08:26:01Z")

</div>

I have two movies: mov1 and mov2. If I run the following code in draw() by selecting mov1, everything works fine \*at every launch". Instead, if I run it by selecting mov2, I sometimes get the error “Width (0) and height…

---

## [I need help with creating different platforms that my character is able to jump on and making jumping smoother](https://discourse.processing.org/t/i-need-help-with-creating-different-platforms-that-my-character-is-able-to-jump-on-and-making-jumping-smoother/44117)

<div class="topic-metadata">

**Author:** [@Corn](https://discourse.processing.org/u/Corn)\
**Replies:** 4\
**Last updated:** [April 8, 2024, 1:02pm UTC](https://discourse.processing.org/t/i-need-help-with-creating-different-platforms-that-my-character-is-able-to-jump-on-and-making-jumping-smoother/44117 "2024-04-08T13:02:29Z")

</div>

int PlatX = 400; //Platform X-coordinate int PlatY = 300; //Platform Y-coordinate PImage StonePlatform; int yvel = 1;//Setting the speed of the platforms. int blocklength = 100;//Setting the length of the platforms. …

---

## [loadBytes() not reading the entirety of JPEG file?](https://discourse.processing.org/t/loadbytes-not-reading-the-entirety-of-jpeg-file/44241)

<div class="topic-metadata">

**Author:** [@bbcwarrior](https://discourse.processing.org/u/bbcwarrior)\
**Replies:** 2\
**Last updated:** [April 7, 2024, 8:43pm UTC](https://discourse.processing.org/t/loadbytes-not-reading-the-entirety-of-jpeg-file/44241 "2024-04-07T20:43:13Z")

</div>

I’m trying to create something like a hex editor for JPEG files in processing, and running this piece of code with any JPEG file results in a correct output, but one that excludes major parts of the file. byte b\[\] = l…

---

## [Need help coding pacman for university](https://discourse.processing.org/t/need-help-coding-pacman-for-university/44208)

<div class="topic-metadata">

**Author:** [@Hellafraid](https://discourse.processing.org/u/Hellafraid)\
**Replies:** 3\
**Last updated:** [April 3, 2024, 8:35am UTC](https://discourse.processing.org/t/need-help-coding-pacman-for-university/44208 "2024-04-03T08:35:42Z")

</div>

Can someone help me with creating a processing program that animates PacMan that can move left to right across the screen and can change directions if the spacebar is pressed. and appear from the other side once it rea…

---

## [Can I use a string as a command?](https://discourse.processing.org/t/can-i-use-a-string-as-a-command/44200)

<div class="topic-metadata">

**Author:** [@Naorius](https://discourse.processing.org/u/Naorius)\
**Replies:** 17\
**Last updated:** [April 2, 2024, 8:48pm UTC](https://discourse.processing.org/t/can-i-use-a-string-as-a-command/44200 "2024-04-02T20:48:44Z")

</div>

I have 55 images named alien1 - alien55 (I have a reason not to use a PImage array), instead of typing the draw() command for each one, I used a for loop: void draw() { for (int i; i=0; i\<54 i=i+1){ if (aliendr…

---

## [Why will start not = true?](https://discourse.processing.org/t/why-will-start-not-true/44215)

<div class="topic-metadata">

**Author:** [@WillyGrz](https://discourse.processing.org/u/WillyGrz)\
**Replies:** 1\
**Last updated:** [April 2, 2024, 3:14pm UTC](https://discourse.processing.org/t/why-will-start-not-true/44215 "2024-04-02T15:14:12Z")

</div>

I’ve been out of coding for a few months and am trying to get back into it with a platformer. Was working on the backbone, and I can’t make start true with anything! Any ideas? float playerX; float playerY; boolean st…

---

## [Is there a way to add Listeners to the PApplet?](https://discourse.processing.org/t/is-there-a-way-to-add-listeners-to-the-papplet/17895)

<div class="topic-metadata">

**Author:** [@LoliProcessor](https://discourse.processing.org/u/LoliProcessor)\
**Replies:** 6\
**Last updated:** [April 1, 2024, 3:55am UTC](https://discourse.processing.org/t/is-there-a-way-to-add-listeners-to-the-papplet/17895 "2024-04-01T03:55:51Z")

</div>

I need to have an InputMethodListener for Japanese and Chinese input methods, is there a way to have the sketch listen to them? Just like someone reads my post

---

## [keyPressed() combos - How can I check for UP and SHIFT in a switch()](https://discourse.processing.org/t/keypressed-combos-how-can-i-check-for-up-and-shift-in-a-switch/44148)

<div class="topic-metadata">

**Author:** [@vkbr](https://discourse.processing.org/u/vkbr)\
**Replies:** 10\
**Last updated:** [March 31, 2024, 1:19am UTC](https://discourse.processing.org/t/keypressed-combos-how-can-i-check-for-up-and-shift-in-a-switch/44148 "2024-03-31T01:19:43Z")

</div>

Hello folks. I have this gigantic switch for handling keys inputs. Thats all fine. But I’m using “keyEvent.isShiftDown()” (sugested by chat gpt) and PDE complains: “The field PApplet.keyEvent is deprecated” How sho…

---

## [Responsive problem with noise](https://discourse.processing.org/t/responsive-problem-with-noise/44184)

<div class="topic-metadata">

**Author:** [@vjjv](https://discourse.processing.org/u/vjjv)\
**Replies:** 0\
**Last updated:** [March 30, 2024, 10:58am UTC](https://discourse.processing.org/t/responsive-problem-with-noise/44184 "2024-03-30T10:58:37Z")

</div>

Hello! Im having a problem with this noise class for a project. Is not fully responsive and the values are changing when i change the size of the screen. I tried a lot of things and i couldnt get it work. let r let toke…

---

## [Display size calculations problem](https://discourse.processing.org/t/display-size-calculations-problem/44151)

<div class="topic-metadata">

**Author:** [@Jellyfish\_Grave](https://discourse.processing.org/u/Jellyfish_Grave)\
**Replies:** 4\
**Last updated:** [March 24, 2024, 4:46pm UTC](https://discourse.processing.org/t/display-size-calculations-problem/44151 "2024-03-24T16:46:42Z")

</div>

I came accross a problem while making my current project. The concept would be to create a black square on a white background of 1000 by 1000 pixels, but have it be at the center of the screen. Taking into account the fa…

---

## [Using the mouse position to zoom in on a map](https://discourse.processing.org/t/using-the-mouse-position-to-zoom-in-on-a-map/44137)

<div class="topic-metadata">

**Author:** [@CharmanderProgrammer](https://discourse.processing.org/u/CharmanderProgrammer)\
**Replies:** 10\
**Last updated:** [March 22, 2024, 6:19pm UTC](https://discourse.processing.org/t/using-the-mouse-position-to-zoom-in-on-a-map/44137 "2024-03-22T18:19:08Z")

</div>

void draw() { if(w) {camY -= 5;} if(s) {camY += 5;} if(a) {camX -= 5;} if(d) {camX += 5;} background(220); push(); translate(mouseX, mouseY); scale(camScale); translate(-mouseX, -mouseY); transla…

---

## [How to rotate Pacman's animation face](https://discourse.processing.org/t/how-to-rotate-pacmans-animation-face/44129)

<div class="topic-metadata">

**Author:** [@Challenger](https://discourse.processing.org/u/Challenger)\
**Replies:** 1\
**Last updated:** [March 21, 2024, 8:30am UTC](https://discourse.processing.org/t/how-to-rotate-pacmans-animation-face/44129 "2024-03-21T08:30:32Z")

</div>

hi guys, I am having trouble reversing the pacmans face when moving pacman backwards, any ideas? heres the code i’ve been working on for my homework: boolean pacopen = true; float pacwidth = 0; float mouthclose = TWO\_P…

---

## [How to make 1 rectangle on mouse click and not make a million, but still change colour depending on mouse position](https://discourse.processing.org/t/how-to-make-1-rectangle-on-mouse-click-and-not-make-a-million-but-still-change-colour-depending-on-mouse-position/44107)

<div class="topic-metadata">

**Author:** [@celestia](https://discourse.processing.org/u/celestia)\
**Replies:** 6\
**Last updated:** [March 16, 2024, 10:05pm UTC](https://discourse.processing.org/t/how-to-make-1-rectangle-on-mouse-click-and-not-make-a-million-but-still-change-colour-depending-on-mouse-position/44107 "2024-03-16T22:05:32Z")

</div>

Help needed. We need to make an algorithm where: if you click somewhere with left mouse button, a rectangle appears (so if you click again with left mouse button, another one will appear and the old one will remain) if…

---

## [Line Loop bouncing](https://discourse.processing.org/t/line-loop-bouncing/44090)

<div class="topic-metadata">

**Author:** [@humano](https://discourse.processing.org/u/humano)\
**Replies:** 23\
**Last updated:** [March 15, 2024, 10:38pm UTC](https://discourse.processing.org/t/line-loop-bouncing/44090 "2024-03-15T22:38:20Z")

</div>

Hello! how could I reduce speed of these lines in this sketch? I tried frameRate but it did not work. Thanks! float x; float xDirection; void setup() { size(800,1000); colorMode(HSB,360,100,100); background(360)…

---

## [Understanding coordinates in Processing. Help! Thank you](https://discourse.processing.org/t/understanding-coordinates-in-processing-help-thank-you/44084)

<div class="topic-metadata">

**Author:** [@BBG](https://discourse.processing.org/u/BBG)\
**Replies:** 6\
**Last updated:** [March 15, 2024, 3:34pm UTC](https://discourse.processing.org/t/understanding-coordinates-in-processing-help-thank-you/44084 "2024-03-15T15:34:05Z")

</div>

//This is a lesson to understand coordinates with lines in processing. void setup(){ size(600, 600); } void draw(){ background (255); //white //DRAW SQUARE WITH LINES stroke(0); line(100, 200, 100, 400); line(10…

---

## [RegEx Expression for matchAll() for Bible References?](https://discourse.processing.org/t/regex-expression-for-matchall-for-bible-references/43937)

<div class="topic-metadata">

**Author:** [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Replies:** 7\
**Last updated:** [March 13, 2024, 3:56pm UTC](https://discourse.processing.org/t/regex-expression-for-matchall-for-bible-references/43937 "2024-03-13T15:56:45Z")

</div>

Hello all! I am looking for a RegEx Expression for matchAll() for Bible References. I found a version for JavaScript but it doesn’t work in Processing. Full code below. Because in Processing I get an error, Syntax er…

---

## [I've created a multilinear noise generator (and need help)](https://discourse.processing.org/t/ive-created-a-multilinear-noise-generator-and-need-help/44083)

<div class="topic-metadata">

**Author:** [@Tsskyx](https://discourse.processing.org/u/Tsskyx)\
**Replies:** 3\
**Last updated:** [March 12, 2024, 7:22pm UTC](https://discourse.processing.org/t/ive-created-a-multilinear-noise-generator-and-need-help/44083 "2024-03-12T19:22:37Z")

</div>

I wanted to challenge myself and create my own noise generator which would work with arbitrary many dimensions, have no symmetry artifacts around the origin, etc. I also wanted it to be linear, because I wanted to know h…

---

## [How to converting ShaderToy shader color channel to Processing correctly](https://discourse.processing.org/t/how-to-converting-shadertoy-shader-color-channel-to-processing-correctly/43965)

<div class="topic-metadata">

**Author:** [@psamead](https://discourse.processing.org/u/psamead)\
**Replies:** 2\
**Last updated:** [March 9, 2024, 8:17pm UTC](https://discourse.processing.org/t/how-to-converting-shadertoy-shader-color-channel-to-processing-correctly/43965 "2024-03-09T20:17:25Z")

</div>

Hi my friends, I am trying to convert this ShaderToy shader (link to Shadertoy shader) to the Processing, but the processing seems to have different color channel, as shown below: In Shadertoy shader by using this sect…

---

## [Millis() rolls over after 24 days](https://discourse.processing.org/t/millis-rolls-over-after-24-days/44039)

<div class="topic-metadata">

**Author:** [@schmittmachine](https://discourse.processing.org/u/schmittmachine)\
**Replies:** 5\
**Last updated:** [March 8, 2024, 12:47pm UTC](https://discourse.processing.org/t/millis-rolls-over-after-24-days/44039 "2024-03-08T12:47:05Z")

</div>

Hello, as the return value of millis() is an int, it rolls over after 2147483647 ms, that is 24.8 days. long t0 = System.currentTimeMillis(); long t1 = t0 + 2147483647 + 10; int dt = (int)(t1 - t0); println(“dt=”+dt…

---

## [Improving the accuracy of a neural network for digit recognition](https://discourse.processing.org/t/improving-the-accuracy-of-a-neural-network-for-digit-recognition/22139)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 3\
**Last updated:** [March 4, 2024, 4:02pm UTC](https://discourse.processing.org/t/improving-the-accuracy-of-a-neural-network-for-digit-recognition/22139 "2024-03-04T16:02:32Z")

</div>

I’m attempting to code a neural network to recognise handwritten characters currently using the mnist digit database. I’m specifically using a lower 14x14 resolution. I created a new neural network which is initialised …

---

## [Flip (flop?) texture in a 3d .obj loaded. (java)](https://discourse.processing.org/t/flip-flop-texture-in-a-3d-obj-loaded-java/44023)

<div class="topic-metadata">

**Author:** [@vkbr](https://discourse.processing.org/u/vkbr)\
**Replies:** 1\
**Last updated:** [March 4, 2024, 12:33am UTC](https://discourse.processing.org/t/flip-flop-texture-in-a-3d-obj-loaded-java/44023 "2024-03-04T00:33:04Z")

</div>

Hello everyone. long time no see… : ) I.m loading an file.obj but the texture is flipped or flopped, not sure. Can I flip it? I’m using the example code for loading shapes so far. The model has this files: so the…

---

## [How do you make or do overlaps?](https://discourse.processing.org/t/how-do-you-make-or-do-overlaps/44010)

<div class="topic-metadata">

**Author:** [@QuWack-fan-Duck](https://discourse.processing.org/u/QuWack-fan-Duck)\
**Replies:** 2\
**Last updated:** [March 1, 2024, 3:52pm UTC](https://discourse.processing.org/t/how-do-you-make-or-do-overlaps/44010 "2024-03-01T15:52:00Z")

</div>

how can you create or do overlaps to make something happen

---

## [Maintaining same visual angle of stacked layers](https://discourse.processing.org/t/maintaining-same-visual-angle-of-stacked-layers/43995)

<div class="topic-metadata">

**Author:** [@travis.stdenis](https://discourse.processing.org/u/travis.stdenis)\
**Replies:** 7\
**Last updated:** [February 29, 2024, 5:35am UTC](https://discourse.processing.org/t/maintaining-same-visual-angle-of-stacked-layers/43995 "2024-02-29T05:35:20Z")

</div>

What I’m trying to achieve is cross-sections of a 3D noise cube. The look I’m going for is like this: But what I’m getting is more like this given the default perspective of the environment giving the conical perspec…

---

## [Fixing diagonal movement speed (FIXED)](https://discourse.processing.org/t/fixing-diagonal-movement-speed-fixed/43991)

<div class="topic-metadata">

**Author:** [@Np3](https://discourse.processing.org/u/Np3)\
**Replies:** 5\
**Last updated:** [February 25, 2024, 11:21pm UTC](https://discourse.processing.org/t/fixing-diagonal-movement-speed-fixed/43991 "2024-02-25T23:21:35Z")

</div>

Firstly, I apologize if this question seems dumb, I’ve only been coding in processing for about 2 months. I’m trying to create a top-down game, and as of right now, I have a blue square (player) that gets chased around …

---

## [Adding a mini game to my visual novel](https://discourse.processing.org/t/adding-a-mini-game-to-my-visual-novel/43986)

<div class="topic-metadata">

**Author:** [@omagash](https://discourse.processing.org/u/omagash)\
**Replies:** 8\
**Last updated:** [February 25, 2024, 6:50pm UTC](https://discourse.processing.org/t/adding-a-mini-game-to-my-visual-novel/43986 "2024-02-25T18:50:00Z")

</div>

Hi everyone! I am working on a visual novel game project and I wanted to add a mini game(flappy birds) as a seperate challenge to enter the next chapter to the story. I am struggling with adding the game code that my te…

---

## [How to add images?](https://discourse.processing.org/t/how-to-add-images/43963)

<div class="topic-metadata">

**Author:** [@WillyGrz](https://discourse.processing.org/u/WillyGrz)\
**Replies:** 2\
**Last updated:** [February 21, 2024, 5:23pm UTC](https://discourse.processing.org/t/how-to-add-images/43963 "2024-02-21T17:23:08Z")

</div>

Hey, i’m only a few moths in but can’t figure out how to load images. All tutorials I see on this are either from a different processing like 3, or I can’t understand. They have a bunch of folders to put it into, and I …

---

## [Problem on my Game](https://discourse.processing.org/t/problem-on-my-game/43939)

<div class="topic-metadata">

**Author:** [@NoKyNo](https://discourse.processing.org/u/NoKyNo)\
**Replies:** 2\
**Last updated:** [February 21, 2024, 12:16pm UTC](https://discourse.processing.org/t/problem-on-my-game/43939 "2024-02-21T12:16:22Z")

</div>

Its my main code Player witch; boolean left, up, right,jump,test; PImage playerArt; PImage fondImage,cloud1,cloud2,rainbow1,rainbow2,tree1,tree2,tree3,tree4,grass,cobble,fondgris,fondmar,fondmar2; int \[\] maprow= {1, 1,…

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

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