Relative Content

Tag Archive for javascriptp5.js

I can’t make collisions work in p5js with circles

I have followed the instructions of a “TheCodingTrain” tutorial, it describes how to calculate the distance between two circles to emulate collisions. I have a lot more, but this is the code I have pertaining to my problem.

How to use bezierVertex with UV coordinates in p5js?

I’m working on a project which I need to map the UV coordinates to the custom shape. I checked the reference where vertex can hold u and v parameters, but bezierVertex does not have it in documentation. However, I checked this GitHub issue where they mentioned bezierVertex can hold

Flashing and flickering in p5js

I have the following code for a p5js project where I draw 10 eccentric squares and set the blend mode to DIFFERENCE. But the screen starts aggressively flashing and flickering.

Why the collisions in this p5library game don’t ajust to the sprite?

I’m starting to use this library and I’m not quite sure how things work. I got the base from a YouTube video and then tried adding things myself. The problem is that the frog sprite sinks into the platforms, so I suppose the problem is that either the frog image is too big for the sprite or it’s wrong. It could also be that the collisions with the platforms are off or lower than normal, making it look like the frog is sinking instead of staying on top of the platform.

How do I update the numbers in this clock in p5js?

I’m attempting to make a clock using p5js with 3 continuously rotating rings which have the current hour/minute/second at the top of each ring. At the moment I’m just trying to figure out the seconds ring, assuming I can work out the details for the other two rings from there. I’m able to initially draw all the numbers along the ring, and I can get the ring to rotate at the right pace, but the numbers don’t update correctly. I think I just need to update the number at the bottom, but I’m not sure how to handle it since the text function doesn’t return any sort of manipulatable object. Any help would be greatly appreciated, as my head can’t take much more beating on the desk.