{"id":889,"date":"2012-12-06T21:40:13","date_gmt":"2012-12-06T21:40:13","guid":{"rendered":"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/?p=889"},"modified":"2012-12-08T02:30:02","modified_gmt":"2012-12-08T02:30:02","slug":"final-project-post-4-enemies-coming-along","status":"publish","type":"post","link":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/12\/06\/final-project-post-4-enemies-coming-along\/","title":{"rendered":"Final Project post 4- enemies coming along"},"content":{"rendered":"<p>I finished actually making one of the enimies in processing. I took a screenshot of it in a sample color scheme. I will post screen shots of each of the enemy types to this page as I finish them. When all 4 are done I will post the script so you can see all color variations.<\/p>\n<p>Speed-demon: <img decoding=\"async\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-content\/uploads\/2012\/12\/Screen-shot-2012-12-06-at-4.33.21-PM.png\" alt=\"This is a magical blocking speed-demon\" \/><\/p>\n<p>Warrior: <img decoding=\"async\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-content\/uploads\/2012\/12\/Screen-shot-2012-12-06-at-6.11.12-PM.png\" alt=\"This is a quick casting warrior\" \/><\/p>\n<p>Defender: <img decoding=\"async\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-content\/uploads\/2012\/12\/Screen-shot-2012-12-06-at-7.14.53-PM.png\" alt=\"This is an aggressive casting defender\" \/><\/p>\n<p>Wizard: <img decoding=\"async\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-content\/uploads\/2012\/12\/Screen-shot-2012-12-06-at-7.45.09-PM.png\" alt=\"This is a quick striking wizard\" \/><\/p>\n<p>Here is the current script, press space bar to cycle through enemies!<br \/>\n<script type=\"application\/processing\">\r\n\/\/stats and stat display strings\r\nint attack = 10;\r\nString attackS = \"\" + attack;\r\nint magRes = 10;\r\nString magResS = \"\" + magRes;\r\nint evade = 10;\r\nString evadeS = \"\" + evade;\r\nint defense = 10;\r\nString defenseS = \"\" + defense;\r\nint speed = 10;\r\nString speedS = \"\" + speed;\r\nint monSpeed = 5;\r\nint monAttack = 5;\r\nint monDefense = 5;\r\nint monMagic = 5;\r\n\/\/the monster's high and 2 medium stats\r\nint monH = 5;\r\nint monM1 = 5;\r\nint monM2 = 5;\r\n\r\n\r\n\/\/counts of added limbs\r\nint heads = 0;\r\nint arms = 0;\r\nint tails = 0;\r\nint eyes = 0;\r\nint wings = 0;\r\nint legs = 0;\r\n\r\n\/\/roll and display string for the roll\r\nint roll = 0;\r\nString rollS = \"\" + roll;\r\n\r\n\/\/health and display string\r\nint health = 1000;\r\nString healthS = \"\" + health;\r\nint monHealth = 20;\r\nString monHealthS = \"\" + monHealth;\r\n\r\n\/\/the stage we are at\r\nint stage = 0;\r\n\r\nvoid setup(){\r\n  size(1000,800);\r\n  background(238,207,161);\r\n  generateMonster();\r\n  \r\n}\r\n\r\nvoid draw(){\r\n  \/\/set up stat display\r\n  fill(156,102,31);\r\n  rect(0,600,999,200);\r\n  PFont f = createFont(\"Arial\",50,true);\r\n  textFont(f,20);\r\n   fill(50,20,0);\r\n   text(\"Monster Stats:\",10,630);\r\n   fill(255,0,0);\r\n   text(\"Attack:\",25, 680);\r\n   fill(50,20,0);\r\n   text(attackS,100,680);\r\n   fill(100,0,255);\r\n   text(\"Magic Resistance:\",255, 680);\r\n   fill(50,20,0);\r\n   text(magResS,430,680);\r\n   fill(0,0,255);\r\n   text(\"Evade:\",570, 680);\r\n   fill(50,20,0);\r\n   text(evadeS,650,680);\r\n   fill(255,255,0);\r\n   text(\"Defense:\",180, 750);\r\n   fill(50,20,0);\r\n   text(defenseS,270,750);\r\n   fill(0,255,0);\r\n   text(\"Speed:\",480, 750);\r\n   fill(50,20,0);\r\n   text(speedS,550,750);\r\n   \r\n   \/\/set up dice roll display box\r\n   fill(156,102,31);\r\n   rect(700,600,299,200);\r\n   fill(50,20,0);\r\n   textFont(f,35);\r\n   text(\"Your last die roll:\",720,650);\r\n   textFont(f,150);\r\n   text(rollS, 800, 780);\r\n   \r\n   \/\/ Handle left portion of top display (monster and health\r\n   textFont(f,25);\r\n   text(\"Monster\",90,30);\r\n   text(\"Health: \", 60,550);\r\n   text(healthS, 180,550);\r\n   strokeWeight(3);\r\n   line(85,46,190,46);\r\n   strokeWeight(1);\r\n   \r\n   \/\/The box that displays attack and attack damage that occurs\r\n   text(\"Damage\",420,170);\r\n   fill(238,207,161);\r\n   strokeWeight(3);\r\n   rect(370,210,200,230);\r\n   fill(50,20,0);\r\n   strokeWeight(1);\r\n   \r\n   \/\/ Handle right portion of top display (monster and health\r\n   textFont(f,25);\r\n   text(\"Enemy\",740,30);\r\n   text(\"Health: \", 710,550);\r\n   text(monHealthS, 830,550);\r\n   strokeWeight(3);\r\n   line(725,46,840,46);\r\n   strokeWeight(1);\r\n   drawMonster();\r\n}\r\n\r\nvoid generateMonster(){\r\n  \/\/0 = speed, 1 = attack, 2 = defense, 3 = magic\r\n  ArrayList stats = new ArrayList();\r\n  stats.add(0);\r\n  stats.add(1);\r\n  stats.add(2);\r\n  stats.add(3);\r\n  int rand = int(random(stats.size()));\r\n  int highStat = (Integer)stats.get(rand);\r\n  stats.remove(rand);\r\n  rand = int(random(stats.size()));\r\n  int medStat1 =(Integer) stats.get(rand);\r\n  stats.remove(rand);\r\n  rand = int(random(stats.size()));\r\n  int medStat2 = (Integer) stats.get(rand);\r\n  stats.remove(rand);\r\n  int lowStat = (Integer) stats.get(0);\r\n  int speedStat = 0;\r\n  int attStat = 0;\r\n  int defStat = 0;\r\n  int magStat = 0;\r\n  int getHStat = int(random(8,12));\r\n  if(highStat == 0) speedStat = getHStat;\r\n  if(highStat == 1) attStat = getHStat;\r\n  if(highStat == 2) defStat = getHStat;\r\n  if(highStat == 3) magStat = getHStat;\r\n  int getM1Stat = int(random(4,9));\r\n  if(medStat1 == 0) speedStat = getM1Stat;\r\n  if(medStat1 == 1) attStat = getM1Stat;\r\n  if(medStat1 == 2) defStat = getM1Stat;\r\n  if(medStat1 == 3) magStat = getM1Stat;\r\n  int getM2Stat = int(random(4,9));\r\n  if(medStat2 == 0) speedStat = getM2Stat;\r\n  if(medStat2 == 1) attStat = getM2Stat;\r\n  if(medStat2 == 2) defStat = getM2Stat;\r\n  if(medStat2 == 3) magStat = getM2Stat;\r\n  int getLStat = int(random(1,4));\r\n  if(lowStat == 0) speedStat = getLStat;\r\n  if(lowStat == 1) attStat = getLStat;\r\n  if(lowStat == 2) defStat = getLStat;\r\n  if(lowStat == 3) magStat = getLStat;\r\n  monSpeed = speedStat + stage;\r\n  monAttack = attStat + stage;\r\n  monDefense = defStat + stage;\r\n  monMagic = magStat + stage;\r\n  monH = highStat;\r\n  if(getM1Stat > getM2Stat){\r\n    monM1 = medStat1;\r\n    monM2 = medStat2;\r\n  }\r\n  else if(getM2Stat > getM1Stat){\r\n    monM1 =medStat2;\r\n    monM2 = medStat1;\r\n  }\r\n  else{\r\n    if(int(random(2)) == 1){\r\n      monM1 = medStat1;\r\n      monM2 = medStat2;\r\n    }\r\n    else{\r\n      monM1 =medStat2;\r\n      monM2 = medStat1;\r\n    }\r\n  }\r\n  print(\"sp \" + monSpeed + \"\\n\");\r\n  print(\"at \" + monAttack + \"\\n\");\r\n  print(\"de \" + monDefense + \"\\n\");\r\n  print(\"ma \" + monMagic + \"\\n\");\r\n  print(\"h \" + monH+\"\\n\");\r\n  print(\"M1 \" + monM1+\"\\n\");\r\n  print(\"M2 \" + monM2 +\"\\n\");\r\n}\r\n\r\nvoid drawMonster(){\r\n  fill(238,207,161);\r\n  noStroke();\r\n  rect(690,80,310,410);\r\n  PFont f = createFont(\"Arial\",50,true);\r\n  textFont(f,20);\r\n  fill(50,20,0);\r\n   \/\/0 = speed, 1 = attack, 2 = defense, 3 = magic\r\n   String monster = \"\";\r\n   color fillC = color(0,0,0);\r\n  if(monM2 == 0){\r\n    monster += \"quick\";\r\n    stroke(0,255,0);\r\n  }\r\n  if(monM2 == 1){\r\n    monster += \"aggressive\";\r\n    stroke(255,0,0);\r\n  }\r\n  if(monM2 == 2){\r\n    monster += \"hardy\";\r\n    stroke(255,255,0);\r\n  }\r\n  if(monM2 == 3){\r\n    monster += \"magical\";\r\n    stroke(150,0,255);\r\n  }\r\n  if(monM1 == 0){\r\n    monster += \" running\";\r\n    fillC = color(0,255,0);\r\n  }\r\n  if(monM1 == 1){\r\n    monster += \" striking\";\r\n    fillC = color(255,0,0);\r\n  }\r\n  if(monM1 == 2){\r\n    monster += \" blocking\";\r\n    fillC = color(255,255,0);\r\n  }\r\n  if(monM1 == 3){\r\n    monster += \" casting\";\r\n    fillC = color(150,0,255);\r\n  }\r\n  \/\/we cannot set the fill until later so this will need to be checked again\r\n  \/\/for the actual drawing\r\n  if(monH == 0){\r\n    monster += \" speed-demon\";\r\n  }\r\n  if(monH == 1){\r\n    monster += \" warrior\";\r\n  }\r\n  if(monH == 2){\r\n    monster += \" defender\";\r\n  }\r\n  if(monH == 3){\r\n    monster += \" wizard\";\r\n  }\r\n  text(monster, 700,100);\r\n  strokeWeight(4);\r\n  fill(fillC);\r\n  if(monH == 0){\r\n    drawSpeedDemon();\r\n  }\r\n  if(monH == 1){\r\n    drawWarrior();\r\n  }\r\n  if(monH == 2){\r\n    drawDefender();\r\n  }\r\n  if(monH == 3){\r\n    drawWizard();\r\n  }\r\n  stroke(0);\r\n}\r\n\r\nvoid keyPressed(){\r\n  if(key== ' ')\r\n    generateMonster();\r\n}\r\n\r\nvoid drawSpeedDemon(){\r\n  beginShape();\r\n  vertex(780,270);\r\n  vertex(800,220);\r\n  vertex(820,270);\r\n  endShape(CLOSE);\r\n  beginShape();\r\n  vertex(805,270);\r\n  vertex(830,230);\r\n  vertex(845,270);\r\n  endShape(CLOSE);\r\n  beginShape();\r\n  vertex(820,255);\r\n  vertex(870,260);\r\n  vertex(840,300);\r\n  endShape(CLOSE);\r\n  beginShape();\r\n  vertex(850,320);\r\n  vertex(870,340);\r\n  vertex(810,345);\r\n  endShape(CLOSE);\r\n  beginShape();\r\n  vertex(830,340);\r\n  vertex(850,365);\r\n  vertex(810,350);\r\n  endShape(CLOSE);\r\n  line(840,300,880,320);\r\n  line(880,320,910,290);\r\n  line(910,290,920,300);\r\n  line(920,300,940,270);\r\n  ellipse(948,262,20,20);\r\n  ellipse(810,300,100,100);\r\n  fill(0);\r\n  ellipse(780,290,16,16);\r\n  ellipse(820,290,16,16);\r\n  line(790,320,800,315);\r\n  line(800,315,810,320);\r\n}\r\n\r\n\r\nvoid drawWarrior(){\r\n  beginShape();\r\n  vertex(770,270);\r\n  vertex(760,230);\r\n  vertex(820,260);\r\n  endShape(CLOSE);\r\n  beginShape();\r\n  vertex(840,270);\r\n  vertex(890,260);\r\n  vertex(860,300);\r\n  endShape(CLOSE);\r\n  beginShape();\r\n  vertex(850,270);\r\n  vertex(870,270);\r\n  vertex(840,320);\r\n  endShape(CLOSE);\r\n  beginShape();\r\n  vertex(775,270);\r\n  vertex(773,245);\r\n  vertex(800,260);\r\n  endShape(CLOSE);\r\n  beginShape();\r\n  vertex(770,330);\r\n  vertex(790,370);\r\n  vertex(810,330);\r\n  endShape(CLOSE);\r\n  beginShape();\r\n  vertex(810,330);\r\n  vertex(830,370);\r\n  vertex(850,330);\r\n  endShape(CLOSE);\r\n  beginShape();\r\n  vertex(850,320);\r\n  vertex(940,270);\r\n  vertex(960,290);\r\n  vertex(950,290);\r\n  vertex(940,280);\r\n  vertex(860,320);\r\n  endShape(CLOSE);\r\n  ellipse(810,300,100,100);\r\n  beginShape();\r\n  vertex(740,280);\r\n  vertex(780,280);\r\n  vertex(770,300);\r\n  vertex(760,290);\r\n  vertex(750,300);\r\n  endShape(CLOSE);\r\n  beginShape();\r\n  vertex(840,300);\r\n  vertex(880,300);\r\n  vertex(870,320);\r\n  vertex(860,310);\r\n  vertex(850,320);\r\n  endShape(CLOSE);\r\n  line(785,295,790,300);\r\n  line(790,300,795,295);\r\n  line(795,295,800,300);\r\n  line(800,300,805,295);\r\n  line(805,295,810,300);\r\n  line(810,300,815,295);\r\n  line(815,295,820,300);\r\n  line(820,300,825,295);\r\n  fill(0);\r\n  beginShape();\r\n  vertex(790,275);\r\n  vertex(795,265);\r\n  vertex(800,275);\r\n  endShape(CLOSE);\r\n  beginShape();\r\n  vertex(830,285);\r\n  vertex(835,275);\r\n  vertex(840,285);\r\n  endShape(CLOSE);\r\n}\r\n\r\nvoid drawDefender(){\r\n  beginShape();\r\n  vertex(740,235);\r\n  vertex(765,175);\r\n  vertex(790,235);\r\n  endShape(CLOSE);\r\n  ellipse(765,265,100,100);\r\n  beginShape();\r\n  vertex(800,315);\r\n  vertex(830,285);\r\n  vertex(830,315);\r\n  endShape(CLOSE);\r\n  ellipse(810,325,50,50);\r\n  beginShape();\r\n  vertex(840,325);\r\n  vertex(870,290);\r\n  vertex(880,325);\r\n  endShape(CLOSE);\r\n  ellipse(860,330,50,50);\r\n  beginShape();\r\n  vertex(900,330);\r\n  vertex(935,320);\r\n  vertex(930,350);\r\n  endShape(CLOSE);\r\n  ellipse(905,350,50,50);\r\n  beginShape();\r\n  vertex(915,389);\r\n  vertex(930,410);\r\n  vertex(885,413);\r\n  endShape(CLOSE);\r\n  ellipse(895,395,40,40);\r\n  beginShape();\r\n  vertex(872,410);\r\n  vertex(845,415);\r\n  vertex(872,425);\r\n  endShape(CLOSE);\r\n  ellipse(872,415,20,20);\r\n  fill(0);\r\n  ellipse(738,245,20,20);\r\n  ellipse(788,245,20,20);\r\n  line(750,275,770,275);\r\n  line(770,275,774,270);\r\n}\r\n\r\nvoid drawWizard(){\r\n  beginShape();\r\n  vertex(810,280);\r\n  vertex(730,260);\r\n  vertex(700,280);\r\n  vertex(700,300);\r\n  vertex(730,320);\r\n  vertex(810,310);\r\n  endShape(CLOSE);\r\n  line(700,280,810,295);\r\n  line(700,300,810,295);\r\n  beginShape();\r\n  vertex(810,280);\r\n  vertex(890,260);\r\n  vertex(920,280);\r\n  vertex(920,300);\r\n  vertex(890,320);\r\n  vertex(810,310);\r\n  endShape(CLOSE);\r\n  line(920,280,810,295);\r\n  line(920,300,810,295);\r\n  ellipse(750,300,20,10);\r\n  ellipse(870,300,20,10);\r\n  ellipse(811,205,20,20);\r\n  beginShape();\r\n  vertex(770,290);\r\n  vertex(810,210);\r\n  vertex(850,290);\r\n  endShape(CLOSE);\r\n  ellipse(810,300,100,100);\r\n  ellipse(780,350,20,10);\r\n  ellipse(840,350,20,10);\r\n  fill(0);\r\n  ellipse(795,280,20,20);\r\n  ellipse(825,280,20,20);\r\n  line(800,300,810,300);\r\n  line(810,300,815,295);\r\n}\r\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I finished actually making one of the enimies in processing. I took a screenshot of it in a sample color scheme. I will post screen shots of each of the enemy types to this page as I finish them. When &hellip; <a href=\"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/12\/06\/final-project-post-4-enemies-coming-along\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/889"}],"collection":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/comments?post=889"}],"version-history":[{"count":9,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/889\/revisions"}],"predecessor-version":[{"id":896,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/889\/revisions\/896"}],"wp:attachment":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/media?parent=889"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/categories?post=889"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/tags?post=889"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}