Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ron-liu-generative [2021/06/20 19:31] – created brendan.hsu | ron-liu-generative [2021/06/29 01:41] (current) – renick | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | =====Ron liu===== | + | ======Ron |
+ | by [[ron-liu|Ron]] | ||
+ | |||
+ | < | ||
+ | <iframe src=" | ||
+ | </ | ||
+ | |||
+ | ===== about my crazyDog.js ===== | ||
+ | |||
+ | My dog is not so good. I think I can do a better job, but there are some small rectangles that I think make my dog look special. Maybe my dog looks like a robot dog. | ||
+ | |||
+ | The animation code is released under the [[https:// | ||
+ | |||
+ | ===== the code for my crazyDog.js ===== | ||
+ | |||
+ | < | ||
+ | function setup() { | ||
+ | createCanvas(1800, | ||
+ | | ||
+ | } | ||
+ | |||
+ | function drawDog(){ | ||
+ | for (let i = 0; i < n ; i++){ | ||
+ | } | ||
+ | } | ||
+ | |||
+ | class BackgroundPattern { | ||
+ | constructor (size, gColor, x,y) | ||
+ | { this.backgroundSize = size; | ||
+ | this.backgroundColor = gColor; | ||
+ | | ||
+ | | ||
+ | } | ||
+ | draw () { | ||
+ | fill(color(this.backgroundColor)) | ||
+ | rect(this.x, | ||
+ | } | ||
+ | } | ||
+ | |||
+ | class dog{ | ||
+ | constructor (dsize, | ||
+ | {this.dogsize=dsize; | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | draw(){ | ||
+ | fill(color(" | ||
+ | fill(20, | ||
+ | rect(90, | ||
+ | rect(90, | ||
+ | rect(250, | ||
+ | fill(255, | ||
+ | rect(200, | ||
+ | rect(140, | ||
+ | rect(140, | ||
+ | fill(0, | ||
+ | rect(150, | ||
+ | rect(200, | ||
+ | rect(250, | ||
+ | rect(200, | ||
+ | fill(255, | ||
+ | square(115, | ||
+ | rect(90, | ||
+ | fill(81, 127, 153) | ||
+ | square(70, | ||
+ | fill(255, | ||
+ | square(110, | ||
+ | fill(0, | ||
+ | circle(130, | ||
+ | circle(90, | ||
+ | fill(255, | ||
+ | circle(130, | ||
+ | circle(90, | ||
+ | fill(151, 210, 247) | ||
+ | rect(145, | ||
+ | rect(55, | ||
+ | fill(209, 245, 188) | ||
+ | rect(140, | ||
+ | rect(255, | ||
+ | fill(0, | ||
+ | rect(55, | ||
+ | | ||
+ | fill(250, 147, 236) | ||
+ | square(270, | ||
+ | |||
+ | } | ||
+ | } | ||
+ | |||
+ | function backgroundPatternArray (number, | ||
+ | let outputArray = []; | ||
+ | for (let i = 0; i < number ; i++) { | ||
+ | outputArray.push(new BackgroundPattern (10," | ||
+ | } | ||
+ | return outputArray | ||
+ | } | ||
+ | |||
+ | | ||
+ | for(let i = 0; i < numberOfArrays ; i++){ | ||
+ | let myBackground | ||
+ | for(let i = 0; i < myBackground.length ; i++){ | ||
+ | myBackground[i].draw() | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function draw() { | ||
+ | Background2 (20, | ||
+ | let dog2 = new dog (100, " | ||
+ | dog2.draw(); | ||
+ | } | ||
+ | </ |