< Return to Video

8.2: What is JSON? Part I - p5.js Tutorial

  • 0:02 - 0:05
    Okay I'd like to do a little dance at the beginning of this video.
  • 0:05 - 0:10
    um in this video, I am planning to talk about JSON exclusively.
  • 0:10 - 0:12
    What is this data format JSON?
  • 0:12 - 0:14
    How is it- What does it look like? What does it mean?
  • 0:14 - 0:17
    And if you happen to have data in a JSON format
  • 0:17 - 0:20
    How do you use that data in a program that you're writing?
  • 0:20 - 0:23
    something that runs in a web browser and javascript using p5.js library.
  • 0:23 - 0:27
    Okay- so I have some information that I talked about in the previous video.
  • 0:27 - 0:29
    If you watched that previous video by the way, thank you.
  • 0:29 - 0:31
    That was kind of you.
  • 0:31 - 0:35
    Um so let's say, the scenario that I'm posing here,
  • 0:35 - 0:37
    You're interested in flowers.
  • 0:37 - 0:42
    And you looked all over the internet, you couldn't find any information about flowers.
  • 0:42 - 0:44
    But you have this book all about flowers!
  • 0:44 - 0:47
    Here's something you could actually do- novel concept
  • 0:47 - 0:52
    You could just type the data yourself into a file to use in your program.
  • 0:52 - 0:54
    So let's first think about how that might work.
  • 0:54 - 0:57
    So actually even before I start doing anything over here
  • 0:57 - 0:59
    let's do that just even in our code.
  • 0:59 - 1:04
    Right so you know- you - you know how to program, or at least I do
  • 1:04 - 1:07
    I think you do if you were watching the videos hopefully.
  • 1:07 - 1:08
    Because I don't know if I was doing a good job or not.
  • 1:09 - 1:16
    But you might say to yourself like "ah I am going to make this object called flowers"
  • 1:16 - 1:23
    And it's going to have a name.
    I'm just going to say it's a flower.
  • 1:23 - 1:26
    It's going to have a name, like sunflower.
  • 1:26 - 1:30
    And it's going to have color, which is
  • 1:30 - 1:34
    I was going to do color but then I realised there's a problem.
  • 1:34 - 1:37
    I should just admit that there's a problem here, so what I started doing by the way
  • 1:37 - 1:40
    was that I want to use the p5.js color function which is so nice
  • 1:40 - 1:43
    that I can make a nice yellow color- which yellow is red and green I think.
  • 1:44 - 1:46
    But that's not going to work up here.
  • 1:46 - 1:51
    The color function is only available once I'm actually in setup, once the page has loaded.
  • 1:51 - 1:54
    So I'm going to make that global variable,
  • 1:54 - 1:56
    and I'm going to make my object here, sorry.
  • 1:56 - 2:02
    So name- sunflower, color is- uh let's not name it color because that's a keyword.
  • 2:02 - 2:05
    Let's name it C-O-L is color.
  • 2:05 - 2:07
    How do you make yellow?
Title:
8.2: What is JSON? Part I - p5.js Tutorial
Description:

more » « less
Video Language:
English
Duration:
15:56

English subtitles

Incomplete

Revisions