-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
p5.js version
2.0.5
Web browser and version
142.0.7444.163 (Official Build) (64-bit) (cohort: Stable)
Operating system
Windows 10
Steps to reproduce this
Steps:
- At any moment, set the frameCount to any value.
- The frameCount will stop updating and the console will log "You just changed the value of "frameCount", which was a p5 global value. This could cause problems later if you're not careful."
Snippet:
function setup() {
createCanvas(400, 400);
}
function draw() {
background(0);
circle(frameCount % width, height * 0.5, 50);
// frameCount stops updating at frame 30, after it gets changed
if (frameCount > 30) frameCount = 0;
// the draw() continues looping
print("I'm running!");
}I couldn’t find any information on whether this is an intentional change or a bug.
In any case, this behavior limits the possibilities of the frameCount variable. In p5.js 1.x it could be freely manipulated, allowing for looping or resetting animations and other time manipulations.