{"id":879,"date":"2012-12-06T19:23:24","date_gmt":"2012-12-06T19:23:24","guid":{"rendered":"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/?p=879"},"modified":"2012-12-08T02:30:39","modified_gmt":"2012-12-08T02:30:39","slug":"final-project-post-3-more-artistic","status":"publish","type":"post","link":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/12\/06\/final-project-post-3-more-artistic\/","title":{"rendered":"Final Project Post 3- more artistic"},"content":{"rendered":"<p>I&#8217;ve been told I&#8217;ll need to make my creatures more artistic. This may be tricky but I&#8217;m going to try. I don&#8217;t know how good this will look in final implementation but here are some designs I came up with.<\/p>\n<p>These are the enemy shapes based on their high level stat. The fill and stroke will still be based on secondary stats:<br \/>\n<img decoding=\"async\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-content\/uploads\/2012\/12\/2012-12-06-12.31.53.jpg\" alt=\"4 enimy shapes\" \/><\/p>\n<p>This is the monster if all parts were added. Note that the monster before anything is added will have a body, 1 head, 1 arm, 2 legs (legs just get longer), 1 tail, 1 eye,  and 1 wing (note this will be the right wing at the top, so there will be a long line sticking out of the monsters head at the beginning. I know it&#8217;s silly but it was the best way to make things fit for all combinations. The monster as a whole is silly so it&#8217;s not too out of place):<br \/>\n<img decoding=\"async\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-content\/uploads\/2012\/12\/2012-12-06-14.10.53.jpg\" alt=\"Monster with all possible additions\" \/><\/p>\n<p>I had the enemies randomly being created using the simple shapes. ALl of their stats are determined but not directly shown to the player. I have them printing to the console though and they seem to be generating correctly. The fill, stroke, and naming will not change so I might as well post this to give an idea. Press space to generate a new enemy:<\/p>\n<p><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(700,80,299,400);\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    ellipse(850,200,100,100);\r\n  }\r\n  if(monH == 1){\r\n    rect(750,200,100,100);\r\n  }\r\n  if(monH == 2){\r\n    triangle(750,250,800,200,850,250);\r\n  }\r\n  if(monH == 3){\r\n    ellipse(850,200,200,100);\r\n  }\r\n  stroke(0);\r\n}\r\n\r\nvoid keyPressed(){\r\n  if(key== ' ')\r\n    generateMonster();\r\n}\r\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been told I&#8217;ll need to make my creatures more artistic. This may be tricky but I&#8217;m going to try. I don&#8217;t know how good this will look in final implementation but here are some designs I came up with. &hellip; <a href=\"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/12\/06\/final-project-post-3-more-artistic\/\">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\/879"}],"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=879"}],"version-history":[{"count":6,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/879\/revisions"}],"predecessor-version":[{"id":885,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/879\/revisions\/885"}],"wp:attachment":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/media?parent=879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/categories?post=879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/tags?post=879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}