Skip to content

Commit 50addcd

Browse files
committed
Improve spacing on side by side code snippets
1 parent db590bb commit 50addcd

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,14 @@ To play around, check out [the example from the p5.js 1.x `preload()` reference]
5858
```js
5959
let img;
6060

61-
// Load an image and create a p5.Image object.
6261
function preload() {
63-
img = loadImage('/assets/bricks.jpg');
62+
img = loadImage('bricks.jpg');
6463
}
6564

6665
function setup() {
6766
createCanvas(100, 100);
68-
69-
// Make a red background - will not actually see this in 1.x
67+
68+
// Red backgorund is ignored
7069
background(255, 0, 0);
7170

7271
// Draw the image.
@@ -84,10 +83,11 @@ let img;
8483
async function setup() {
8584
createCanvas(100, 100);
8685

87-
// Make a red background - in 2.0 will be shown while the image loads
86+
// Red background while asset loads
8887
background(255, 0, 0);
8988

90-
img = await loadImage('/assets/bricks.jpg');
89+
// Wait for the image to load
90+
img = await loadImage('bricks.jpg');
9191

9292
// Draw the image.
9393
image(img, 0, 0);
@@ -184,7 +184,7 @@ function draw() {
184184
bezierVertex(50, 0, 0, 50, 0, 100);
185185

186186
// Bottom-left curve.
187-
bezierVertex(  0, 50, -50, 0, -100, 0);
187+
bezierVertex(0, 50, -50, 0, -100, 0);
188188

189189
// Top-left curve.
190190
bezierVertex(-50, 0, 0,-50, 0,-100);
@@ -205,9 +205,6 @@ function draw() {
205205

206206
// Draw the curved star shape.
207207
beginShape();
208-
209-
// Because the order is three, the curves should be
210-
// defined in sets of three after the original anchor
211208
bezierOrder(3);
212209

213210
// Original anchor at top.

0 commit comments

Comments
 (0)