Skip to content
Advertisement

Tag: processing

mousePressed() applied when hovering instead of clicking

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

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

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

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

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

Advertisement