Functions & Modularity

Building upon a previous assignment and inspired by modularity, I updated the sketch to reflect the following:

  • separated the code into sections by creating my own functions for “sky” and “sun”. The sky function contains the code that allows the background to change color when mapped with the mouse (i.e.) transition from daylight to sunset. The sun function contains the code for drawing the sun.
  • I created a new function, star. I wanted stars to appear in the background when mouseX reached 400. The various stars are drawn by calling the function at different coordinates in the draw function.

Here’s the sketch!

 

41 thoughts on “Functions & Modularity”

  1. I needed to draft you one little observation so as to say thank you as before for those great methods you’ve documented here. It has been certainly pretty generous of people like you to convey freely exactly what a number of people could possibly have made available as an e book to earn some cash for their own end, even more so considering the fact that you could possibly have done it if you ever decided. The ideas also acted like a fantastic way to comprehend other individuals have similar dreams like my own to grasp good deal more on the subject of this issue. I’m sure there are many more fun occasions ahead for individuals that look into your blog post.

  2. Thanks for your own labor on this web site. My mother take interest in participating in research and it is simple to grasp why. My spouse and i notice all regarding the powerful way you produce useful thoughts via your website and in addition recommend response from the others on this subject then our own princess is undoubtedly studying a whole lot. Take pleasure in the rest of the year. You have been performing a terrific job.

  3. I’m also commenting to let you be aware of of the brilliant discovery my child encountered reading through your web page. She figured out numerous issues, not to mention what it’s like to have an amazing giving mood to have most people really easily know selected impossible subject areas. You really exceeded our own expectations. Many thanks for imparting the invaluable, safe, explanatory and even easy thoughts on the topic to Janet.

  4. I enjoy you because of all of your effort on this blog. Debby enjoys conducting internet research and it’s easy to see why. A number of us hear all about the compelling manner you create efficient guides by means of the blog and boost contribution from other ones about this article and my child has been being taught a great deal. Enjoy the remaining portion of the new year. You’re carrying out a fantastic job.

  5. Hey there! I simply would like to offer you a huge thumbs up for the excellent information you

    유그
    ave got right here on this post. I am coming back to your blog for more soon.

  6. Dzięki za sugestii dotyczących naprawy kredytu na temat tego konkretnego sieci -teren. Rzeczy i chciałbym zaoferować jako rada ludziom oznacza zwykle zrezygnować z tej mentalności że w tym momencie i rozwidź później. as be a as be a} społeczeństwo {my|my wszyscy|my wszyscy|wielu z nas|większość z nas|większość ludzi} ma tendencję do {robienia tego|robienia tamtego|próbowania tego|zdarzyć się|powtórz to} dla wielu {rzeczy|problemów|czynników}. Obejmuje to {wakacje|wakacje|wypady|wyjazdy wakacyjne|wycieczki|rodzinne wakacje}, meble, {i|jak również|a także|wraz z|oprócz|plus} przedmiotów {chcemy|chcielibyśmy|życzymy|chcielibyśmy|naprawdę chcielibyśmy to mieć}. Jednak {musisz|musisz|powinieneś|powinieneś chcieć|wskazane jest, aby|musisz} oddzielić {swoje|swoje|to|twoje obecne|swoje|osoby} chcą {od wszystkich|z potrzeb|z}. {Kiedy jesteś|Kiedy jesteś|Kiedy jesteś|Jeśli jesteś|Tak długo, jak jesteś|Kiedy} pracujesz, aby {poprawić swój kredyt|poprawić swoją zdolność kredytową|zwiększyć swój kredyt|zwiększyć swój kredyt|podnieś swój ranking kredytowy|popraw swój kredyt} wynik {musisz zrobić|zrobić|faktycznie potrzebujesz|naprawdę musisz} dokonać kilku {poświęceń|kompromisów}. Na przykład {możesz|możesz|możesz|możesz|będziesz mógł|| możesz|prawdopodobnie możesz} robić zakupy online {aby zaoszczędzić pieniądze|aby zaoszczędzić pieniądze|aby zaoszczędzić} lub {możesz przejść do|może się zwrócić|może odwiedzić|może obejrzeć|może sprawdzić|może kliknąć} używane {sklepy|sklepy|detaliści|sprzedawcy|punkty sprzedaży|dostawcy} zamiast {drogie|drogie|drogie|drogie|drogie|drogich} domów towarowych {dla|w odniesieniu do|dotyczących|odnoszących się do|przeznaczonych dla|do zdobycia} odzieży {strzykawki insulinowe 1ml|strzykawki tuberkulinowe|strzykawki|strzykawka|strzykawki insulinowe|strzykawki do insuliny|strzykawki trzyczęściowe tuberkulinowe|strzykawka tuberkulinowa|strzykawka insulinowa|strzykawka do insuliny|strzykawka trzyczęściowe tuberkulinowa}.

  7. Right here is the perfect website for anyone who would like to find out about this topic. You rea
    아바타바카라

    ize a whole lot its almost hard to argue with you (not that
    I actually would want to…HaHa). You definitely put a brand new spin on a subject which has been discussed for years. Great stuff, just wonderful.

  8. Appreciate you sharing, great blog.Really thank you! Fantastic
    You made some reasonable points there. I looked on the internet
    온라인카지노

    object of the climax and found most individuals intent scrutinize along with with your website.

  9. I like what you guys are up also. Such intelligent
    work and reporting! Keep up the superb works guys I have incorporated

    안전토토

    you guys to my blogroll. I think it’ll improve the value of
    my site :).

  10. Greetings! This is my first comment here so I just wanted to give
    a quick shout out and tell you I really enjoy reading through your blog posts.
    Can you suggest any other blogs/websites/forums that go o
    토토

    ver the same topics?

    Many thanks!

  11. I am sure this paragraph has touched all the internet viewers, its really
    really pleasant paragraph on building up new website.

  12. Hello, i feel that i noticed you visited my blog thus i got here to return the favor?.I am trying to to find things to enhance my website!I assume its adequate to
    use some of your ideas!!

  13. I’m now not sure the place you are getting your info, but great topic.
    I needs to spend some time studying much more or figuring
    out more. Thanks for fantastic information I was
    looking for this info for my mission.

Leave a Reply

Your email address will not be published.