0

I have a couple of basic, silly questions. I have started programing on p5 just recently, and I'm very happy with it.

I'm building a very simple page that I want to have a very simple bubble animation, just like this one. https://editor.p5js.org/caminofarol/sketches/S_YwpAWdk

now, I figured that using even the p5.min library is way to much for this, so I thought I could perhaps try to find another lighter javascript library and I found two.js. here are the silly questions.

from what I understand both p5 and two.js are just libraries so even though they have their own objects, both should be able to use plain javascript syntax? so, stuff like declaring variables, using conditionals, operators or making your own functions should work with both libraries right?

so, each library loads the same basic javascript operating instructions?

anyways, at the moment I manage to load the two.js library and make a simple circle to appear in the canvas, but now when I tried to go about moving the little thing (I guess by using something call translate) I failed terribly, and I asked myself; why two libraries seem like two different worlds?

  • 2
    The short answer to your question is **yes**. JavaScript libraries are built on top of "vanilla" JavaScript, and anything that you can do in plain-old vanilla JavaScript, you can do with a JavaScript library. Unfortunately I'm afraid this question is probably going to be considered too broad for Stack Overflow though. The best advice I can give you is to try it out and see what happens, and to post a [mcve] if you get stuck. Good luck! – Kevin Workman Apr 27 '20 at 00:25
  • Thank you!. your answer helped me anyways! next time I´ll post the sketch I'm having trouble with. – especulario Apr 28 '20 at 00:23

0 Answers0