Skip to content

Commit

Permalink
Merge 0.4.16 into p5 upgrade branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Monsoonjr99 committed Mar 4, 2024
2 parents fe35993 + cc89f05 commit 4f7a43a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
About: A p5.js tropical cyclone simulation game

v0.4.16 (2024-03-02):
* Another small tweak to make the track forecast cone a little less janky
v0.4.15 (2024-02-29):
* Another tweak to the appearance of the track forecast cone
v0.4.14 (2024-01-01):
Expand Down
2 changes: 1 addition & 1 deletion constants.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const TITLE = "Cyclone Simulator";
const VERSION_NUMBER = "0.4.15";
const VERSION_NUMBER = "0.4.16";

const SAVE_FORMAT = 7; // Format #7 in use starting in v0.4
const EARLIEST_COMPATIBLE_FORMAT = 0;
Expand Down
2 changes: 1 addition & 1 deletion sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function setup(){
// forecastTracks.stroke(240,240,0);
// forecastTracks.noFill();
forecastTracks.noStroke();
forecastTracks.fill(255, 100);
forecastTracks.fill(255);
landBuffer = createImage(fullW,fullH);
landBuffer.loadPixels();
// landBuffer.noStroke();
Expand Down
25 changes: 15 additions & 10 deletions storm.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class Storm{
r1 = hour * 0.7 / 2;
p0 = p1;
p1 = points[n];
// forecastTracks.circle(p1.x, p1.y, r1 * 2);
forecastTracks.circle(p1.x, p1.y, r1 * 2);
forecastTracks.beginShape();
rVec.set(p1.x, p1.y);
rVec.sub(p0.x, p0.y);
Expand All @@ -331,16 +331,9 @@ class Storm{
rVec.rotate(PI);
forecastTracks.vertex(p1.x + rVec.x, p1.y + rVec.y);
forecastTracks.endShape();
// forecastTracks.erase(128, 0);
// forecastTracks.rect(0, 0, WIDTH, HEIGHT);
// forecastTracks.noErase();


// forecastTracks.loadPixels();
// for(let i = 0; i < forecastTracks.pixels.length; i += 4){
// if(forecastTracks.pixels[i + 3] > 0)
// forecastTracks.pixels[i + 3] = 100;
// }
// forecastTracks.updatePixels();

};
coneSegment(12);
coneSegment(24);
Expand All @@ -350,6 +343,18 @@ class Storm{
coneSegment(72);
coneSegment(96);
coneSegment(120);

forecastTracks.loadPixels();
for(let i = 0; i < forecastTracks.pixels.length; i += 4){
if(forecastTracks.pixels[i + 3] > 0)
forecastTracks.pixels[i + 3] = 128;
}
forecastTracks.updatePixels();

// Use this instead after upgrading to p5.js 1.9.1
// forecastTracks.erase(128, 0);
// forecastTracks.rect(0, 0, WIDTH, HEIGHT);
// forecastTracks.noErase();
}
}
}
Expand Down

0 comments on commit 4f7a43a

Please sign in to comment.