{"id":73553,"date":"2022-10-01T21:12:03","date_gmt":"2022-10-02T01:12:03","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=73553"},"modified":"2022-10-01T21:12:03","modified_gmt":"2022-10-02T01:12:03","slug":"project-05-pacman-wallpaper","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/10\/01\/project-05-pacman-wallpaper\/","title":{"rendered":"Project 05- Pacman Wallpaper"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><p>Initially, I wanted to make a wallpaper that resembled Pacman. I approached the assignment by using for loops to create 2 sets of grids, the first was the dots that Pacman eats, and the second is the grid for the blue squares. <\/p>\n\n\n\n<p> <\/p>\n\n\n\n<p><a class=\"p5_sketch_link\" data-width=\"450\" data-height=\"590\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/10\/sketch-32.js\">asu_sketch<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"450\" height=\"590\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/ Your name: Ashley Su\n\/\/ Your andrew ID: ashleysu\n\/\/ Your section (C):  \n\n\nfunction setup() {\n  createCanvas(450,590);\n  background('Black');\n\n}\n\nfunction dotGrid() {\n  var PADDING = 20;\n  var ROWS =19;\n  var COLUMNS =13;\n  var CELL_COLOR = 'Blue'\n\n\n  for (var col=0;col&lt;COLUMNS;col++) {\n    for (var row=0;row&lt;ROWS;row++) {\n      var left = PADDING+(col*34);\n      var top = PADDING+(row*34.3);\n      fill(random(255),random(255),random(255))\n      circle(left,top,10);\n    }\n  }\n}\n\nfunction blueBaracades() {\n\n  var PADDING = 40;\n  var ROWS = 4;\n  var COLUMNS = 3;\n  var CELL_SIZE = 140;\n  var CELL_COLOR = 'Blue'\n\n\n  fill(0);\n  stroke('Blue')\n  strokeWeight(3);\n\n\n  for (var col=0;col&lt;COLUMNS;col++) {\n    for (var row=0;row&lt;ROWS;row++) {\n      var left = PADDING+(col*CELL_SIZE);\n      var top = PADDING+(row*CELL_SIZE);\n      var size = CELL_SIZE - 50;\n      rect(left,top,size,size);\n    }\n  }\n}\n\nfunction pacmans(){\n  \n  fill('yellow');\n  noStroke();\n\n    push()\n    translate(width\/5,height\/4+7);\n    rotate(radians(310));\n    arc(0,0,35,35,radians(80),radians(35)\/2);\n    pop();\n\n    push();\n    translate(width\/3*2,height\/2);\n    rotate(radians(140));\n    arc(0,0,35,35,radians(80),radians(20)\/2);\n    pop();\n   \n    push();\n    translate(width\/3+4,height-height\/6);\n    rotate(radians(230));\n    arc(0,0,35,35,radians(80),radians(20)\/2);\n    pop();\n\n    push();\n    translate(width-width\/7,height-20);\n    rotate(radians(140));\n    arc(0,0,35,35,radians(80),radians(20)\/2);\n    pop();\n\n    push();\n    translate(width-20,height\/26);\n    rotate(radians(45));\n    arc(0,0,35,35,radians(80),radians(20)\/2);\n    pop();\n\n}\n\n\n\nfunction draw(){\n  dotGrid();\n  blueBaracades();\n  pacmans();\n  noLoop();\n}<\/code><\/pre><\/p>\n\n\n\n<p><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Initially, I wanted to make a wallpaper that resembled Pacman. I approached the assignment by using for loops to create 2 sets of grids, the first was the dots that Pacman eats, and the second is the grid for the blue squares. asu_sketch \/\/ Your name: Ashley Su \/\/ Your andrew ID: ashleysu \/\/ Your &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/10\/01\/project-05-pacman-wallpaper\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 05- Pacman Wallpaper&#8221;<\/span><\/a><\/p>\n","protected":false},"author":761,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[104,57],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73553"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/users\/761"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=73553"}],"version-history":[{"count":2,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73553\/revisions"}],"predecessor-version":[{"id":73556,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73553\/revisions\/73556"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=73553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=73553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=73553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}