Skip to main content
Filter by
Sorted by
Tagged with
3 votes
1 answer
121 views

As the title states, a strange visual bug keeps happening with my pixel art program. When I scale down using pushMatrix(), scale() and popMatrix(). I can't really describe the bug, so I got a ...
Voxel's user avatar
  • 84
-1 votes
1 answer
76 views

As the title states, I want to know how to pixelate noise. I am using the code below to optimize performance: var totalXoff = 0.0; var draw = function() { background(0, 255, 255); if (!this....
Voxel's user avatar
  • 84
0 votes
1 answer
450 views

I want to filter a large array list into multiple arrays for every 5 items in a certain way so that [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] would be [[1, 2, [3, 4, 5]], [6, 7, [8, 9, 10]]] or [1, 2, 3, 4, 5, ...
Voxel's user avatar
  • 84
0 votes
1 answer
110 views

I added something to my code that's supposed to detect when an object (pixel) already exists, and then replace the color instead of creating a new one. However, for some reason, it just doesn't do ...
Voxel's user avatar
  • 84
0 votes
1 answer
133 views

I am trying to convert the code I created in khan academy (processingJS library) to Code Sandbox (p5.js). Any assistance would be great. I am having trouble with the background and text functions. ...
devinefeminine's user avatar
0 votes
1 answer
280 views

This isn't a problem, just asking out of curiosity: How do HTML/JS projects which include the ProcessingJS library work even when offline, given that the library link is the standard https kind and ...
Quack E. Duck's user avatar
0 votes
0 answers
63 views

I am running a processing js program in a webpage, using the canvas to draw my game. I have overwritten some of the functions in javascript so I can use degrees as an input to the processing js ...
Oyster_Bucket's user avatar
1 vote
1 answer
117 views

I saved the processing code into visual studio code as a plain text file, i added the images/gradient.jpg as well as for the logo. I replaced the img code to canvas code and yet no animated logo ...
Arashjot Kaur's user avatar
0 votes
1 answer
68 views

(All in JavaScript) I need help, I am an absolute beginner in coding, I am currently learning at Khan Academy and was in the making of a new project: a menu screen for a game. Now I was successfully ...
user16612702's user avatar
2 votes
1 answer
55 views

I'm currently trying to make a game themed around zombies, so I made a function that is supposed to draw an ellipse on the canvas that represents the zombie. I am unable to figure out how to get the ...
MediocreBeginner's user avatar
1 vote
1 answer
122 views

I'm trying to convert some code I wrote for processing.js to use p5.js. In the existing code, I create an object with a statement like processing = new Processing(canvas, p => (p.draw = draw_frame))...
Eric Pruitt's user avatar
  • 1,903
1 vote
1 answer
325 views

I've built a pretty large game(10,000 lines of code) in Processing.js and was able to have it run inside a webpage by loading the library. Here is an example: <!DOCTYPE html> <html> <...
Oyster_Bucket's user avatar
0 votes
1 answer
176 views

I'm trying to get my processing.js application working on web browsers. When I'm running it on Processing 3.5.4 (on Windows) everything's fine, but on HTML it draws everything but the sounds don't ...
ofer dofer's user avatar
1 vote
1 answer
360 views

I could manage to cache the array as pixels on my canvas with the help of this code using loadPixels(); and updatePixels(); functions. The problem with that method is it's loading/updating the whole ...
ofer dofer's user avatar
1 vote
1 answer
463 views

I would like to create my own lerpColor(c1, c2, amount) function, with the same output as the one in ProcessingJS http://processingjs.org/reference/lerpColor_/ I am looking or something like this: ...
user avatar
0 votes
1 answer
628 views

I want to make a door open when the user clicks on it. Here's how the code looks like: with(processing) { noStroke(); size(1200, 900); background(255, 153, 153); var x ...
Sheryl's user avatar
  • 1
0 votes
0 answers
133 views

In Khan Academy computer programming environment, I can use get(x,y,width,height) to capture the pixel data as an image. var img = get(x,y,width,height);//make a variable that stores the image Then, ...
Oyster_Bucket's user avatar
0 votes
0 answers
42 views

I have data that is sent from a microcontroller to a python neural network over serial to process, where then, its output needs to be sent to a Processing.js script to visualize. My question is what ...
Ietpt123's user avatar
0 votes
2 answers
191 views

I am working on drawing a tulip flower in ProcessingJS. I have code as below. The code will draw a tulip flower with a petal, and x, y, height is the preference for pedal location and height. `/**...
Minh Ho's user avatar
  • 63
0 votes
0 answers
214 views

I'm building a 3D visualizer in Processing.js with python that visualizes the orientation of an object in space in realtime. The problem is, the sensor I'm using to check the object orientations has ...
Ietpt123's user avatar
0 votes
1 answer
121 views

I have a site written in PHP, with a database through MySQL and PHPMyAdmin. I'm trying to use a Processing sketch to apply effects on the images users upload to their account. I have included the base ...
SRowdy's user avatar
  • 1
-1 votes
2 answers
122 views

does anyone know whether it is better (memory wise, or faster) to use Math.random() or random() in Khan Academy's programming environment? Used "random" as an example, I am reffering to any of the ...
Oyster_Bucket's user avatar
1 vote
1 answer
82 views

quick question about a game engine I am writing in Javascript in Khan Academy: i have on arc that represents the amount of reload time left. (in processing js, drawing an arc works like this: arc(x,y,...
Oyster_Bucket's user avatar
1 vote
1 answer
874 views

The code in question is this: void update() { int nearbyYou = 0; int nearbyWork = 0; int nearbyCap = 0; int nearbyDead = 0; for (int iter = 0; iter < 8; iter = iter + 1) { switch ...
OWLSOUL's user avatar
  • 23
0 votes
1 answer
38 views

I keep getting this error, and I have no clue what is wrong. I checked all variables, but all of them are defined at least somewhere int creatures = 5; int deathChance = 5; int repChance = 10; int ...
ABluAxolotl's user avatar
0 votes
1 answer
131 views

I have a processing program which I want to display on a browser in an html file. I found an instruction on https://cs.nyu.edu/~kapp/cs101/processing_on_the_web/. It still does not show up in my ...
Thomas Filippo Marinho's user avatar
0 votes
1 answer
236 views

I'm looking at an example from Nature of Code. The particular example has a ball accelerate towards the cursor. However, it does not stop when it reaches it, actually it has maximum momentum, and ...
R0b0tn1k's user avatar
  • 4,314
-1 votes
1 answer
394 views

I am doing an online Javascript course in khan academy. I am doing a project on that course. I want my object to change shape from eclipse to a rectangle and repeat it while moving. I wrote a code. ...
Nilushi Andradi's user avatar
1 vote
1 answer
61 views

I am building a simulation of a microwave web app for my thesis. I found out that with Processing was exactly what I was looking for and with the processing.js it is possible to run it in a web page ...
Harrison W.'s user avatar
0 votes
0 answers
45 views

The goal of my program is to see what planets come within a certain angle of each other, and stop the program. I have having issues specifically with the angle part. This program is on khan academy, ...
Alexrobert01's user avatar
0 votes
0 answers
36 views

I made a script that works on KhanAcademy but when I'm trying to execute it on the program processing 3, it indicates multiple errors like missing semicolon where there shouldn't be one and it doesn't ...
Andréa's user avatar
  • 11
0 votes
0 answers
109 views

In processing javascript, you do something like this to add an animation: <html> ... <body> <canvas id="canvas"></canvas> </body> ... <script> var sketch=function(...
SourceEngine's user avatar
0 votes
0 answers
332 views

I'm trying to move a canon left and right depending on which arrow (left or right) the user is pressing. This is my code: size(400, 400, P2D); //Constructor canon var Canon = function(canonX, canonY,...
Andréa's user avatar
  • 11
0 votes
0 answers
65 views

I try to link a .pde file to the html element canvas but I'm somehow failing to. This is the code I'm trying: <!DOCTYPE html> <html> <head> <meta charset="utf-8" />...
Andréa's user avatar
  • 11
2 votes
1 answer
283 views

So, I’m trying to make a basic physics simulation in Processing JS. I want the user to be able to control a ball by dragging it. They should be able to move it around and throw it in the air by ...
AlexH's user avatar
  • 866
3 votes
2 answers
152 views

The for loop does not run like I would expect it to. I would expect the for loop to run only once, but when I run it, it shows an animation. The programming environment I am using: https://www....
Bob Smith's user avatar
-1 votes
1 answer
139 views

I'm trying to let i be the square root of -1 (sqrt(-1)). It is a defined value: i = sqrt(-1) var i = sqrt(-1); fill(0, 0, 0); text(i, 25, 25); It gives me an error. What happened?
user avatar
0 votes
0 answers
102 views

I am trying to simulate pendulum with moving pivot in processing.js. My question is, how to calculate angle at which my pendulum swing (while pivot is moving), based on pivot velocity? I searched all ...
Arashii's user avatar
  • 21
0 votes
0 answers
36 views

I created an ArrayList function signature to find all the maximum household incomes from year 1984 to 2016. Now I wanted to find the maximum value from that ArrayList. I tried to use max() but it ...
boonboon93's user avatar
3 votes
2 answers
119 views

I get different results when running this sample with Processing directly, and with Processing.js in a browser. Why? I was happy about my result and wanted to share it on open Processing, but the ...
Alchemille's user avatar
1 vote
0 answers
223 views

I'm making a game in Processing.js, and I need to add two custom fonts. The second one I load works fine (OXYGENE1.TTF). However the first one I load doesn't work at all (CenturyGothic.ttf). Here is ...
Sam Hill's user avatar
  • 156
1 vote
1 answer
160 views

I have made an object with the object elevation, yet when a try accessing it using an array, the debugger states it is undefined. var h = 30; var disk = function(pos,elv){ this.pos = pos; ...
hello's user avatar
  • 39
3 votes
1 answer
6k views

Here is my current project code: size(500,500); background(255, 255, 255); fill(250,0,0); ellipse(150, 230, 100, 200); fill(10,0,0); ellipse(180, 233, 30, 30); fill(10,0,0); ellipse(120, ...
Ben2050's user avatar
  • 31
0 votes
1 answer
1k views

So I just recently kind of had a breakthrough in Neural Nets and made a couple of games with NN AI's. For training, I use frameRate(100000) to jack the frame rate up. However, checking with println(...
DontJudgeMe's user avatar
1 vote
2 answers
259 views

I try to make a web application. You can change cells of the array by pressing arrow keys here. There is a class "Module" with methods display() and update(). These methods change the inner array ...
demsp's user avatar
  • 15
2 votes
2 answers
333 views

I have created a sketch file using processing.js and saved it to a pde file. I saved the processing.js source file, my html file, and my sketch pde file and get the following error in the chrome ...
Labib Hussain's user avatar
0 votes
1 answer
284 views

I created this little animated Bezier sketch with Perlin noise. Any ideas why all of the points (in different 2d space) approach 0 all at once at seemingly regular intervals? z offset changes by ....
shramee's user avatar
  • 5,099
1 vote
1 answer
108 views

I am an amateur musician and I teach music basics to school children who have little to no prior music education. I've coded a small app in Processing.JS which shows the 12 musical notes of the ...
Boloar's user avatar
  • 73
1 vote
1 answer
333 views

I am trying to make my Processing.js game (which is in an html file) into an .exe file but I don't understand how. It works fine when opened in a browser but I want to make it an .exe file for easy ...
Pranav K.'s user avatar
0 votes
1 answer
51 views

So, I'm trying to programmatically add an image to my canvas, from a Javascript function : // Spawn function var spawnWrapper = function() { myCanvas = Processing.getInstanceById('...
Lapin-Blanc's user avatar
  • 1,995

1
2 3 4 5
10