I’m trying to make a song player with three buttons (go to prev song, stop song, go to next song). I want to stop the audio playing when the stop button button is clicked using mousePressed(). The problem is, it is applied whenever my mouse is hovering on the area of the button I defined in the mousePressed() function. Why
Tag: processing
How to find point on the circumference of a circle from an angle
position holds the center of a circle with a diameter variable. enemy.position is the top left corner of a square which is an enemy, size is the width and height of the enemy. I am using pVector and line() from the processing.core.pApplet library in java. What I’m trying to do is draw a line from the circle to an enemy.
How to roll up a 2D Grid in P3D with Processing
I have built a two-dimensional grid of rectangles with a nested loop. Now I want to “roll up” this grid in three-dimensional space, or in other words “form a cylinder” or a “column”. With the movement of my mouse pointer. Up to the “roll up” I get everything programmed as desired – but then my mathematics fails. Instead of a
Issues exporting Processing sketch to PDF: sketch gets cropped
I am trying to export my sketch to pdf. The issue that I have is that for some reason only a portion of my sketch is exported to pdf, as if the original sketch was cropped! When I run my sketch, 64 lines show up (as intended) and indeed when I save it to png all the 64 lines are
Space Invader project
Hi I have been working on a space invader game in processing, I am relatively new to java/coding. What my problem is that I do not really understand how to make the collision actually work, and also my aliens (which are the space ships), they move left to right but do not move down. These are the 2 major problems
Processing – Resize canvas based on jpg dimensions
I have a basic program where stock images form the background for a larger program – but a number of the images have slightly different sizes compared to each other. My initial code loads up the background image and tries to set the canvas size based on the image dimensions: I get ‘IllegalStateException’ error bg.width and bg.height are 806 and
Processing Randomized Building Drawing Window Issue
I’m reposting this as the code was not correct the first time I posted this. I got it all down up to this part. It looks like this. but it should look like this. Any Help with making it so the windows align to the buildings would be great as I am quite new to this. Thanks Answer You had
Random stroke weight is always bigger in draw() – Processing
I’m trying to paint a triangle with a random stroke weight.The problem is that the stroke weight only changes if the new value is bigger than the older value. Here’s what I’ve tried. I don’t know if I am supposed to redraw or refresh the display at the bottom of the draw void. Answer The image isn’t magically disappearing at
Processing: How do you give a shape a value based on the mouse button clicked?
I’m trying to make a program on Processing that draws either a Rectangle or an Ellipse based on the button thats clicked (Left or Right button) and I’m struggling with how to save the value in the variable currentShape in the class mousePressed. I’m supposed to get a value when the mouse is pressed and save it into currentShape and
Java/Processing: A* graph node based game
I am trying to build a little ‘simulation’ game. This game has no real purpose, I am just making small little projects while I try and learn the in’s and out’s of some beginner programming. This is my goal: On the processing canvas, there are multiple ‘Nodes’ that represent where a player can move to. The user will input where