# New to processing and just need some quick guidance please

**URL:** <https://discourse.processing.org/t/new-to-processing-and-just-need-some-quick-guidance-please/37695>\
**Category:** Beginners\
**Created:** [June 23, 2022, 7:21pm UTC](https://discourse.processing.org/t/new-to-processing-and-just-need-some-quick-guidance-please/37695 "2022-06-23T19:21:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![NoobyDooby](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@NoobyDooby](https://discourse.processing.org/u/NoobyDooby)\
**Post date:** [June 23, 2022, 7:21pm UTC](https://discourse.processing.org/t/new-to-processing-and-just-need-some-quick-guidance-please/37695/1 "2022-06-23T19:21:12Z")

</div>

Hello!

I’m very new to processing and have been watching tons of code train videos. At the moment I’ve spent some time looking at projects from the openprocessing website and have had tons of fun with it.

There are some projects that I cant get to work and I cant figure out why: [Brush Drawing 2 - OpenProcessing](https://openprocessing.org/sketch/1104958) &&& [Marielle Semente - OpenProcessing](https://openprocessing.org/sketch/873380)

Both are giving me error messages from the very beginning where the variables are declared. i.e:

```auto
var balls = [];
var seeds = [];
var trees = [];
var leaves = [];

```

It’s always whenever doing an array as above, the whole code is on the links above.

Any guidance is appreciated, sorry it comes as a dumb question for more experienced users!

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 23, 2022, 7:41pm UTC](https://discourse.processing.org/t/new-to-processing-and-just-need-some-quick-guidance-please/37695/2 "2022-06-23T19:41:05Z")

</div>

Processing is a multi-programming-language framework library family.  
Those 2 sketches are written in JavaScript for Processing’s flavor p5.js:

> **[home | p5.js](https://p5js.org)**
>
> p5.js a JS client-side library for creating graphic and interactive experiences, based on the core principles of Processing.

> **[JavaScript | MDN](https://developer.Mozilla.org/en-US/docs/Web/JavaScript)**
>
> JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions. While it is most well-known as the scripting language for Web pages, many non-browser environments also use it, such as Node.js,...

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [June 23, 2022, 7:48pm UTC](https://discourse.processing.org/t/new-to-processing-and-just-need-some-quick-guidance-please/37695/3 "2022-06-23T19:48:56Z")

</div>

Hi @NoobyDooby,

When I click links from your posts everything works fine !?

What do you try to do?  
Are you trying to run that code in Processing PDE (java)?  
That won’t work because that code isn’t made for it.

Cheers  
— mnse

---

<div class="post-metadata">

**Author:** ![NoobyDooby](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@NoobyDooby](https://discourse.processing.org/u/NoobyDooby)\
**Post date:** [June 23, 2022, 7:52pm UTC](https://discourse.processing.org/t/new-to-processing-and-just-need-some-quick-guidance-please/37695/4 "2022-06-23T19:52:34Z")

</div>

Thank you for responding!

I am trying to run the code locally, so that I can tweak some things like the picture and the colors for example.

The code runs on the website but if I run it from the processing 4 locally on my laptop I get the errors.

Thanks for claryfing it wont work. How can I make this work for my testing purposes?

---

<div class="post-metadata">

**Author:** ![javagar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/javagar/32/11434_2.png) [@javagar](https://discourse.processing.org/u/javagar)\
**Post date:** [June 23, 2022, 7:59pm UTC](https://discourse.processing.org/t/new-to-processing-and-just-need-some-quick-guidance-please/37695/5 "2022-06-23T19:59:19Z")

</div>

> [@NoobyDooby](#):
>
> … if I run it from the processing 4 locally on my laptop I get the errors.

You need to run it in p5.js mode.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 23, 2022, 8:31pm UTC](https://discourse.processing.org/t/new-to-processing-and-just-need-some-quick-guidance-please/37695/6 "2022-06-23T20:31:17Z")

</div>

> [@NoobyDooby](#):
>
> How can I make this work for my testing purposes?

- When you’re signed in, at the far right side, click at the icon next to your avatar to open a panel that shows a clickable “sketchxxxxxx.zip” file.
- Unpack that file’s content into some folder of your choice.
- There are numerous ways to run those files (HTML + JS).
- PDE’s “p5.js mode” is 1 of them, as it’s already been mentioned by @javagar.
- But a more better way is to install a local HTTP server and run it from there.
- My HTTP server of choice is the npm pack “serve”:

[https://www.npmjs.com/package/serve](https://www.npmjs.com/package/serve)

- For that 1st you’re gonna need to install JS runtime “Node.js”:

> **[Node.js — Run JavaScript Everywhere](https://nodejs.org/en)**
>
> Node.js® is a free, open-source, cross-platform JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts.

- Once the installation is done, open the command line terminal and paste this: npm -g i serve
- Last thing is creating a “.bat” file which will invoke “serve” at the current folder followed by opening your default browser:

## “run.bat”

```auto
set port=%random%
start serve -l %port%
start http://localhost:%port%

```

- Finally, place that file in the same folder you’ve unpacked your sketch files and run it.

---

<div class="post-metadata">

**Author:** ![NoobyDooby](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@NoobyDooby](https://discourse.processing.org/u/NoobyDooby)\
**Post date:** [June 23, 2022, 9:31pm UTC](https://discourse.processing.org/t/new-to-processing-and-just-need-some-quick-guidance-please/37695/7 "2022-06-23T21:31:56Z")

</div>

I cant thank you enogh for that answer, thanks so much!!!

It worked and I can now start to make my own projects. Thank you for writing such detailed answer!
