All posts by /r/processing

How do i get my ellipses to loop ? stop growing at 200 then go down to 50 then back to 200?

Sorry , im just beginning at coding and I cant seem to figure out whats wrong with my code

My Code

The program descriptions is :

“Your program will continuously draw one red , one green and one blue circle that start with transparency of 0 and Height/width of 0. With every draw , all three parameters will increase by 1 until they reach 200 , after they max at 200 they will decrease by 1 until they reach 50. This sequence will repeat continuously.”

submitted by /u/bobbys3097
[link] [comments]

Probably an easy issue but it’s driving me crazy.

So I want to have a "dice roll" in a game I'm making in processing. I click the mouse and have it pick a random int between 1 and 6 and move a counter that many squares. I also want it to say "you rolled a _"

My problem is that the "you rolled a _" will only stay on screen for the mousepressed time. Is there a way to get this to stay for a bit longer? Maybe a few seconds.

I've looked at using time = millis () And then saying If (time < 2000) {

Text ()


But still just get the flash of the sentence every click.

Like I said I'm sure this is an easy fix. I'm very new to this and after watching a lot of tutorials I decided to just throw myself into something and try and muddle through.

Any suggestions?

submitted by /u/litlee
[link] [comments]

Help with scanline algorithm


I need to implement my function of filling polygons. I've been trying to follow this tutorial and data structure:, but I can't understand what would be the differences if I were to follow this tutorial using Processing (cause Processing uses the 0,0 position on the upper left corner of the screen while this tutorial follows the 0,0 position on the lowest left corner of the screen, or am I crazy?) I mean, is there a difference on the algorithm? I need to use a scanline algorithm, but couldn't find a good one to break down and understand. Would gladly accept some help. Thanks.

submitted by /u/capnjord
[link] [comments]

How do make many shapes in different locations move as a single unit?

I am very new to processing and I have an assignment to make a creature move around. I know how to make a single item move wherever but how do I keep the creature whole while moving? Do I just take account for the coordinates and move each segment alone but appear to be together? I'm lost here. I have several other questions but I think I can tackle those on my own.

submitted by /u/Comet0707
[link] [comments]

New to processing, help with network library

Hello r/processing community. I have some questions to ask because i'm new to processing and some things are messed up in my mind. I will write my questions here one by one.

Before i start let me inform you that i have already read the following links i) ii) iii)

1) I want to share a canvas (an Elemental Cellular Automata) to another device (i'm using raspberry pi's), so obviously i'm using the net library and i create a server and a client.

On the client side which method am i supposed to use to depict the canvas to the server ? From the documentation ( my guess the method i think i have to use is readBytes(), but from the name itself something doesn't feel right.

2) Is it possible to assign a client to depict half (50%) of the canvas to the server and the other half (50%) from another client ? If yes, its has to do with void setup() { size(200, 200); } or something else ?

Sorry for bothering, thanks for reading and i hope to hear for your input.

submitted by /u/antonis13
[link] [comments]