How to use blue method in green

Best Python code snippet using green

sketch.js

Source:sketch.js Github

copy

Full Screen

1const Engine = Matter.Engine;2const World = Matter.World;3const Bodies = Matter.Bodies;4const Body = Matter.Body;5var billfrontImage,billbackImage,billleftImage,billrightImage;6var default_bill;7var bill;8var bgimage;9var edges;10var watchtower,watchtowerImage;11var life = 100;12var wave = 0;13var coin, coinvalue = 200;14var coinimage;15var PLAY = 1;16var GAMEOVER = 2;17var WIN = 3;18var gameState = PLAY;19var ybullet1,ybullet2,ybullet3,ybullet4;20var bbullet1,bbullet2,bbullet3,bbullet4;21var destroyedRobos = 0;22var bgsound;23function preload()24{25 bgimage = loadImage("images/bg.jpg");26 default_bill = loadAnimation("images/defaultbill.png");27 watchtowerImage= loadImage("images/watchtower.png");28 billback_Image = loadAnimation("images/1.png","images/2.png","images/3.png","images/4.png","images/5.png","images/6.png","images/7.png","images/8.png","images/9.png");29 billleft_Image = loadAnimation("images/10.png","images/11.png","images/12.png","images/13.png","images/14.png","images/15.png","images/16.png","images/17.png","images/18.png");30 billfront_Image = loadAnimation("images/19.png","images/20.png","images/21.png","images/22.png","images/23.png","images/24.png","images/25.png","images/26.png","images/27.png");31 billright_Image = loadAnimation("images/28.png","images/29.png","images/30.png","images/31.png","images/32.png","images/33.png","images/34.png","images/35.png","images/36.png");32 coinimage = loadImage("images/coin.png");33 redroboimage = loadImage("images/redrobo.jpg");34 blueroboimage = loadImage("images/bluerobo.jpg");35 yellowroboimage = loadImage("images/yellowrobo.jpg");36 quadraShotimage = loadImage("images/quadrashot.png");37 ybullet = loadImage("images/yellowbullet.png");38 allShotimage = loadImage("images/allshot.png");39 bbullet = loadImage("images/bluebullet.png");40 restartImage = loadImage("images/restart.png");41 bgsound = loadSound("bgMusic.mp3");42}43function setup() {44 createCanvas(900,500); 45 bgsound.loop();46 edges = createEdgeSprites();47 treecollider1 = createSprite(10,310,80,620);48 treecollider1.visible = false;49 treecollider2 = createSprite(845,310,25,620);50 treecollider2.visible = false;51 firstcollider = createSprite(200,350,15,15);52 firstcollider.visible = false;53 secondcollider = createSprite(180,480,15,15);54 secondcollider.visible = false;55 thirdcollider = createSprite(340,464,15,15);56 thirdcollider.visible = false;57 fourthcollider = createSprite(320,215,15,15);58 fourthcollider.visible = false;59 fifthcollider = createSprite(195,240,15,15);60 fifthcollider.visible = false;61 sixthcollider = createSprite(195,40.5,15,15);62 sixthcollider.visible = false;63 seventhcollider = createSprite(720,75,15,15);64 seventhcollider.visible = false;65 eighthcollider = createSprite(690,285,15,20);66 eighthcollider.visible = false;67 ninethcollider = createSprite(790,245,15,15);68 ninethcollider.visible = false;69 tenthcollider = createSprite(770,390,15,15);70 tenthcollider.visible = false;71 eleventhcollider = createSprite(525,375,15,15);72 eleventhcollider.visible = false;73 watchtower = createSprite(545,465,20,20);74 watchtower.addImage(watchtowerImage);75 watchtower.scale = 0.425;76 watchtower.setCollider("rectangle",watchtower.length, watchtower.heigth)77 78 bill = createSprite(300,180);79 bill.scale = 1.25;80 81 bill.addAnimation("default",default_bill);82 bill.addAnimation("default1",billback_Image);83 bill.addAnimation("default2",billleft_Image);84 bill.addAnimation("default3",billfront_Image);85 bill.addAnimation("default4",billright_Image);86 redRobo1 = createSprite(130,350,25,25,3);87 redRobo1.addImage(redroboimage);88 redRobo1.velocityX = 2.5;89 redRobo1.scale = 0.90;90 redRobo2 = createSprite(80,350,25,25,3);91 redRobo2.addImage(redroboimage);92 redRobo2.velocityX = 2.7;93 redRobo2.scale = 0.90;94 redRobo3 = createSprite(30,350,25,25,3);95 redRobo3.addImage(redroboimage);96 redRobo3.velocityX = 2.5;97 redRobo3.scale = 0.90;98 redRobo4 = createSprite(-30,350,25,25,3);99 redRobo4.addImage(redroboimage);100 redRobo4.velocityX = 2.5;101 redRobo4.scale = 0.90;102 redRobo5 = createSprite(-80,350,25,25,3);103 redRobo5.addImage(redroboimage);104 redRobo5.velocityX = 2.5;105 redRobo5.scale = 0.90;106 blueRobo1 = createSprite(-2500,350,25,25,3);107 blueRobo1.addImage(blueroboimage);108 blueRobo1.velocityX = 3.5;109 blueRobo1.scale = 0.90;110 blueRobo2 = createSprite(-2550,350,25,25,3);111 blueRobo2.addImage(blueroboimage);112 blueRobo2.velocityX = 3.5;113 blueRobo2.scale = 0.90;114 blueRobo3 = createSprite(-2600,350,25,25,3);115 blueRobo3.addImage(blueroboimage);116 blueRobo3.velocityX = 3.5;117 blueRobo3.scale = 0.90;118 blueRobo4 = createSprite(-2650,350,25,25,3);119 blueRobo4.addImage(blueroboimage);120 blueRobo4.velocityX = 3.5;121 blueRobo4.scale = 0.90;122 blueRobo5 = createSprite(-2700,350,25,25,3);123 blueRobo5.addImage(blueroboimage);124 blueRobo5.velocityX = 3.5;125 blueRobo5.scale = 0.90;126 blueRobo6 = createSprite(-2750,350,25,25,3);127 blueRobo6.addImage(blueroboimage);128 blueRobo6.velocityX = 3.5;129 blueRobo6.scale = 0.90;130 blueRobo7 = createSprite(-2800,350,25,25,3);131 blueRobo7.addImage(blueroboimage);132 blueRobo7.velocityX = 3.5;133 blueRobo7.scale = 0.90;134 yellowRobo1 = createSprite(-5500,350,25,25,3);135 yellowRobo1.addImage(yellowroboimage);136 yellowRobo1.velocityX = 5;137 yellowRobo1.scale = 0.90;138 yellowRobo2 = createSprite(-5550,350,25,25,3);139 yellowRobo2.addImage(yellowroboimage);140 yellowRobo2.velocityX = 5;141 yellowRobo2.scale = 0.90;142 yellowRobo3= createSprite(-5600,350,25,25,3);143 yellowRobo3.addImage(yellowroboimage);144 yellowRobo3.velocityX = 5;145 yellowRobo3.scale = 0.90;146 yellowRobo4= createSprite(-5650,350,25,25,3);147 yellowRobo4.addImage(yellowroboimage);148 yellowRobo4.velocityX = 5;149 yellowRobo4.scale = 0.90;150 yellowRobo5 = createSprite(-5700,350,25,25,3);151 yellowRobo5.addImage(yellowroboimage);152 yellowRobo5.velocityX = 5;153 yellowRobo5.scale = 0.90;154 yellowRobo6 = createSprite(-5750,350,25,25,3);155 yellowRobo6.addImage(yellowroboimage);156 yellowRobo6.velocityX = 5;157 yellowRobo6.scale = 0.90;158 yellowRobo7 = createSprite(-5800,350,25,25,3);159 yellowRobo7.addImage(yellowroboimage);160 yellowRobo7.velocityX = 5;161 yellowRobo7.scale = 0.90;162 yellowRobo8 = createSprite(-5850,350,25,25,3);163 yellowRobo8.addImage(yellowroboimage);164 yellowRobo8.velocityX = 5;165 yellowRobo8.scale = 0.90;166 yellowRobo9 = createSprite(-5900,350,25,25,3);167 yellowRobo9.addImage(yellowroboimage);168 yellowRobo9.velocityX = 5;169 yellowRobo9.scale = 0.90;170 yellowRobo10 = createSprite(-5950,350,25,25,3);171 yellowRobo10.addImage(yellowroboimage);172 yellowRobo10.velocityX = 5;173 yellowRobo10.scale = 0.90;174 yellowRobo11 = createSprite(-6000,350,25,25,3);175 yellowRobo11.addImage(yellowroboimage);176 yellowRobo11.velocityX = 5;177 yellowRobo11.scale = 0.90;178 quadraShot1 = createSprite(450,150,30,10);179 quadraShot1.addImage(quadraShotimage);180 allShot1 = createSprite(450,300,30,10);181 allShot1.addImage(allShotimage);182 quadraShot2 = createSprite(700,450,30,10);183 quadraShot2.addImage(quadraShotimage);184 allShot3 = createSprite(775,175,30,10);185 allShot3.addImage(allShotimage);186 allShot2 = createSprite(225,275,30,10);187 allShot2.addImage(allShotimage);188 restartButton = createSprite(415,375,20,20);189 restartButton.visible = false;190 yellowbullet1Group = new Group();191 bluebullet1Group = new Group();192 yellowbullet2Group = new Group();193 bluebullet2Group = new Group();194 bluebullet3Group = new Group();195 196 engine = Engine.create();197 world = engine.world;198 Engine.run(engine);199}200function draw() {201 background(bgimage);202 //bgsound.play(true);203 if(gameState===PLAY){204 textFont("MineCrafter");205 textSize(25);206 fill("white");207 strokeWeight(2);208 stroke("black");209 text("ROUND : 1",450,25);210 if(keyDown("UP")){211 bill.changeAnimation("default1",billback_Image);212 bill.y = bill.y-6;213 }214 if(keyDown("DOWN")){215 bill.changeAnimation("default3",billfront_Image);216 bill.y = bill.y+6;217}218 if(keyDown("LEFT")){219 bill.changeAnimation("default2",billleft_Image);220 bill.x = bill.x-6;221}222 if(keyDown("RIGHT")){223 bill.changeAnimation("default4",billright_Image);224 bill.x = bill.x+6;225}226if(redRobo1.isTouching(firstcollider)){227 redRobo1.velocityX = 0;228 redRobo1.velocityY = 2.5;229}230if(redRobo1.isTouching(secondcollider)){231 redRobo1.velocityY = 0;232 redRobo1.velocityX = 2.5;233}234if(redRobo1.isTouching(thirdcollider)){235 redRobo1.velocityX = 0;236 redRobo1.velocityY = -2.5;237}238if(redRobo1.isTouching(fourthcollider)){239 redRobo1.velocityX = -2.5;240 redRobo1.velocityY = 0;241}242if(redRobo1.isTouching(fifthcollider)){243 redRobo1.velocityX = 0;244 redRobo1.velocityY = -2.5;245}246if(redRobo1.isTouching(sixthcollider)){247 redRobo1.velocityX = 2.5;248 redRobo1.velocityY = 0;249}250if(redRobo1.isTouching(seventhcollider)){251 redRobo1.velocityX = 0;252 redRobo1.velocityY = 2.5;253}254if(redRobo1.isTouching(eighthcollider)){255 redRobo1.velocityX = 2.5;256 redRobo1.velocityY = 0;257}258if(redRobo1.isTouching(ninethcollider)){259 redRobo1.velocityX = 0;260 redRobo1.velocityY = 2.5;261}262if(redRobo1.isTouching(tenthcollider)){263 redRobo1.velocityX = -2.5;264 redRobo1.velocityY = 0;265}266if(redRobo1.isTouching(eleventhcollider)){267 redRobo1.velocityX = 0;268 redRobo1.velocityY = 2.5;269}270if(redRobo2.isTouching(firstcollider)){271 redRobo2.velocityX = 0;272 redRobo2.velocityY = 2.5;273}274if(redRobo2.isTouching(secondcollider)){275 redRobo2.velocityY = 0;276 redRobo2.velocityX = 2.5;277}278if(redRobo2.isTouching(thirdcollider)){279 redRobo2.velocityX = 0;280 redRobo2.velocityY = -2.5;281}282if(redRobo2.isTouching(fourthcollider)){283 redRobo2.velocityX = -2.5;284 redRobo2.velocityY = 0;285}286if(redRobo2.isTouching(fifthcollider)){287 redRobo2.velocityX = 0;288 redRobo2.velocityY = -2.5;289}290if(redRobo2.isTouching(sixthcollider)){291 redRobo2.velocityX = 2.5;292 redRobo2.velocityY = 0;293}294if(redRobo2.isTouching(seventhcollider)){295 redRobo2.velocityX = 0;296 redRobo2.velocityY = 2.5;297}298if(redRobo2.isTouching(eighthcollider)){299 redRobo2.velocityX = 2.5;300 redRobo2.velocityY = 0;301}302if(redRobo2.isTouching(ninethcollider)){303 redRobo2.velocityX = 0;304 redRobo2.velocityY = 2.5;305}306if(redRobo2.isTouching(tenthcollider)){307 redRobo2.velocityX = -2.5;308 redRobo2.velocityY = 0;309}310if(redRobo2.isTouching(eleventhcollider)){311 redRobo2.velocityX = 0;312 redRobo2.velocityY = 2.5;313}314if(redRobo3.isTouching(firstcollider)){315 redRobo3.velocityX = 0;316 redRobo3.velocityY = 2.5;317}318if(redRobo3.isTouching(secondcollider)){319 redRobo3.velocityY = 0;320 redRobo3.velocityX = 2.5;321}322if(redRobo3.isTouching(thirdcollider)){323 redRobo3.velocityX = 0;324 redRobo3.velocityY = -2.5;325}326if(redRobo3.isTouching(fourthcollider)){327 redRobo3.velocityX = -2.5;328 redRobo3.velocityY = 0;329}330if(redRobo3.isTouching(fifthcollider)){331 redRobo3.velocityX = 0;332 redRobo3.velocityY = -2.5;333}334if(redRobo3.isTouching(sixthcollider)){335 redRobo3.velocityX = 2.5;336 redRobo3.velocityY = 0;337}338if(redRobo3.isTouching(seventhcollider)){339 redRobo3.velocityX = 0;340 redRobo3.velocityY = 2.5;341}342if(redRobo3.isTouching(eighthcollider)){343 redRobo3.velocityX = 2.5;344 redRobo3.velocityY = 0;345}346if(redRobo3.isTouching(ninethcollider)){347 redRobo3.velocityX = 0;348 redRobo3.velocityY = 2.5;349}350if(redRobo3.isTouching(tenthcollider)){351 redRobo3.velocityX = -2.5;352 redRobo3.velocityY = 0;353}354if(redRobo3.isTouching(eleventhcollider)){355 redRobo3.velocityX = 0;356 redRobo3.velocityY = 2.5;357}358if(redRobo4.isTouching(firstcollider)){359 redRobo4.velocityX = 0;360 redRobo4.velocityY = 2.5;361}362if(redRobo4.isTouching(secondcollider)){363 redRobo4.velocityY = 0;364 redRobo4.velocityX = 2.5;365}366if(redRobo4.isTouching(thirdcollider)){367 redRobo4.velocityX = 0;368 redRobo4.velocityY = -2.5;369}370if(redRobo4.isTouching(fourthcollider)){371 redRobo4.velocityX = -2.5;372 redRobo4.velocityY = 0;373}374if(redRobo4.isTouching(fifthcollider)){375 redRobo4.velocityX = 0;376 redRobo4.velocityY = -2.5;377}378if(redRobo4.isTouching(sixthcollider)){379 redRobo4.velocityX = 2.5;380 redRobo4.velocityY = 0;381}382if(redRobo4.isTouching(seventhcollider)){383 redRobo4.velocityX = 0;384 redRobo4.velocityY = 2.5;385}386if(redRobo4.isTouching(eighthcollider)){387 redRobo4.velocityX = 2.5;388 redRobo4.velocityY = 0;389}390if(redRobo4.isTouching(ninethcollider)){391 redRobo4.velocityX = 0;392 redRobo4.velocityY = 2.5;393}394if(redRobo4.isTouching(tenthcollider)){395 redRobo4.velocityX = -2.5;396 redRobo4.velocityY = 0;397}398if(redRobo4.isTouching(eleventhcollider)){399 redRobo4.velocityX = 0;400 redRobo4.velocityY = 2.5;401}402if(redRobo5.isTouching(firstcollider)){403 redRobo5.velocityX = 0;404 redRobo5.velocityY = 2.5;405}406if(redRobo5.isTouching(secondcollider)){407 redRobo5.velocityY = 0;408 redRobo5.velocityX = 2.5;409}410if(redRobo5.isTouching(thirdcollider)){411 redRobo5.velocityX = 0;412 redRobo5.velocityY = -2.5;413}414if(redRobo5.isTouching(fourthcollider)){415 redRobo5.velocityX = -2.5;416 redRobo5.velocityY = 0;417}418if(redRobo5.isTouching(fifthcollider)){419 redRobo5.velocityX = 0;420 redRobo5.velocityY = -2.5;421}422if(redRobo5.isTouching(sixthcollider)){423 redRobo5.velocityX = 2.5;424 redRobo5.velocityY = 0;425}426if(redRobo5.isTouching(seventhcollider)){427 redRobo5.velocityX = 0;428 redRobo5.velocityY = 2.5;429}430if(redRobo5.isTouching(eighthcollider)){431 redRobo5.velocityX = 2.5;432 redRobo5.velocityY = 0; 433}434if(redRobo5.isTouching(ninethcollider)){435 redRobo5.velocityX = 0;436 redRobo5.velocityY = 2.5;437}438if(redRobo5.isTouching(tenthcollider)){439 redRobo5.velocityX = -2.5;440 redRobo5.velocityY = 0;441}442if(redRobo5.isTouching(eleventhcollider)){443 redRobo5.velocityX = 0;444 redRobo5.velocityY = 2.5;445}446if(blueRobo1.isTouching(firstcollider)){447 blueRobo1.velocityX = 0;448 blueRobo1.velocityY = 3.5;449}450if(blueRobo1.isTouching(secondcollider)){451 blueRobo1.velocityY = 0;452 blueRobo1.velocityX = 3.5;453}454if(blueRobo1.isTouching(thirdcollider)){455 blueRobo1.velocityX = 0;456 blueRobo1.velocityY = -3.5;457}458if(blueRobo1.isTouching(fourthcollider)){459 blueRobo1.velocityX = -3.5;460 blueRobo1.velocityY = 0;461}462if(blueRobo1.isTouching(fifthcollider)){463 blueRobo1.velocityX = 0;464 blueRobo1.velocityY = -3.5;465}466if(blueRobo1.isTouching(sixthcollider)){467 blueRobo1.velocityX = 3.5;468 blueRobo1.velocityY = 0;469}470if(blueRobo1.isTouching(seventhcollider)){471 blueRobo1.velocityX = 0;472 blueRobo1.velocityY = 3.5;473}474if(blueRobo1.isTouching(eighthcollider)){475 blueRobo1.velocityX = 3.5;476 blueRobo1.velocityY = 0; 477}478if(blueRobo1.isTouching(ninethcollider)){479 blueRobo1.velocityX = 0;480 blueRobo1.velocityY = 3.5;481}482if(blueRobo1.isTouching(tenthcollider)){483 blueRobo1.velocityX = -3.5;484 blueRobo1.velocityY = 0;485}486if(blueRobo1.isTouching(eleventhcollider)){487 blueRobo1.velocityX = 0;488 blueRobo1.velocityY = 3.5;489}490if(blueRobo2.isTouching(firstcollider)){491 blueRobo2.velocityX = 0;492 blueRobo2.velocityY = 3.5;493}494if(blueRobo2.isTouching(secondcollider)){495 blueRobo2.velocityY = 0;496 blueRobo2.velocityX = 3.5;497}498if(blueRobo2.isTouching(thirdcollider)){499 blueRobo2.velocityX = 0;500 blueRobo2.velocityY = -3.5;501}502if(blueRobo2.isTouching(fourthcollider)){503 blueRobo2.velocityX = -3.5;504 blueRobo2.velocityY = 0;505}506if(blueRobo2.isTouching(fifthcollider)){507 blueRobo2.velocityX = 0;508 blueRobo2.velocityY = -3.5;509}510if(blueRobo2.isTouching(sixthcollider)){511 blueRobo2.velocityX = 3.5;512 blueRobo2.velocityY = 0;513}514if(blueRobo2.isTouching(seventhcollider)){515 blueRobo2.velocityX = 0;516 blueRobo2.velocityY = 3.5;517}518if(blueRobo2.isTouching(eighthcollider)){519 blueRobo2.velocityX = 3.5;520 blueRobo2.velocityY = 0; 521}522if(blueRobo2.isTouching(ninethcollider)){523 blueRobo2.velocityX = 0;524 blueRobo2.velocityY = 3.5;525}526if(blueRobo2.isTouching(tenthcollider)){527 blueRobo2.velocityX = 3.5;528 blueRobo2.velocityY = 0;529}530if(blueRobo2.isTouching(eleventhcollider)){531 blueRobo2.velocityX = 0;532 blueRobo2.velocityY = 3.5;533}534if(blueRobo3.isTouching(firstcollider)){535 blueRobo3.velocityX = 0;536 blueRobo3.velocityY = 3.5;537}538if(blueRobo3.isTouching(secondcollider)){539 blueRobo3.velocityY = 0;540 blueRobo3.velocityX = 3.5;541}542if(blueRobo3.isTouching(thirdcollider)){543 blueRobo3.velocityX = 0;544 blueRobo3.velocityY = -3.5;545}546if(blueRobo3.isTouching(fourthcollider)){547 blueRobo3.velocityX = -3.5;548 blueRobo3.velocityY = 0;549}550if(blueRobo3.isTouching(fifthcollider)){551 blueRobo3.velocityX = 0;552 blueRobo3.velocityY = -3.5;553}554if(blueRobo3.isTouching(sixthcollider)){555 blueRobo3.velocityX = 3.5;556 blueRobo3.velocityY = 0;557}558if(blueRobo3.isTouching(seventhcollider)){559 blueRobo3.velocityX = 0;560 blueRobo3.velocityY = 3.5;561}562if(blueRobo3.isTouching(eighthcollider)){563 blueRobo3.velocityX = 3.5;564 blueRobo3.velocityY = 0; 565}566if(blueRobo3.isTouching(ninethcollider)){567 blueRobo3.velocityX = 0;568 blueRobo3.velocityY = 3.5;569}570if(blueRobo3.isTouching(tenthcollider)){571 blueRobo3.velocityX = -3.5;572 blueRobo3.velocityY = 0;573}574if(blueRobo3.isTouching(eleventhcollider)){575 blueRobo3.velocityX = 0;576 blueRobo3.velocityY = 3.5;577}578if(blueRobo4.isTouching(firstcollider)){579 blueRobo4.velocityX = 0;580 blueRobo4.velocityY = 3.5;581}582if(blueRobo4.isTouching(secondcollider)){583 blueRobo4.velocityY = 0;584 blueRobo4.velocityX = 3.5;585}586if(blueRobo4.isTouching(thirdcollider)){587 blueRobo4.velocityX = 0;588 blueRobo4.velocityY = -3.5;589}590if(blueRobo4.isTouching(fourthcollider)){591 blueRobo4.velocityX = -3.5;592 blueRobo4.velocityY = 0;593}594if(blueRobo4.isTouching(fifthcollider)){595 blueRobo4.velocityX = 0;596 blueRobo4.velocityY = -3.5;597}598if(blueRobo4.isTouching(sixthcollider)){599 blueRobo4.velocityX = 3.5;600 blueRobo4.velocityY = 0;601}602if(blueRobo4.isTouching(seventhcollider)){603 blueRobo4.velocityX = 0;604 blueRobo4.velocityY = 3.5;605}606if(blueRobo4.isTouching(eighthcollider)){607 blueRobo4.velocityX = 3.5;608 blueRobo4.velocityY = 0; 609}610if(blueRobo4.isTouching(ninethcollider)){611 blueRobo4.velocityX = 0;612 blueRobo4.velocityY = 3.5;613}614if(blueRobo4.isTouching(tenthcollider)){615 blueRobo4.velocityX = -3.5;616 blueRobo4.velocityY = 0;617}618if(blueRobo4.isTouching(eleventhcollider)){619 blueRobo4.velocityX = 0;620 blueRobo4.velocityY = 3.5;621}622if(blueRobo5.isTouching(firstcollider)){623 blueRobo5.velocityX = 0;624 blueRobo5.velocityY = 3.5;625}626if(blueRobo5.isTouching(secondcollider)){627 blueRobo5.velocityY = 0;628 blueRobo5.velocityX = 3.5;629}630if(blueRobo5.isTouching(thirdcollider)){631 blueRobo5.velocityX = 0;632 blueRobo5.velocityY = -3.5;633}634if(blueRobo5.isTouching(fourthcollider)){635 blueRobo5.velocityX = -3.5;636 blueRobo5.velocityY = 0;637}638if(blueRobo5.isTouching(fifthcollider)){639 blueRobo5.velocityX = 0;640 blueRobo5.velocityY = -3.5;641}642if(blueRobo5.isTouching(sixthcollider)){643 blueRobo5.velocityX = 3.5;644 blueRobo5.velocityY = 0;645}646if(blueRobo5.isTouching(seventhcollider)){647 blueRobo5.velocityX = 0;648 blueRobo5.velocityY = 3.5;649}650if(blueRobo5.isTouching(eighthcollider)){651 blueRobo5.velocityX = 3.5;652 blueRobo5.velocityY = 0; 653}654if(blueRobo5.isTouching(ninethcollider)){655 blueRobo5.velocityX = 0;656 blueRobo5.velocityY = 3.5;657}658if(blueRobo5.isTouching(tenthcollider)){659 blueRobo5.velocityX = -3.5;660 blueRobo5.velocityY = 0;661}662if(blueRobo5.isTouching(eleventhcollider)){663 blueRobo5.velocityX = 0;664 blueRobo5.velocityY = 3.5;665}666if(blueRobo6.isTouching(firstcollider)){667 blueRobo6.velocityX = 0;668 blueRobo6.velocityY = 3.5;669}670if(blueRobo6.isTouching(secondcollider)){671 blueRobo6.velocityY = 0;672 blueRobo6.velocityX = 3.5;673}674if(blueRobo6.isTouching(thirdcollider)){675 blueRobo6.velocityX = 0;676 blueRobo6.velocityY = -3.5;677}678if(blueRobo6.isTouching(fourthcollider)){679 blueRobo6.velocityX = -3.5;680 blueRobo6.velocityY = 0;681}682if(blueRobo6.isTouching(fifthcollider)){683 blueRobo6.velocityX = 0;684 blueRobo6.velocityY = -3.5;685}686if(blueRobo6.isTouching(sixthcollider)){687 blueRobo6.velocityX = 3.5;688 blueRobo6.velocityY = 0;689}690if(blueRobo6.isTouching(seventhcollider)){691 blueRobo6.velocityX = 0;692 blueRobo6.velocityY = 3.5;693}694if(blueRobo6.isTouching(eighthcollider)){695 blueRobo6.velocityX = 3.5;696 blueRobo6.velocityY = 0; 697}698if(blueRobo6.isTouching(ninethcollider)){699 blueRobo6.velocityX = 0;700 blueRobo6.velocityY = 3.5;701}702if(blueRobo6.isTouching(tenthcollider)){703 blueRobo6.velocityX = -3.5;704 blueRobo6.velocityY = 0;705}706if(blueRobo6.isTouching(eleventhcollider)){707 blueRobo6.velocityX = 0;708 blueRobo6.velocityY = 3.5;709}710if(blueRobo7.isTouching(firstcollider)){711 blueRobo7.velocityX = 0;712 blueRobo7.velocityY = 3.5;713}714if(blueRobo7.isTouching(secondcollider)){715 blueRobo7.velocityY = 0;716 blueRobo7.velocityX = 3.5;717}718if(blueRobo7.isTouching(thirdcollider)){719 blueRobo7.velocityX = 0;720 blueRobo7.velocityY = -3.5;721}722if(blueRobo7.isTouching(fourthcollider)){723 blueRobo7.velocityX = -3.5;724 blueRobo7.velocityY = 0;725}726if(blueRobo7.isTouching(fifthcollider)){727 blueRobo7.velocityX = 0;728 blueRobo7.velocityY = -3.5;729}730if(blueRobo7.isTouching(sixthcollider)){731 blueRobo7.velocityX = 3.5;732 blueRobo7.velocityY = 0;733}734if(blueRobo7.isTouching(seventhcollider)){735 blueRobo7.velocityX = 0;736 blueRobo7.velocityY = 3.5;737}738if(blueRobo7.isTouching(eighthcollider)){739 blueRobo7.velocityX = 3.5;740 blueRobo7.velocityY = 0; 741}742if(blueRobo7.isTouching(ninethcollider)){743 blueRobo7.velocityX = 0;744 blueRobo7.velocityY = 3.5;745}746if(blueRobo7.isTouching(tenthcollider)){747 blueRobo7.velocityX = -3.5;748 blueRobo7.velocityY = 0;749}750if(blueRobo7.isTouching(eleventhcollider)){751 blueRobo7.velocityX = 0;752 blueRobo7.velocityY = 3.5;753}754if(yellowRobo1.isTouching(firstcollider)){755 yellowRobo1.velocityX = 0;756 yellowRobo1.velocityY = 5;757}758if(yellowRobo1.isTouching(secondcollider)){759 yellowRobo1.velocityY = 0;760 yellowRobo1.velocityX = 5;761}762if(yellowRobo1.isTouching(thirdcollider)){763 yellowRobo1.velocityX = 0;764 yellowRobo1.velocityY = -5;765}766if(yellowRobo1.isTouching(fourthcollider)){767 yellowRobo1.velocityX = -5;768 yellowRobo1.velocityY = 0;769}770if(yellowRobo1.isTouching(fifthcollider)){771 yellowRobo1.velocityX = 0;772 yellowRobo1.velocityY = -5;773}774if(yellowRobo1.isTouching(sixthcollider)){775 yellowRobo1.velocityX = 5;776 yellowRobo1.velocityY = 0;777}778if(yellowRobo1.isTouching(seventhcollider)){779 yellowRobo1.velocityX = 0;780 yellowRobo1.velocityY = 5;781}782if(yellowRobo1.isTouching(eighthcollider)){783 yellowRobo1.velocityX = 5;784 yellowRobo1.velocityY = 0; 785}786if(yellowRobo1.isTouching(ninethcollider)){787 yellowRobo1.velocityX = 0;788 yellowRobo1.velocityY = 5;789}790if(yellowRobo1.isTouching(tenthcollider)){791 yellowRobo1.velocityX = -5;792 yellowRobo1.velocityY = 0;793}794if(yellowRobo1.isTouching(eleventhcollider)){795 yellowRobo1.velocityX = 0;796 yellowRobo1.velocityY = 5;797}798if(yellowRobo2.isTouching(firstcollider)){799 yellowRobo2.velocityX = 0;800 yellowRobo2.velocityY = 5;801}802if(yellowRobo2.isTouching(secondcollider)){803 yellowRobo2.velocityY = 0;804 yellowRobo2.velocityX = 5;805}806if(yellowRobo2.isTouching(thirdcollider)){807 yellowRobo2.velocityX = 0;808 yellowRobo2.velocityY = -5;809}810if(yellowRobo2.isTouching(fourthcollider)){811 yellowRobo2.velocityX = -5;812 yellowRobo2.velocityY = 0;813}814if(yellowRobo2.isTouching(fifthcollider)){815 yellowRobo2.velocityX = 0;816 yellowRobo2.velocityY = -5;817}818if(yellowRobo2.isTouching(sixthcollider)){819 yellowRobo2.velocityX = 5;820 yellowRobo2.velocityY = 0;821}822if(yellowRobo2.isTouching(seventhcollider)){823 yellowRobo2.velocityX = 0;824 yellowRobo2.velocityY = 5;825}826if(yellowRobo2.isTouching(eighthcollider)){827 yellowRobo2.velocityX = 5;828 yellowRobo2.velocityY = 0; 829}830if(yellowRobo2.isTouching(ninethcollider)){831 yellowRobo2.velocityX = 0;832 yellowRobo2.velocityY = 5;833}834if(yellowRobo2.isTouching(tenthcollider)){835 yellowRobo2.velocityX = -5;836 yellowRobo2.velocityY = 0;837}838if(yellowRobo2.isTouching(eleventhcollider)){839 yellowRobo2.velocityX = 0;840 yellowRobo2.velocityY = 5;841}842if(yellowRobo3.isTouching(firstcollider)){843 yellowRobo3.velocityX = 0;844 yellowRobo3.velocityY = 5;845}846if(yellowRobo3.isTouching(secondcollider)){847 yellowRobo3.velocityY = 0;848 yellowRobo3.velocityX = 5;849}850if(yellowRobo3.isTouching(thirdcollider)){851 yellowRobo3.velocityX = 0;852 yellowRobo3.velocityY = -5;853}854if(yellowRobo3.isTouching(fourthcollider)){855 yellowRobo3.velocityX = -5;856 yellowRobo3.velocityY = 0;857}858if(yellowRobo3.isTouching(fifthcollider)){859 yellowRobo3.velocityX = 0;860 yellowRobo3.velocityY = -5;861}862if(yellowRobo3.isTouching(sixthcollider)){863 yellowRobo3.velocityX = 5;864 yellowRobo3.velocityY = 0;865}866if(yellowRobo3.isTouching(seventhcollider)){867 yellowRobo3.velocityX = 0;868 yellowRobo3.velocityY = 5;869}870if(yellowRobo3.isTouching(eighthcollider)){871 yellowRobo3.velocityX = 5;872 yellowRobo3.velocityY = 0; 873}874if(yellowRobo3.isTouching(ninethcollider)){875 yellowRobo3.velocityX = 0;876 yellowRobo3.velocityY = 5;877}878if(yellowRobo3.isTouching(tenthcollider)){879 yellowRobo3.velocityX = -5;880 yellowRobo3.velocityY = 0;881}882if(yellowRobo3.isTouching(eleventhcollider)){883 yellowRobo3.velocityX = 0;884 yellowRobo3.velocityY = 5;885}886if(yellowRobo4.isTouching(firstcollider)){887 yellowRobo4.velocityX = 0;888 yellowRobo4.velocityY = 5;889}890if(yellowRobo4.isTouching(secondcollider)){891 yellowRobo4.velocityY = 0;892 yellowRobo4.velocityX = 5;893}894if(yellowRobo4.isTouching(thirdcollider)){895 yellowRobo4.velocityX = 0;896 yellowRobo4.velocityY = -5;897}898if(yellowRobo4.isTouching(fourthcollider)){899 yellowRobo4.velocityX = -5;900 yellowRobo4.velocityY = 0;901}902if(yellowRobo4.isTouching(fifthcollider)){903 yellowRobo4.velocityX = 0;904 yellowRobo4.velocityY = -5;905}906if(yellowRobo4.isTouching(sixthcollider)){907 yellowRobo4.velocityX = 5;908 yellowRobo4.velocityY = 0;909}910if(yellowRobo4.isTouching(seventhcollider)){911 yellowRobo4.velocityX = 0;912 yellowRobo4.velocityY = 5;913}914if(yellowRobo4.isTouching(eighthcollider)){915 yellowRobo4.velocityX = 5;916 yellowRobo4.velocityY = 0; 917}918if(yellowRobo4.isTouching(ninethcollider)){919 yellowRobo4.velocityX = 0;920 yellowRobo4.velocityY = 5;921}922if(yellowRobo4.isTouching(tenthcollider)){923 yellowRobo4.velocityX = -5;924 yellowRobo4.velocityY = 0;925}926if(yellowRobo4.isTouching(eleventhcollider)){927 yellowRobo4.velocityX = 0;928 yellowRobo4.velocityY = 5;929}930if(yellowRobo5.isTouching(firstcollider)){931 yellowRobo5.velocityX = 0;932 yellowRobo5.velocityY = 5;933}934if(yellowRobo5.isTouching(secondcollider)){935 yellowRobo5.velocityY = 0;936 yellowRobo5.velocityX = 5;937}938if(yellowRobo5.isTouching(thirdcollider)){939 yellowRobo5.velocityX = 0;940 yellowRobo5.velocityY = -5;941}942if(yellowRobo5.isTouching(fourthcollider)){943 yellowRobo5.velocityX = -5;944 yellowRobo5.velocityY = 0;945}946if(yellowRobo5.isTouching(fifthcollider)){947 yellowRobo5.velocityX = 0;948 yellowRobo5.velocityY = -5;949}950if(yellowRobo5.isTouching(sixthcollider)){951 yellowRobo5.velocityX = 5;952 yellowRobo5.velocityY = 0;953}954if(yellowRobo5.isTouching(seventhcollider)){955 yellowRobo5.velocityX = 0;956 yellowRobo5.velocityY = 5;957}958if(yellowRobo5.isTouching(eighthcollider)){959 yellowRobo5.velocityX = 5;960 yellowRobo5.velocityY = 0; 961}962if(yellowRobo5.isTouching(ninethcollider)){963 yellowRobo5.velocityX = 0;964 yellowRobo5.velocityY = 5;965}966if(yellowRobo5.isTouching(tenthcollider)){967 yellowRobo5.velocityX = -5;968 yellowRobo5.velocityY = 0;969}970if(yellowRobo5.isTouching(eleventhcollider)){971 yellowRobo5.velocityX = 0;972 yellowRobo5.velocityY = 5;973}974if(yellowRobo6.isTouching(firstcollider)){975 yellowRobo6.velocityX = 0;976 yellowRobo6.velocityY = 5;977}978if(yellowRobo6.isTouching(secondcollider)){979 yellowRobo6.velocityY = 0;980 yellowRobo6.velocityX = 5;981}982if(yellowRobo6.isTouching(thirdcollider)){983 yellowRobo6.velocityX = 0;984 yellowRobo6.velocityY = -5;985}986if(yellowRobo6.isTouching(fourthcollider)){987 yellowRobo6.velocityX = -5;988 yellowRobo6.velocityY = 0;989}990if(yellowRobo6.isTouching(fifthcollider)){991 yellowRobo6.velocityX = 0;992 yellowRobo6.velocityY = -5;993}994if(yellowRobo6.isTouching(sixthcollider)){995 yellowRobo6.velocityX = 5;996 yellowRobo6.velocityY = 0;997}998if(yellowRobo6.isTouching(seventhcollider)){999 yellowRobo6.velocityX = 0;1000 yellowRobo6.velocityY = 5;1001}1002if(yellowRobo6.isTouching(eighthcollider)){1003 yellowRobo6.velocityX = 5;1004 yellowRobo6.velocityY = 0; 1005}1006if(yellowRobo6.isTouching(ninethcollider)){1007 yellowRobo6.velocityX = 0;1008 yellowRobo6.velocityY = 5;1009}1010if(yellowRobo6.isTouching(tenthcollider)){1011 yellowRobo6.velocityX = -5;1012 yellowRobo6.velocityY = 0;1013}1014if(yellowRobo6.isTouching(eleventhcollider)){1015 yellowRobo6.velocityX = 0;1016 yellowRobo6.velocityY = 5;1017}1018if(yellowRobo7.isTouching(firstcollider)){1019 yellowRobo7.velocityX = 0;1020 yellowRobo7.velocityY = 5;1021}1022if(yellowRobo7.isTouching(secondcollider)){1023 yellowRobo7.velocityY = 0;1024 yellowRobo7.velocityX = 5;1025}1026if(yellowRobo7.isTouching(thirdcollider)){1027 yellowRobo7.velocityX = 0;1028 yellowRobo7.velocityY = -5;1029}1030if(yellowRobo7.isTouching(fourthcollider)){1031 yellowRobo7.velocityX = -5;1032 yellowRobo7.velocityY = 0;1033}1034if(yellowRobo7.isTouching(fifthcollider)){1035 yellowRobo7.velocityX = 0;1036 yellowRobo7.velocityY = -5;1037}1038if(yellowRobo7.isTouching(sixthcollider)){1039 yellowRobo7.velocityX = 5;1040 yellowRobo7.velocityY = 0;1041}1042if(yellowRobo7.isTouching(seventhcollider)){1043 yellowRobo7.velocityX = 0;1044 yellowRobo7.velocityY = 5;1045}1046if(yellowRobo7.isTouching(eighthcollider)){1047 yellowRobo7.velocityX = 5;1048 yellowRobo7.velocityY = 0; 1049}1050if(yellowRobo7.isTouching(ninethcollider)){1051 yellowRobo7.velocityX = 0;1052 yellowRobo7.velocityY = 5;1053}1054if(yellowRobo7.isTouching(tenthcollider)){1055 yellowRobo7.velocityX = -5;1056 yellowRobo7.velocityY = 0;1057}1058if(yellowRobo7.isTouching(eleventhcollider)){1059 yellowRobo7.velocityX = 0;1060 yellowRobo7.velocityY = 5;1061}1062if(yellowRobo8.isTouching(firstcollider)){1063 yellowRobo8.velocityX = 0;1064 yellowRobo8.velocityY = 5;1065}1066if(yellowRobo8.isTouching(secondcollider)){1067 yellowRobo8.velocityY = 0;1068 yellowRobo8.velocityX = 5;1069}1070if(yellowRobo8.isTouching(thirdcollider)){1071 yellowRobo8.velocityX = 0;1072 yellowRobo8.velocityY = -5;1073}1074if(yellowRobo8.isTouching(fourthcollider)){1075 yellowRobo8.velocityX = -5;1076 yellowRobo8.velocityY = 0;1077}1078if(yellowRobo8.isTouching(fifthcollider)){1079 yellowRobo8.velocityX = 0;1080 yellowRobo8.velocityY = -5;1081}1082if(yellowRobo8.isTouching(sixthcollider)){1083 yellowRobo8.velocityX = 5;1084 yellowRobo8.velocityY = 0;1085}1086if(yellowRobo8.isTouching(seventhcollider)){1087 yellowRobo8.velocityX = 0;1088 yellowRobo8.velocityY = 5;1089}1090if(yellowRobo8.isTouching(eighthcollider)){1091 yellowRobo8.velocityX = 5;1092 yellowRobo8.velocityY = 0; 1093}1094if(yellowRobo8.isTouching(ninethcollider)){1095 yellowRobo8.velocityX = 0;1096 yellowRobo8.velocityY = 5;1097}1098if(yellowRobo8.isTouching(tenthcollider)){1099 yellowRobo8.velocityX = -5;1100 yellowRobo8.velocityY = 0;1101}1102if(yellowRobo8.isTouching(eleventhcollider)){1103 yellowRobo8.velocityX = 0;1104 yellowRobo8.velocityY = 5;1105}1106if(yellowRobo9.isTouching(firstcollider)){1107 yellowRobo9.velocityX = 0;1108 yellowRobo9.velocityY = 5;1109}1110if(yellowRobo9.isTouching(secondcollider)){1111 yellowRobo9.velocityY = 0;1112 yellowRobo9.velocityX = 5;1113}1114if(yellowRobo9.isTouching(thirdcollider)){1115 yellowRobo9.velocityX = 0;1116 yellowRobo9.velocityY = -5;1117}1118if(yellowRobo9.isTouching(fourthcollider)){1119 yellowRobo9.velocityX = -5;1120 yellowRobo9.velocityY = 0;1121}1122if(yellowRobo9.isTouching(fifthcollider)){1123 yellowRobo9.velocityX = 0;1124 yellowRobo9.velocityY = -5;1125}1126if(yellowRobo9.isTouching(sixthcollider)){1127 yellowRobo9.velocityX = 5;1128 yellowRobo9.velocityY = 0;1129}1130if(yellowRobo9.isTouching(seventhcollider)){1131 yellowRobo9.velocityX = 0;1132 yellowRobo9.velocityY = 5;1133}1134if(yellowRobo9.isTouching(eighthcollider)){1135 yellowRobo9.velocityX = 5;1136 yellowRobo9.velocityY = 0; 1137}1138if(yellowRobo9.isTouching(ninethcollider)){1139 yellowRobo9.velocityX = 0;1140 yellowRobo9.velocityY = 5;1141}1142if(yellowRobo9.isTouching(tenthcollider)){1143 yellowRobo9.velocityX = -5;1144 yellowRobo9.velocityY = 0;1145}1146if(yellowRobo9.isTouching(eleventhcollider)){1147 yellowRobo9.velocityX = 0;1148 yellowRobo9.velocityY = 5;1149}1150if(yellowRobo10.isTouching(firstcollider)){1151 yellowRobo10.velocityX = 0;1152 yellowRobo10.velocityY = 5;1153}1154if(yellowRobo10.isTouching(secondcollider)){1155 yellowRobo10.velocityY = 0;1156 yellowRobo10.velocityX = 5;1157}1158if(yellowRobo10.isTouching(thirdcollider)){1159 yellowRobo10.velocityX = 0;1160 yellowRobo10.velocityY = -5;1161}1162if(yellowRobo10.isTouching(fourthcollider)){1163 yellowRobo10.velocityX = -5;1164 yellowRobo10.velocityY = 0;1165}1166if(yellowRobo10.isTouching(fifthcollider)){1167 yellowRobo10.velocityX = 0;1168 yellowRobo10.velocityY = -5;1169}1170if(yellowRobo10.isTouching(sixthcollider)){1171 yellowRobo10.velocityX = 5;1172 yellowRobo10.velocityY = 0;1173}1174if(yellowRobo10.isTouching(seventhcollider)){1175 yellowRobo10.velocityX = 0;1176 yellowRobo10.velocityY = 5;1177}1178if(yellowRobo10.isTouching(eighthcollider)){1179 yellowRobo10.velocityX = 5;1180 yellowRobo10.velocityY = 0; 1181}1182if(yellowRobo10.isTouching(ninethcollider)){1183 yellowRobo10.velocityX = 0;1184 yellowRobo10.velocityY = 5;1185}1186if(yellowRobo10.isTouching(tenthcollider)){1187 yellowRobo10.velocityX = -5;1188 yellowRobo10.velocityY = 0;1189}1190if(yellowRobo10.isTouching(eleventhcollider)){1191 yellowRobo10.velocityX = 0;1192 yellowRobo10.velocityY = 5;1193}1194if(yellowRobo11.isTouching(firstcollider)){1195 yellowRobo11.velocityX = 0;1196 yellowRobo11.velocityY = 5;1197}1198if(yellowRobo11.isTouching(secondcollider)){1199 yellowRobo11.velocityY = 0;1200 yellowRobo11.velocityX = 5;1201}1202if(yellowRobo11.isTouching(thirdcollider)){1203 yellowRobo11.velocityX = 0;1204 yellowRobo11.velocityY = -5;1205}1206if(yellowRobo11.isTouching(fourthcollider)){1207 yellowRobo11.velocityX = -5;1208 yellowRobo11.velocityY = 0;1209}1210if(yellowRobo11.isTouching(fifthcollider)){1211 yellowRobo11.velocityX = 0;1212 yellowRobo11.velocityY = -5;1213}1214if(yellowRobo11.isTouching(sixthcollider)){1215 yellowRobo11.velocityX = 5;1216 yellowRobo11.velocityY = 0;1217}1218if(yellowRobo11.isTouching(seventhcollider)){1219 yellowRobo11.velocityX = 0;1220 yellowRobo11.velocityY = 5;1221}1222 1223if(yellowRobo11.isTouching(eighthcollider)){1224 yellowRobo11.velocityX = 5;1225 yellowRobo11.velocityY = 0; 1226}1227if(yellowRobo11.isTouching(ninethcollider)){1228 yellowRobo11.velocityX = 0;1229 yellowRobo11.velocityY = 5;1230}1231if(yellowRobo11.isTouching(tenthcollider)){1232 yellowRobo11.velocityX = -5;1233 yellowRobo11.velocityY = 0;1234}1235if(yellowRobo11.isTouching(eleventhcollider)){1236 yellowRobo11.velocityX = 0;1237 yellowRobo11.velocityY = 5;1238}1239if(keyWentDown("y") && coinvalue>0){1240 ybullet1 = createSprite(410,130,15,15);1241 ybullet1.addImage(ybullet);1242 ybullet1.velocityX = -3.5; 1243 coinvalue = coinvalue-1;1244 ybullet2 = createSprite(475,130,15,15);1245 ybullet2.addImage(ybullet);1246 ybullet2.velocityX = 3.5; 1247 coinvalue = coinvalue-1;1248 ybullet3 = createSprite(450,110,15,15);1249 ybullet3.addImage(ybullet);1250 ybullet3.velocityY = -3.5; 1251 coinvalue = coinvalue-1;1252 ybullet4 = createSprite(450,145,15,15);1253 ybullet4.addImage(ybullet);1254 ybullet4.velocityY = 3.5; 1255 coinvalue = coinvalue-1; 1256 yellowbullet1Group.add(ybullet1,ybullet2,ybullet3,ybullet4);1257 ybullet6 = createSprite(725,430,15,15);1258 ybullet6.addImage(ybullet);1259 ybullet6.velocityX = 3.5; 1260 coinvalue = coinvalue-1;1261 ybullet7 = createSprite(700,410,15,15);1262 ybullet7.addImage(ybullet);1263 ybullet7.velocityY = -3.5; 1264 coinvalue = coinvalue-1;1265 ybullet8 = createSprite(700,445,15,15);1266 ybullet8.addImage(ybullet);1267 ybullet8.velocityY = 3.5; 1268 coinvalue = coinvalue-1; 1269 yellowbullet2Group.add(ybullet6,ybullet7,ybullet8);1270}1271if(keyWentDown("b") && coinvalue>0){1272 //450,3001273 bbullet1 = createSprite(457.5,280,15,15);1274 bbullet1.addImage(bbullet);1275 bbullet1.velocityX = 3.5;1276 bbullet1.velocityY = -3.5;1277 coinvalue = coinvalue-1;1278 bbullet2 = createSprite(440,290.5,15,15);1279 bbullet2.addImage(bbullet);1280 bbullet2.velocityX = -3.5;1281 bbullet2.velocityY = 3.5;1282 coinvalue = coinvalue-1; 1283 bbullet3 = createSprite(445,280,15,15);1284 bbullet3.addImage(bbullet);1285 bbullet3.velocityX = -3.5;1286 bbullet3.velocityY = -3.5;1287 coinvalue = coinvalue-1; 1288 bbullet4 = createSprite(460,290.5,15,15);1289 bbullet4.addImage(bbullet);1290 bbullet4.velocityX = 3.5;1291 bbullet4.velocityY = 3.5;1292 coinvalue = coinvalue-1; 1293 bluebullet1Group.add(bbullet1,bbullet2,bbullet3,bbullet4);1294 //225,2751295 bbullet5 = createSprite(232.5,255,15,15);1296 bbullet5.addImage(bbullet);1297 bbullet5.velocityX = 3.5;1298 bbullet5.velocityY = -3.5;1299 coinvalue = coinvalue-1;1300 bbullet6 = createSprite(215,265.5,15,15);1301 bbullet6.addImage(bbullet);1302 bbullet6.velocityX = -3.5;1303 bbullet6.velocityY = 3.5;1304 coinvalue = coinvalue-1; 1305 bbullet7 = createSprite(230,255,15,15);1306 bbullet7.addImage(bbullet);1307 bbullet7.velocityX = -3.5;1308 bbullet7.velocityY = -3.5;1309 coinvalue = coinvalue-1; 1310 bbullet8 = createSprite(235,265.5,15,15);1311 bbullet8.addImage(bbullet);1312 bbullet8.velocityX = 3.5;1313 bbullet8.velocityY = 3.5;1314 coinvalue = coinvalue-1; 1315 bluebullet2Group.add(bbullet5,bbullet6,bbullet7,bbullet8);1316 // 775,1751317 bbullet9 = createSprite(782.5,155,15,15);1318 bbullet9.addImage(bbullet);1319 bbullet9.velocityX = 3.5;1320 bbullet9.velocityY = -3.5;1321 coinvalue = coinvalue-1;1322 bbullet10 = createSprite(765,185.5,15,15);1323 bbullet10.addImage(bbullet);1324 bbullet10.velocityX = -3.5;1325 bbullet10.velocityY = 3.5;1326 coinvalue4 1327 bluebullet3Group.add(bbullet9,bbullet10,bbullet11,bbullet12);1328}1329if(redRobo1.isTouching(bluebullet1Group) || redRobo1.isTouching(yellowbullet1Group) || redRobo1.isTouching(yellowbullet2Group) || redRobo1.isTouching(bluebullet2Group) || redRobo1.isTouching(bluebullet3Group)){1330 redRobo1.scale = 0.15;1331 redRobo1.addImage(coinimage);1332 redRobo1.velocityX = 0;1333 redRobo1.velocityY = 0;1334 yellowbullet1Group.destroyEach();1335 yellowbullet2Group.destroyEach();1336 bluebullet1Group.destroyEach();1337 bluebullet2Group.destroyEach();1338 bluebullet3Group.destroyEach();1339}1340if(redRobo2.isTouching(yellowbullet1Group) || redRobo2.isTouching(bluebullet1Group) || redRobo2.isTouching(yellowbullet2Group) || redRobo2.isTouching(bluebullet2Group) || redRobo2.isTouching(bluebullet3Group)){1341 redRobo2.scale = 0.15;1342 redRobo2.addImage(coinimage);1343 redRobo2.velocityX = 0;1344 redRobo2.velocityY = 0;1345 yellowbullet1Group.destroyEach();1346 yellowbullet2Group.destroyEach();1347 bluebullet1Group.destroyEach();1348 bluebullet2Group.destroyEach();1349 bluebullet3Group.destroyEach();1350}1351if(redRobo3.isTouching(yellowbullet1Group) || redRobo3.isTouching(bluebullet1Group) || redRobo3.isTouching(yellowbullet2Group) || redRobo3.isTouching(bluebullet2Group) || redRobo3.isTouching(bluebullet3Group)){1352 redRobo3.scale = 0.15;1353 redRobo3.addImage(coinimage);1354 redRobo3.velocityX = 0;1355 redRobo3.velocityY = 0;1356 yellowbullet1Group.destroyEach();1357 yellowbullet2Group.destroyEach();1358 bluebullet1Group.destroyEach();1359 bluebullet2Group.destroyEach();1360 bluebullet3Group.destroyEach();1361}1362if(redRobo4.isTouching(yellowbullet1Group) || redRobo4.isTouching(bluebullet1Group) || redRobo4.isTouching(yellowbullet2Group) || redRobo4.isTouching(bluebullet2Group) || redRobo4.isTouching(bluebullet3Group)){1363 redRobo4.scale = 0.15;1364 redRobo4.addImage(coinimage);1365 redRobo4.velocityX = 0;1366 redRobo4.velocityY = 0;1367 yellowbullet1Group.destroyEach();1368 yellowbullet2Group.destroyEach();1369 bluebullet1Group.destroyEach();1370 bluebullet2Group.destroyEach();1371 bluebullet3Group.destroyEach();1372}1373if(redRobo5.isTouching(yellowbullet1Group) || redRobo5.isTouching(bluebullet1Group) || redRobo5.isTouching(yellowbullet2Group) || redRobo5.isTouching(bluebullet2Group) || redRobo5.isTouching(bluebullet3Group)){1374 redRobo5.scale = 0.15;1375 redRobo5.addImage(coinimage);1376 redRobo5.velocityX = 0;1377 redRobo5.velocityY = 0;1378 yellowbullet1Group.destroyEach();1379 yellowbullet2Group.destroyEach();1380 bluebullet1Group.destroyEach();1381 bluebullet2Group.destroyEach();1382 bluebullet3Group.destroyEach();1383}1384if(blueRobo1.isTouching(yellowbullet1Group) || blueRobo1.isTouching(bluebullet1Group) || blueRobo1.isTouching(yellowbullet2Group) || blueRobo1.isTouching(bluebullet2Group) || blueRobo1.isTouching(bluebullet3Group)){1385 blueRobo1.scale = 0.15;1386 blueRobo1.addImage(coinimage);1387 blueRobo1.velocityX = 0;1388 blueRobo1.velocityY = 0;1389 yellowbullet1Group.destroyEach();1390 yellowbullet2Group.destroyEach();1391 bluebullet1Group.destroyEach();1392 bluebullet2Group.destroyEach();1393 bluebullet3Group.destroyEach();1394}1395if(blueRobo2.isTouching(bluebullet1Group) || blueRobo2.isTouching(yellowbullet1Group) || blueRobo2.isTouching(yellowbullet2Group) || blueRobo2.isTouching(bluebullet2Group) || blueRobo2.isTouching(bluebullet3Group)){1396 blueRobo2.scale = 0.15;1397 blueRobo2.addImage(coinimage);1398 blueRobo2.velocityX = 0;1399 blueRobo2.velocityY = 0;1400 yellowbullet1Group.destroyEach();1401 yellowbullet2Group.destroyEach();1402 bluebullet1Group.destroyEach();1403 bluebullet2Group.destroyEach();1404 bluebullet3Group.destroyEach();1405}1406if(blueRobo3.isTouching(yellowbullet1Group) || blueRobo3.isTouching(bluebullet1Group) || blueRobo3.isTouching(yellowbullet2Group) || blueRobo3.isTouching(bluebullet2Group) || blueRobo3.isTouching(bluebullet3Group)){1407 blueRobo3.scale = 0.15;1408 blueRobo3.addImage(coinimage);1409 blueRobo3.velocityX = 0;1410 blueRobo3.velocityY = 0;1411 yellowbullet1Group.destroyEach();1412 yellowbullet2Group.destroyEach();1413 bluebullet1Group.destroyEach();1414 bluebullet2Group.destroyEach();1415 bluebullet3Group.destroyEach();1416}1417if(blueRobo4.isTouching(yellowbullet1Group) || blueRobo4.isTouching(bluebullet1Group) || blueRobo4.isTouching(yellowbullet2Group) || blueRobo4.isTouching(bluebullet2Group) || blueRobo4.isTouching(bluebullet3Group)){1418 blueRobo4.scale = 0.15;1419 blueRobo4.addImage(coinimage);1420 blueRobo4.velocityX = 0;1421 blueRobo4.velocityY = 0;1422 yellowbullet1Group.destroyEach();1423 yellowbullet2Group.destroyEach();1424 bluebullet1Group.destroyEach();1425 bluebullet2Group.destroyEach();1426 bluebullet3Group.destroyEach();1427}1428if(blueRobo5.isTouching(yellowbullet1Group) || blueRobo5.isTouching(bluebullet1Group) || blueRobo5.isTouching(yellowbullet2Group) || blueRobo5.isTouching(bluebullet2Group) || blueRobo5.isTouching(bluebullet3Group)){1429 blueRobo5.scale = 0.15;1430 blueRobo5.addImage(coinimage);1431 blueRobo5.velocityX = 0;1432 blueRobo5.velocityY = 0;1433 yellowbullet1Group.destroyEach();1434 yellowbullet2Group.destroyEach();1435 bluebullet1Group.destroyEach();1436 bluebullet2Group.destroyEach();1437 bluebullet3Group.destroyEach();1438}1439if(blueRobo6.isTouching(yellowbullet1Group) || blueRobo6.isTouching(bluebullet1Group) || blueRobo6.isTouching(yellowbullet2Group) || blueRobo6.isTouching(bluebullet2Group) || blueRobo6.isTouching(bluebullet3Group)){1440 blueRobo6.scale = 0.15;1441 blueRobo6.addImage(coinimage);1442 blueRobo6.velocityX = 0;1443 blueRobo6.velocityY = 0;1444 yellowbullet1Group.destroyEach();1445 yellowbullet2Group.destroyEach();1446 bluebullet1Group.destroyEach();1447 bluebullet2Group.destroyEach();1448 bluebullet3Group.destroyEach();1449}1450if(blueRobo7.isTouching(bluebullet1Group) || blueRobo7.isTouching(yellowbullet1Group) || blueRobo7.isTouching(yellowbullet2Group) || blueRobo7.isTouching(bluebullet2Group) || blueRobo7.isTouching(bluebullet3Group)){1451 blueRobo7.scale = 0.15;1452 blueRobo7.addImage(coinimage);1453 blueRobo7.velocityX = 0;1454 blueRobo7.velocityY = 0;1455 yellowbullet1Group.destroyEach();1456 yellowbullet2Group.destroyEach();1457 bluebullet1Group.destroyEach();1458 bluebullet2Group.destroyEach();1459 bluebullet3Group.destroyEach();1460}1461if(yellowRobo1.isTouching(bluebullet1Group) || yellowRobo1.isTouching(yellowbullet1Group) || yellowRobo1.isTouching(yellowbullet2Group) || yellowRobo1.isTouching(bluebullet2Group) || yellowRobo1.isTouching(bluebullet3Group)){1462 yellowRobo1.scale = 0.15;1463 yellowRobo1.addImage(coinimage);1464 yellowRobo1.velocityX = 0;1465 yellowRobo1.velocityY = 0;1466 yellowbullet1Group.destroyEach();1467 yellowbullet2Group.destroyEach();1468 bluebullet1Group.destroyEach();1469 bluebullet2Group.destroyEach();1470 bluebullet3Group.destroyEach();1471}1472if(yellowRobo2.isTouching(yellowbullet1Group) || yellowRobo2.isTouching(bluebullet1Group) || yellowRobo2.isTouching(yellowbullet2Group) || yellowRobo2.isTouching(bluebullet2Group) || yellowRobo2.isTouching(bluebullet3Group)){1473 yellowRobo2.scale = 0.15;1474 yellowRobo2.addImage(coinimage);1475 yellowRobo2.velocityX = 0;1476 yellowRobo2.velocityY = 0;1477 yellowbullet1Group.destroyEach();1478 yellowbullet2Group.destroyEach();1479 bluebullet1Group.destroyEach();1480 bluebullet2Group.destroyEach();1481 bluebullet3Group.destroyEach();1482}1483if(yellowRobo3.isTouching(yellowbullet1Group) || yellowRobo3.isTouching(bluebullet1Group) || yellowRobo3.isTouching(yellowbullet2Group) || yellowRobo3.isTouching(bluebullet2Group) || yellowRobo3.isTouching(bluebullet3Group)){1484 yellowRobo3.scale = 0.15;1485 yellowRobo3.addImage(coinimage);1486 yellowRobo3.velocityX = 0;1487 yellowRobo3.velocityY = 0;1488 yellowbullet1Group.destroyEach();1489 yellowbullet2Group.destroyEach();1490 bluebullet1Group.destroyEach();1491 bluebullet2Group.destroyEach();1492 bluebullet3Group.destroyEach();1493}1494if(yellowRobo4.isTouching(yellowbullet1Group) || yellowRobo4.isTouching(bluebullet1Group) || yellowRobo4.isTouching(yellowbullet2Group) || yellowRobo4.isTouching(bluebullet2Group) || yellowRobo4.isTouching(bluebullet3Group)){1495 yellowRobo4.scale = 0.15;1496 yellowRobo4.addImage(coinimage);1497 yellowRobo4.velocityX = 0;1498 yellowRobo4.velocityY = 0;1499 yellowbullet1Group.destroyEach();1500 yellowbullet2Group.destroyEach();1501 bluebullet1Group.destroyEach();1502 bluebullet2Group.destroyEach();1503 bluebullet3Group.destroyEach();1504}1505if(yellowRobo5.isTouching(yellowbullet1Group) || yellowRobo5.isTouching(bluebullet1Group) || yellowRobo5.isTouching(yellowbullet2Group) || yellowRobo5.isTouching(bluebullet2Group) || yellowRobo5.isTouching(bluebullet3Group)){1506 yellowRobo5.scale = 0.15;1507 yellowRobo5.addImage(coinimage);1508 yellowRobo5.velocityX = 0;1509 yellowRobo5.velocityY = 0;1510 yellowbullet1Group.destroyEach();1511 yellowbullet2Group.destroyEach();1512 bluebullet1Group.destroyEach();1513 bluebullet2Group.destroyEach();1514 bluebullet3Group.destroyEach();1515}1516if(yellowRobo6.isTouching(yellowbullet1Group) || yellowRobo6.isTouching(bluebullet1Group) || yellowRobo6.isTouching(yellowbullet2Group) || yellowRobo6.isTouching(bluebullet2Group) || yellowRobo6.isTouching(bluebullet3Group)){1517 yellowRobo6.scale = 0.15;1518 yellowRobo6.addImage(coinimage);1519 yellowRobo6.velocityX = 0;1520 yellowRobo6.velocityY = 0;1521 yellowbullet1Group.destroyEach();1522 yellowbullet2Group.destroyEach();1523 bluebullet1Group.destroyEach();1524 bluebullet2Group.destroyEach();1525 bluebullet3Group.destroyEach();1526}1527if(yellowRobo7.isTouching(yellowbullet1Group) || yellowRobo7.isTouching(bluebullet1Group) || yellowRobo7.isTouching(yellowbullet2Group) || yellowRobo7.isTouching(bluebullet2Group) || yellowRobo7.isTouching(bluebullet3Group)){1528 yellowRobo7.scale = 0.15;1529 yellowRobo7.addImage(coinimage);1530 yellowRobo7.velocityX = 0;1531 yellowRobo7.velocityY = 0;1532 yellowbullet1Group.destroyEach();1533 yellowbullet2Group.destroyEach();1534 bluebullet1Group.destroyEach();1535 bluebullet2Group.destroyEach();1536 bluebullet3Group.destroyEach();1537}1538if(yellowRobo8.isTouching(yellowbullet1Group) || yellowRobo8.isTouching(bluebullet1Group) || yellowRobo8.isTouching(yellowbullet2Group) || yellowRobo8.isTouching(bluebullet2Group) || yellowRobo8.isTouching(bluebullet3Group)){1539 yellowRobo8.scale = 0.15;1540 yellowRobo8.addImage(coinimage);1541 yellowRobo8.velocityX = 0;1542 yellowRobo8.velocityY = 0;1543 yellowbullet1Group.destroyEach();1544 yellowbullet2Group.destroyEach();1545 bluebullet1Group.destroyEach();1546 bluebullet2Group.destroyEach();1547 bluebullet3Group.destroyEach();1548}1549if(yellowRobo9.isTouching(bluebullet3Group) || yellowRobo9.isTouching(bluebullet1Group) || yellowRobo9.isTouching(yellowbullet2Group) || yellowRobo9.isTouching(bluebullet2Group) || yellowRobo9.isTouching(yellowbullet1Group)){1550 yellowRobo9.scale = 0.15;1551 yellowRobo9.addImage(coinimage);1552 yellowRobo9.velocityX = 0;1553 yellowRobo9.velocityY = 0;1554 yellowbullet1Group.destroyEach();1555 yellowbullet2Group.destroyEach();1556 bluebullet1Group.destroyEach();1557 bluebullet2Group.destroyEach();1558 bluebullet3Group.destroyEach();1559}1560if(yellowRobo10.isTouching(yellowbullet1Group) || yellowRobo10.isTouching(bluebullet1Group) || yellowRobo10.isTouching(yellowbullet2Group) || yellowRobo10.isTouching(bluebullet2Group) || yellowRobo10.isTouching(bluebullet3Group)){1561 yellowRobo10.scale = 0.15;1562 yellowRobo10.addImage(coinimage);1563 yellowRobo10.velocityX = 0;1564 yellowRobo10.velocityY = 0;1565 yellowbullet1Group.destroyEach();1566 yellowbullet2Group.destroyEach();1567 bluebullet1Group.destroyEach();1568 bluebullet2Group.destroyEach();1569 bluebullet3Group.destroyEach();1570}1571if(yellowRobo11.isTouching(bluebullet1Group) || yellowRobo11.isTouching(yellowbullet1Group) || yellowRobo11.isTouching(yellowbullet2Group) || yellowRobo11.isTouching(bluebullet2Group) || yellowRobo11.isTouching(bluebullet3Group)){1572 yellowRobo11.scale = 0.15;1573 yellowRobo11.addImage(coinimage);1574 yellowRobo11.velocityX = 0;1575 yellowRobo11.velocityY = 0;1576 yellowbullet1Group.destroyEach();1577 yellowbullet2Group.destroyEach();1578 bluebullet1Group.destroyEach();1579 bluebullet2Group.destroyEach();1580 bluebullet3Group.destroyEach();1581}1582if(redRobo1.isTouching(bill)){1583 coinvalue = coinvalue+8;1584 redRobo1.destroy();1585 destroyedRobos = destroyedRobos+11586}1587if(redRobo2.isTouching(bill)){1588 coinvalue = coinvalue+8;1589 redRobo2.destroy();1590 destroyedRobos = destroyedRobos+11591}1592if(redRobo3.isTouching(bill)){1593 coinvalue = coinvalue+8;1594 redRobo3.destroy();1595 destroyedRobos = destroyedRobos+11596}1597if(redRobo4.isTouching(bill)){1598 coinvalue = coinvalue+8;1599 redRobo4.destroy();1600 destroyedRobos = destroyedRobos+11601}1602if(redRobo5.isTouching(bill)){1603 coinvalue = coinvalue+8;1604 redRobo5.destroy();1605 destroyedRobos = destroyedRobos+11606}1607if(blueRobo1.isTouching(bill)){1608 coinvalue = coinvalue+8;1609 blueRobo1.destroy();1610 destroyedRobos = destroyedRobos+11611}1612if(blueRobo2.isTouching(bill)){1613 coinvalue = coinvalue+8;1614 blueRobo2.destroy();1615 destroyedRobos = destroyedRobos+11616}1617if(blueRobo3.isTouching(bill)){1618 coinvalue = coinvalue+8;1619 blueRobo3.destroy();1620 destroyedRobos = destroyedRobos+11621}1622if(blueRobo4.isTouching(bill)){1623 coinvalue = coinvalue+8;1624 blueRobo4.destroy();1625 destroyedRobos = destroyedRobos+11626}1627if(blueRobo5.isTouching(bill)){1628 coinvalue = coinvalue+8;1629 blueRobo5.destroy();1630 destroyedRobos = destroyedRobos+11631}1632if(blueRobo6.isTouching(bill)){1633 coinvalue = coinvalue+8;1634 blueRobo6.destroy();1635 destroyedRobos = destroyedRobos+11636}1637if(blueRobo7.isTouching(bill)){1638 coinvalue = coinvalue+8;1639 blueRobo7.destroy();1640 destroyedRobos = destroyedRobos+11641}1642if(yellowRobo1.isTouching(bill)){1643 coinvalue = coinvalue+8;1644 yellowRobo1.destroy();1645 destroyedRobos = destroyedRobos+11646}1647if(yellowRobo2.isTouching(bill)){1648 coinvalue = coinvalue+8;1649 yellowRobo2.destroy();1650 destroyedRobos = destroyedRobos+11651}1652if(yellowRobo3.isTouching(bill)){1653 coinvalue = coinvalue+8;1654 yellowRobo3.destroy();1655 destroyedRobos = destroyedRobos+11656}1657if(yellowRobo4.isTouching(bill)){1658 coinvalue = coinvalue+8;1659 yellowRobo4.destroy();1660 destroyedRobos = destroyedRobos+11661}1662if(yellowRobo5.isTouching(bill)){1663 coinvalue = coinvalue+8;1664 yellowRobo5.destroy();1665 destroyedRobos = destroyedRobos+11666}1667if(yellowRobo6.isTouching(bill)){1668 coinvalue = coinvalue+8;1669 yellowRobo6.destroy();1670 destroyedRobos = destroyedRobos+11671}1672if(yellowRobo7.isTouching(bill)){1673 coinvalue = coinvalue+8;1674 yellowRobo7.destroy();1675 destroyedRobos = destroyedRobos+11676}1677if(yellowRobo8.isTouching(bill)){1678 coinvalue = coinvalue+8;1679 yellowRobo8.destroy();1680 destroyedRobos = destroyedRobos+11681}1682if(yellowRobo9.isTouching(bill)){1683 coinvalue = coinvalue+8;1684 yellowRobo9.destroy();1685 destroyedRobos = destroyedRobos+11686}1687if(yellowRobo10.isTouching(bill)){1688 coinvalue = coinvalue+8;1689 yellowRobo10.destroy();1690 destroyedRobos = destroyedRobos+11691}1692if(yellowRobo11.isTouching(bill)){1693 coinvalue = coinvalue+8;1694 yellowRobo11.destroy();1695 destroyedRobos = destroyedRobos+11696}1697if(bill.isTouching(yellowbullet1Group)){1698 yellowbullet1Group.destroyEach();1699 life = life-10;1700}1701if(bill.isTouching(bluebullet1Group)){1702 bluebullet1Group.destroyEach();1703 life = life-10;1704}1705if(bill.isTouching(yellowbullet2Group)){1706 yellowbullet2Group.destroyEach();1707 life = life-10;1708}1709if(bill.isTouching(bluebullet2Group)){1710 bluebullet2Group.destroyEach();1711 life = life-10;1712}1713if(bill.isTouching(bluebullet3Group)){1714 bluebullet3Group.destroyEach();1715 life = life-10;1716}1717if(life === 0|| redRobo1.isTouching(watchtower) || redRobo2.isTouching(watchtower) || redRobo3.isTouching(watchtower) || redRobo4.isTouching(watchtower) || redRobo5.isTouching(watchtower) || blueRobo1.isTouching(watchtower) || blueRobo2.isTouching(watchtower) || blueRobo3.isTouching(watchtower) || blueRobo4.isTouching(watchtower) || blueRobo5.isTouching(watchtower) || blueRobo6.isTouching(watchtower) || blueRobo7.isTouching(watchtower) || yellowRobo1.isTouching(watchtower) || yellowRobo2.isTouching(watchtower) || yellowRobo3.isTouching(watchtower) || yellowRobo4.isTouching(watchtower) || yellowRobo5.isTouching(watchtower) || yellowRobo6.isTouching(watchtower) || yellowRobo7.isTouching(watchtower) || yellowRobo8.isTouching(watchtower) || yellowRobo9.isTouching(watchtower) || yellowRobo10.isTouching(watchtower) || yellowRobo11.isTouching(watchtower)){1718gameState = GAMEOVER;1719}1720if(destroyedRobos >= 23){1721 gameState = WIN; 1722}1723bill.collide(edges);1724bill.collide(treecollider1);1725bill.collide(treecollider2);1726bill.collide(watchtower);1727}1728if(gameState===GAMEOVER){1729 fill("red");1730 textSize(35)1731 strokeWeight(2.5);1732 stroke("black");1733 text(" YOU HAVE LOST YOUR VILLAGE ",175,250);1734 bgsound.stop(); 1735 redRobo1.destroy();1736 redRobo2.destroy();1737 redRobo3.destroy();1738 redRobo4.destroy();1739 redRobo5.destroy();1740 blueRobo1.destroy();1741 blueRobo2.destroy();1742 blueRobo3.destroy();1743 blueRobo4.destroy();1744 blueRobo5.destroy();1745 blueRobo6.destroy();1746 blueRobo7.destroy();1747 yellowRobo1.destroy();1748 yellowRobo2.destroy();1749 yellowRobo3.destroy();1750 yellowRobo4.destroy();1751 yellowRobo5.destroy();1752 yellowRobo6.destroy();1753 yellowRobo7.destroy();1754 yellowRobo8.destroy();1755 yellowRobo9.destroy();1756 yellowRobo10.destroy();1757 yellowRobo11.destroy();1758}1759if(gameState===WIN){1760 textFont("MineCrafter");1761 textSize(25);1762 fill("white");1763 strokeWeight(2);1764 stroke("black");1765 text("THANK YOU SO MUCH",350,210);1766 text("YOU HAVE SAVED MY VILLAGE",300,260);1767}1768textFont("MineCrafter");1769textSize(25);1770fill("white");1771strokeWeight(2);1772stroke("black");1773text("Life : " + life,20,25);1774textSize(25);1775fill("yellow");1776strokeWeight(3);1777stroke("black");1778text("Coins Left = "+ coinvalue ,20,70);1779textSize(25);1780fill("white");1781strokeWeight(3);1782stroke("black");1783text("Bullets Left = "+ coinvalue ,20,115);1784 drawSprites();...

Full Screen

Full Screen

_color_data.py

Source:_color_data.py Github

copy

Full Screen

1from __future__ import (absolute_import, division, print_function,2 unicode_literals)3from collections import OrderedDict4import six5BASE_COLORS = {6 'b': (0, 0, 1),7 'g': (0, 0.5, 0),8 'r': (1, 0, 0),9 'c': (0, 0.75, 0.75),10 'm': (0.75, 0, 0.75),11 'y': (0.75, 0.75, 0),12 'k': (0, 0, 0),13 'w': (1, 1, 1)}14# These colors are from Tableau15TABLEAU_COLORS = (16 ('blue', '#1f77b4'),17 ('orange', '#ff7f0e'),18 ('green', '#2ca02c'),19 ('red', '#d62728'),20 ('purple', '#9467bd'),21 ('brown', '#8c564b'),22 ('pink', '#e377c2'),23 ('gray', '#7f7f7f'),24 ('olive', '#bcbd22'),25 ('cyan', '#17becf'),26)27# Normalize name to "tab:<name>" to avoid name collisions.28TABLEAU_COLORS = OrderedDict(29 ('tab:' + name, value) for name, value in TABLEAU_COLORS)30# This mapping of color names -> hex values is taken from31# a survey run by Randel Monroe see:32# http://blog.xkcd.com/2010/05/03/color-survey-results/33# for more details. The results are hosted at34# https://xkcd.com/color/rgb.txt35#36# License: http://creativecommons.org/publicdomain/zero/1.0/37XKCD_COLORS = {38 'cloudy blue': '#acc2d9',39 'dark pastel green': '#56ae57',40 'dust': '#b2996e',41 'electric lime': '#a8ff04',42 'fresh green': '#69d84f',43 'light eggplant': '#894585',44 'nasty green': '#70b23f',45 'really light blue': '#d4ffff',46 'tea': '#65ab7c',47 'warm purple': '#952e8f',48 'yellowish tan': '#fcfc81',49 'cement': '#a5a391',50 'dark grass green': '#388004',51 'dusty teal': '#4c9085',52 'grey teal': '#5e9b8a',53 'macaroni and cheese': '#efb435',54 'pinkish tan': '#d99b82',55 'spruce': '#0a5f38',56 'strong blue': '#0c06f7',57 'toxic green': '#61de2a',58 'windows blue': '#3778bf',59 'blue blue': '#2242c7',60 'blue with a hint of purple': '#533cc6',61 'booger': '#9bb53c',62 'bright sea green': '#05ffa6',63 'dark green blue': '#1f6357',64 'deep turquoise': '#017374',65 'green teal': '#0cb577',66 'strong pink': '#ff0789',67 'bland': '#afa88b',68 'deep aqua': '#08787f',69 'lavender pink': '#dd85d7',70 'light moss green': '#a6c875',71 'light seafoam green': '#a7ffb5',72 'olive yellow': '#c2b709',73 'pig pink': '#e78ea5',74 'deep lilac': '#966ebd',75 'desert': '#ccad60',76 'dusty lavender': '#ac86a8',77 'purpley grey': '#947e94',78 'purply': '#983fb2',79 'candy pink': '#ff63e9',80 'light pastel green': '#b2fba5',81 'boring green': '#63b365',82 'kiwi green': '#8ee53f',83 'light grey green': '#b7e1a1',84 'orange pink': '#ff6f52',85 'tea green': '#bdf8a3',86 'very light brown': '#d3b683',87 'egg shell': '#fffcc4',88 'eggplant purple': '#430541',89 'powder pink': '#ffb2d0',90 'reddish grey': '#997570',91 'baby shit brown': '#ad900d',92 'liliac': '#c48efd',93 'stormy blue': '#507b9c',94 'ugly brown': '#7d7103',95 'custard': '#fffd78',96 'darkish pink': '#da467d',97 'deep brown': '#410200',98 'greenish beige': '#c9d179',99 'manilla': '#fffa86',100 'off blue': '#5684ae',101 'battleship grey': '#6b7c85',102 'browny green': '#6f6c0a',103 'bruise': '#7e4071',104 'kelley green': '#009337',105 'sickly yellow': '#d0e429',106 'sunny yellow': '#fff917',107 'azul': '#1d5dec',108 'darkgreen': '#054907',109 'green/yellow': '#b5ce08',110 'lichen': '#8fb67b',111 'light light green': '#c8ffb0',112 'pale gold': '#fdde6c',113 'sun yellow': '#ffdf22',114 'tan green': '#a9be70',115 'burple': '#6832e3',116 'butterscotch': '#fdb147',117 'toupe': '#c7ac7d',118 'dark cream': '#fff39a',119 'indian red': '#850e04',120 'light lavendar': '#efc0fe',121 'poison green': '#40fd14',122 'baby puke green': '#b6c406',123 'bright yellow green': '#9dff00',124 'charcoal grey': '#3c4142',125 'squash': '#f2ab15',126 'cinnamon': '#ac4f06',127 'light pea green': '#c4fe82',128 'radioactive green': '#2cfa1f',129 'raw sienna': '#9a6200',130 'baby purple': '#ca9bf7',131 'cocoa': '#875f42',132 'light royal blue': '#3a2efe',133 'orangeish': '#fd8d49',134 'rust brown': '#8b3103',135 'sand brown': '#cba560',136 'swamp': '#698339',137 'tealish green': '#0cdc73',138 'burnt siena': '#b75203',139 'camo': '#7f8f4e',140 'dusk blue': '#26538d',141 'fern': '#63a950',142 'old rose': '#c87f89',143 'pale light green': '#b1fc99',144 'peachy pink': '#ff9a8a',145 'rosy pink': '#f6688e',146 'light bluish green': '#76fda8',147 'light bright green': '#53fe5c',148 'light neon green': '#4efd54',149 'light seafoam': '#a0febf',150 'tiffany blue': '#7bf2da',151 'washed out green': '#bcf5a6',152 'browny orange': '#ca6b02',153 'nice blue': '#107ab0',154 'sapphire': '#2138ab',155 'greyish teal': '#719f91',156 'orangey yellow': '#fdb915',157 'parchment': '#fefcaf',158 'straw': '#fcf679',159 'very dark brown': '#1d0200',160 'terracota': '#cb6843',161 'ugly blue': '#31668a',162 'clear blue': '#247afd',163 'creme': '#ffffb6',164 'foam green': '#90fda9',165 'grey/green': '#86a17d',166 'light gold': '#fddc5c',167 'seafoam blue': '#78d1b6',168 'topaz': '#13bbaf',169 'violet pink': '#fb5ffc',170 'wintergreen': '#20f986',171 'yellow tan': '#ffe36e',172 'dark fuchsia': '#9d0759',173 'indigo blue': '#3a18b1',174 'light yellowish green': '#c2ff89',175 'pale magenta': '#d767ad',176 'rich purple': '#720058',177 'sunflower yellow': '#ffda03',178 'green/blue': '#01c08d',179 'leather': '#ac7434',180 'racing green': '#014600',181 'vivid purple': '#9900fa',182 'dark royal blue': '#02066f',183 'hazel': '#8e7618',184 'muted pink': '#d1768f',185 'booger green': '#96b403',186 'canary': '#fdff63',187 'cool grey': '#95a3a6',188 'dark taupe': '#7f684e',189 'darkish purple': '#751973',190 'true green': '#089404',191 'coral pink': '#ff6163',192 'dark sage': '#598556',193 'dark slate blue': '#214761',194 'flat blue': '#3c73a8',195 'mushroom': '#ba9e88',196 'rich blue': '#021bf9',197 'dirty purple': '#734a65',198 'greenblue': '#23c48b',199 'icky green': '#8fae22',200 'light khaki': '#e6f2a2',201 'warm blue': '#4b57db',202 'dark hot pink': '#d90166',203 'deep sea blue': '#015482',204 'carmine': '#9d0216',205 'dark yellow green': '#728f02',206 'pale peach': '#ffe5ad',207 'plum purple': '#4e0550',208 'golden rod': '#f9bc08',209 'neon red': '#ff073a',210 'old pink': '#c77986',211 'very pale blue': '#d6fffe',212 'blood orange': '#fe4b03',213 'grapefruit': '#fd5956',214 'sand yellow': '#fce166',215 'clay brown': '#b2713d',216 'dark blue grey': '#1f3b4d',217 'flat green': '#699d4c',218 'light green blue': '#56fca2',219 'warm pink': '#fb5581',220 'dodger blue': '#3e82fc',221 'gross green': '#a0bf16',222 'ice': '#d6fffa',223 'metallic blue': '#4f738e',224 'pale salmon': '#ffb19a',225 'sap green': '#5c8b15',226 'algae': '#54ac68',227 'bluey grey': '#89a0b0',228 'greeny grey': '#7ea07a',229 'highlighter green': '#1bfc06',230 'light light blue': '#cafffb',231 'light mint': '#b6ffbb',232 'raw umber': '#a75e09',233 'vivid blue': '#152eff',234 'deep lavender': '#8d5eb7',235 'dull teal': '#5f9e8f',236 'light greenish blue': '#63f7b4',237 'mud green': '#606602',238 'pinky': '#fc86aa',239 'red wine': '#8c0034',240 'shit green': '#758000',241 'tan brown': '#ab7e4c',242 'darkblue': '#030764',243 'rosa': '#fe86a4',244 'lipstick': '#d5174e',245 'pale mauve': '#fed0fc',246 'claret': '#680018',247 'dandelion': '#fedf08',248 'orangered': '#fe420f',249 'poop green': '#6f7c00',250 'ruby': '#ca0147',251 'dark': '#1b2431',252 'greenish turquoise': '#00fbb0',253 'pastel red': '#db5856',254 'piss yellow': '#ddd618',255 'bright cyan': '#41fdfe',256 'dark coral': '#cf524e',257 'algae green': '#21c36f',258 'darkish red': '#a90308',259 'reddy brown': '#6e1005',260 'blush pink': '#fe828c',261 'camouflage green': '#4b6113',262 'lawn green': '#4da409',263 'putty': '#beae8a',264 'vibrant blue': '#0339f8',265 'dark sand': '#a88f59',266 'purple/blue': '#5d21d0',267 'saffron': '#feb209',268 'twilight': '#4e518b',269 'warm brown': '#964e02',270 'bluegrey': '#85a3b2',271 'bubble gum pink': '#ff69af',272 'duck egg blue': '#c3fbf4',273 'greenish cyan': '#2afeb7',274 'petrol': '#005f6a',275 'royal': '#0c1793',276 'butter': '#ffff81',277 'dusty orange': '#f0833a',278 'off yellow': '#f1f33f',279 'pale olive green': '#b1d27b',280 'orangish': '#fc824a',281 'leaf': '#71aa34',282 'light blue grey': '#b7c9e2',283 'dried blood': '#4b0101',284 'lightish purple': '#a552e6',285 'rusty red': '#af2f0d',286 'lavender blue': '#8b88f8',287 'light grass green': '#9af764',288 'light mint green': '#a6fbb2',289 'sunflower': '#ffc512',290 'velvet': '#750851',291 'brick orange': '#c14a09',292 'lightish red': '#fe2f4a',293 'pure blue': '#0203e2',294 'twilight blue': '#0a437a',295 'violet red': '#a50055',296 'yellowy brown': '#ae8b0c',297 'carnation': '#fd798f',298 'muddy yellow': '#bfac05',299 'dark seafoam green': '#3eaf76',300 'deep rose': '#c74767',301 'dusty red': '#b9484e',302 'grey/blue': '#647d8e',303 'lemon lime': '#bffe28',304 'purple/pink': '#d725de',305 'brown yellow': '#b29705',306 'purple brown': '#673a3f',307 'wisteria': '#a87dc2',308 'banana yellow': '#fafe4b',309 'lipstick red': '#c0022f',310 'water blue': '#0e87cc',311 'brown grey': '#8d8468',312 'vibrant purple': '#ad03de',313 'baby green': '#8cff9e',314 'barf green': '#94ac02',315 'eggshell blue': '#c4fff7',316 'sandy yellow': '#fdee73',317 'cool green': '#33b864',318 'pale': '#fff9d0',319 'blue/grey': '#758da3',320 'hot magenta': '#f504c9',321 'greyblue': '#77a1b5',322 'purpley': '#8756e4',323 'baby shit green': '#889717',324 'brownish pink': '#c27e79',325 'dark aquamarine': '#017371',326 'diarrhea': '#9f8303',327 'light mustard': '#f7d560',328 'pale sky blue': '#bdf6fe',329 'turtle green': '#75b84f',330 'bright olive': '#9cbb04',331 'dark grey blue': '#29465b',332 'greeny brown': '#696006',333 'lemon green': '#adf802',334 'light periwinkle': '#c1c6fc',335 'seaweed green': '#35ad6b',336 'sunshine yellow': '#fffd37',337 'ugly purple': '#a442a0',338 'medium pink': '#f36196',339 'puke brown': '#947706',340 'very light pink': '#fff4f2',341 'viridian': '#1e9167',342 'bile': '#b5c306',343 'faded yellow': '#feff7f',344 'very pale green': '#cffdbc',345 'vibrant green': '#0add08',346 'bright lime': '#87fd05',347 'spearmint': '#1ef876',348 'light aquamarine': '#7bfdc7',349 'light sage': '#bcecac',350 'yellowgreen': '#bbf90f',351 'baby poo': '#ab9004',352 'dark seafoam': '#1fb57a',353 'deep teal': '#00555a',354 'heather': '#a484ac',355 'rust orange': '#c45508',356 'dirty blue': '#3f829d',357 'fern green': '#548d44',358 'bright lilac': '#c95efb',359 'weird green': '#3ae57f',360 'peacock blue': '#016795',361 'avocado green': '#87a922',362 'faded orange': '#f0944d',363 'grape purple': '#5d1451',364 'hot green': '#25ff29',365 'lime yellow': '#d0fe1d',366 'mango': '#ffa62b',367 'shamrock': '#01b44c',368 'bubblegum': '#ff6cb5',369 'purplish brown': '#6b4247',370 'vomit yellow': '#c7c10c',371 'pale cyan': '#b7fffa',372 'key lime': '#aeff6e',373 'tomato red': '#ec2d01',374 'lightgreen': '#76ff7b',375 'merlot': '#730039',376 'night blue': '#040348',377 'purpleish pink': '#df4ec8',378 'apple': '#6ecb3c',379 'baby poop green': '#8f9805',380 'green apple': '#5edc1f',381 'heliotrope': '#d94ff5',382 'yellow/green': '#c8fd3d',383 'almost black': '#070d0d',384 'cool blue': '#4984b8',385 'leafy green': '#51b73b',386 'mustard brown': '#ac7e04',387 'dusk': '#4e5481',388 'dull brown': '#876e4b',389 'frog green': '#58bc08',390 'vivid green': '#2fef10',391 'bright light green': '#2dfe54',392 'fluro green': '#0aff02',393 'kiwi': '#9cef43',394 'seaweed': '#18d17b',395 'navy green': '#35530a',396 'ultramarine blue': '#1805db',397 'iris': '#6258c4',398 'pastel orange': '#ff964f',399 'yellowish orange': '#ffab0f',400 'perrywinkle': '#8f8ce7',401 'tealish': '#24bca8',402 'dark plum': '#3f012c',403 'pear': '#cbf85f',404 'pinkish orange': '#ff724c',405 'midnight purple': '#280137',406 'light urple': '#b36ff6',407 'dark mint': '#48c072',408 'greenish tan': '#bccb7a',409 'light burgundy': '#a8415b',410 'turquoise blue': '#06b1c4',411 'ugly pink': '#cd7584',412 'sandy': '#f1da7a',413 'electric pink': '#ff0490',414 'muted purple': '#805b87',415 'mid green': '#50a747',416 'greyish': '#a8a495',417 'neon yellow': '#cfff04',418 'banana': '#ffff7e',419 'carnation pink': '#ff7fa7',420 'tomato': '#ef4026',421 'sea': '#3c9992',422 'muddy brown': '#886806',423 'turquoise green': '#04f489',424 'buff': '#fef69e',425 'fawn': '#cfaf7b',426 'muted blue': '#3b719f',427 'pale rose': '#fdc1c5',428 'dark mint green': '#20c073',429 'amethyst': '#9b5fc0',430 'blue/green': '#0f9b8e',431 'chestnut': '#742802',432 'sick green': '#9db92c',433 'pea': '#a4bf20',434 'rusty orange': '#cd5909',435 'stone': '#ada587',436 'rose red': '#be013c',437 'pale aqua': '#b8ffeb',438 'deep orange': '#dc4d01',439 'earth': '#a2653e',440 'mossy green': '#638b27',441 'grassy green': '#419c03',442 'pale lime green': '#b1ff65',443 'light grey blue': '#9dbcd4',444 'pale grey': '#fdfdfe',445 'asparagus': '#77ab56',446 'blueberry': '#464196',447 'purple red': '#990147',448 'pale lime': '#befd73',449 'greenish teal': '#32bf84',450 'caramel': '#af6f09',451 'deep magenta': '#a0025c',452 'light peach': '#ffd8b1',453 'milk chocolate': '#7f4e1e',454 'ocher': '#bf9b0c',455 'off green': '#6ba353',456 'purply pink': '#f075e6',457 'lightblue': '#7bc8f6',458 'dusky blue': '#475f94',459 'golden': '#f5bf03',460 'light beige': '#fffeb6',461 'butter yellow': '#fffd74',462 'dusky purple': '#895b7b',463 'french blue': '#436bad',464 'ugly yellow': '#d0c101',465 'greeny yellow': '#c6f808',466 'orangish red': '#f43605',467 'shamrock green': '#02c14d',468 'orangish brown': '#b25f03',469 'tree green': '#2a7e19',470 'deep violet': '#490648',471 'gunmetal': '#536267',472 'blue/purple': '#5a06ef',473 'cherry': '#cf0234',474 'sandy brown': '#c4a661',475 'warm grey': '#978a84',476 'dark indigo': '#1f0954',477 'midnight': '#03012d',478 'bluey green': '#2bb179',479 'grey pink': '#c3909b',480 'soft purple': '#a66fb5',481 'blood': '#770001',482 'brown red': '#922b05',483 'medium grey': '#7d7f7c',484 'berry': '#990f4b',485 'poo': '#8f7303',486 'purpley pink': '#c83cb9',487 'light salmon': '#fea993',488 'snot': '#acbb0d',489 'easter purple': '#c071fe',490 'light yellow green': '#ccfd7f',491 'dark navy blue': '#00022e',492 'drab': '#828344',493 'light rose': '#ffc5cb',494 'rouge': '#ab1239',495 'purplish red': '#b0054b',496 'slime green': '#99cc04',497 'baby poop': '#937c00',498 'irish green': '#019529',499 'pink/purple': '#ef1de7',500 'dark navy': '#000435',501 'greeny blue': '#42b395',502 'light plum': '#9d5783',503 'pinkish grey': '#c8aca9',504 'dirty orange': '#c87606',505 'rust red': '#aa2704',506 'pale lilac': '#e4cbff',507 'orangey red': '#fa4224',508 'primary blue': '#0804f9',509 'kermit green': '#5cb200',510 'brownish purple': '#76424e',511 'murky green': '#6c7a0e',512 'wheat': '#fbdd7e',513 'very dark purple': '#2a0134',514 'bottle green': '#044a05',515 'watermelon': '#fd4659',516 'deep sky blue': '#0d75f8',517 'fire engine red': '#fe0002',518 'yellow ochre': '#cb9d06',519 'pumpkin orange': '#fb7d07',520 'pale olive': '#b9cc81',521 'light lilac': '#edc8ff',522 'lightish green': '#61e160',523 'carolina blue': '#8ab8fe',524 'mulberry': '#920a4e',525 'shocking pink': '#fe02a2',526 'auburn': '#9a3001',527 'bright lime green': '#65fe08',528 'celadon': '#befdb7',529 'pinkish brown': '#b17261',530 'poo brown': '#885f01',531 'bright sky blue': '#02ccfe',532 'celery': '#c1fd95',533 'dirt brown': '#836539',534 'strawberry': '#fb2943',535 'dark lime': '#84b701',536 'copper': '#b66325',537 'medium brown': '#7f5112',538 'muted green': '#5fa052',539 "robin's egg": '#6dedfd',540 'bright aqua': '#0bf9ea',541 'bright lavender': '#c760ff',542 'ivory': '#ffffcb',543 'very light purple': '#f6cefc',544 'light navy': '#155084',545 'pink red': '#f5054f',546 'olive brown': '#645403',547 'poop brown': '#7a5901',548 'mustard green': '#a8b504',549 'ocean green': '#3d9973',550 'very dark blue': '#000133',551 'dusty green': '#76a973',552 'light navy blue': '#2e5a88',553 'minty green': '#0bf77d',554 'adobe': '#bd6c48',555 'barney': '#ac1db8',556 'jade green': '#2baf6a',557 'bright light blue': '#26f7fd',558 'light lime': '#aefd6c',559 'dark khaki': '#9b8f55',560 'orange yellow': '#ffad01',561 'ocre': '#c69c04',562 'maize': '#f4d054',563 'faded pink': '#de9dac',564 'british racing green': '#05480d',565 'sandstone': '#c9ae74',566 'mud brown': '#60460f',567 'light sea green': '#98f6b0',568 'robin egg blue': '#8af1fe',569 'aqua marine': '#2ee8bb',570 'dark sea green': '#11875d',571 'soft pink': '#fdb0c0',572 'orangey brown': '#b16002',573 'cherry red': '#f7022a',574 'burnt yellow': '#d5ab09',575 'brownish grey': '#86775f',576 'camel': '#c69f59',577 'purplish grey': '#7a687f',578 'marine': '#042e60',579 'greyish pink': '#c88d94',580 'pale turquoise': '#a5fbd5',581 'pastel yellow': '#fffe71',582 'bluey purple': '#6241c7',583 'canary yellow': '#fffe40',584 'faded red': '#d3494e',585 'sepia': '#985e2b',586 'coffee': '#a6814c',587 'bright magenta': '#ff08e8',588 'mocha': '#9d7651',589 'ecru': '#feffca',590 'purpleish': '#98568d',591 'cranberry': '#9e003a',592 'darkish green': '#287c37',593 'brown orange': '#b96902',594 'dusky rose': '#ba6873',595 'melon': '#ff7855',596 'sickly green': '#94b21c',597 'silver': '#c5c9c7',598 'purply blue': '#661aee',599 'purpleish blue': '#6140ef',600 'hospital green': '#9be5aa',601 'shit brown': '#7b5804',602 'mid blue': '#276ab3',603 'amber': '#feb308',604 'easter green': '#8cfd7e',605 'soft blue': '#6488ea',606 'cerulean blue': '#056eee',607 'golden brown': '#b27a01',608 'bright turquoise': '#0ffef9',609 'red pink': '#fa2a55',610 'red purple': '#820747',611 'greyish brown': '#7a6a4f',612 'vermillion': '#f4320c',613 'russet': '#a13905',614 'steel grey': '#6f828a',615 'lighter purple': '#a55af4',616 'bright violet': '#ad0afd',617 'prussian blue': '#004577',618 'slate green': '#658d6d',619 'dirty pink': '#ca7b80',620 'dark blue green': '#005249',621 'pine': '#2b5d34',622 'yellowy green': '#bff128',623 'dark gold': '#b59410',624 'bluish': '#2976bb',625 'darkish blue': '#014182',626 'dull red': '#bb3f3f',627 'pinky red': '#fc2647',628 'bronze': '#a87900',629 'pale teal': '#82cbb2',630 'military green': '#667c3e',631 'barbie pink': '#fe46a5',632 'bubblegum pink': '#fe83cc',633 'pea soup green': '#94a617',634 'dark mustard': '#a88905',635 'shit': '#7f5f00',636 'medium purple': '#9e43a2',637 'very dark green': '#062e03',638 'dirt': '#8a6e45',639 'dusky pink': '#cc7a8b',640 'red violet': '#9e0168',641 'lemon yellow': '#fdff38',642 'pistachio': '#c0fa8b',643 'dull yellow': '#eedc5b',644 'dark lime green': '#7ebd01',645 'denim blue': '#3b5b92',646 'teal blue': '#01889f',647 'lightish blue': '#3d7afd',648 'purpley blue': '#5f34e7',649 'light indigo': '#6d5acf',650 'swamp green': '#748500',651 'brown green': '#706c11',652 'dark maroon': '#3c0008',653 'hot purple': '#cb00f5',654 'dark forest green': '#002d04',655 'faded blue': '#658cbb',656 'drab green': '#749551',657 'light lime green': '#b9ff66',658 'snot green': '#9dc100',659 'yellowish': '#faee66',660 'light blue green': '#7efbb3',661 'bordeaux': '#7b002c',662 'light mauve': '#c292a1',663 'ocean': '#017b92',664 'marigold': '#fcc006',665 'muddy green': '#657432',666 'dull orange': '#d8863b',667 'steel': '#738595',668 'electric purple': '#aa23ff',669 'fluorescent green': '#08ff08',670 'yellowish brown': '#9b7a01',671 'blush': '#f29e8e',672 'soft green': '#6fc276',673 'bright orange': '#ff5b00',674 'lemon': '#fdff52',675 'purple grey': '#866f85',676 'acid green': '#8ffe09',677 'pale lavender': '#eecffe',678 'violet blue': '#510ac9',679 'light forest green': '#4f9153',680 'burnt red': '#9f2305',681 'khaki green': '#728639',682 'cerise': '#de0c62',683 'faded purple': '#916e99',684 'apricot': '#ffb16d',685 'dark olive green': '#3c4d03',686 'grey brown': '#7f7053',687 'green grey': '#77926f',688 'true blue': '#010fcc',689 'pale violet': '#ceaefa',690 'periwinkle blue': '#8f99fb',691 'light sky blue': '#c6fcff',692 'blurple': '#5539cc',693 'green brown': '#544e03',694 'bluegreen': '#017a79',695 'bright teal': '#01f9c6',696 'brownish yellow': '#c9b003',697 'pea soup': '#929901',698 'forest': '#0b5509',699 'barney purple': '#a00498',700 'ultramarine': '#2000b1',701 'purplish': '#94568c',702 'puke yellow': '#c2be0e',703 'bluish grey': '#748b97',704 'dark periwinkle': '#665fd1',705 'dark lilac': '#9c6da5',706 'reddish': '#c44240',707 'light maroon': '#a24857',708 'dusty purple': '#825f87',709 'terra cotta': '#c9643b',710 'avocado': '#90b134',711 'marine blue': '#01386a',712 'teal green': '#25a36f',713 'slate grey': '#59656d',714 'lighter green': '#75fd63',715 'electric green': '#21fc0d',716 'dusty blue': '#5a86ad',717 'golden yellow': '#fec615',718 'bright yellow': '#fffd01',719 'light lavender': '#dfc5fe',720 'umber': '#b26400',721 'poop': '#7f5e00',722 'dark peach': '#de7e5d',723 'jungle green': '#048243',724 'eggshell': '#ffffd4',725 'denim': '#3b638c',726 'yellow brown': '#b79400',727 'dull purple': '#84597e',728 'chocolate brown': '#411900',729 'wine red': '#7b0323',730 'neon blue': '#04d9ff',731 'dirty green': '#667e2c',732 'light tan': '#fbeeac',733 'ice blue': '#d7fffe',734 'cadet blue': '#4e7496',735 'dark mauve': '#874c62',736 'very light blue': '#d5ffff',737 'grey purple': '#826d8c',738 'pastel pink': '#ffbacd',739 'very light green': '#d1ffbd',740 'dark sky blue': '#448ee4',741 'evergreen': '#05472a',742 'dull pink': '#d5869d',743 'aubergine': '#3d0734',744 'mahogany': '#4a0100',745 'reddish orange': '#f8481c',746 'deep green': '#02590f',747 'vomit green': '#89a203',748 'purple pink': '#e03fd8',749 'dusty pink': '#d58a94',750 'faded green': '#7bb274',751 'camo green': '#526525',752 'pinky purple': '#c94cbe',753 'pink purple': '#db4bda',754 'brownish red': '#9e3623',755 'dark rose': '#b5485d',756 'mud': '#735c12',757 'brownish': '#9c6d57',758 'emerald green': '#028f1e',759 'pale brown': '#b1916e',760 'dull blue': '#49759c',761 'burnt umber': '#a0450e',762 'medium green': '#39ad48',763 'clay': '#b66a50',764 'light aqua': '#8cffdb',765 'light olive green': '#a4be5c',766 'brownish orange': '#cb7723',767 'dark aqua': '#05696b',768 'purplish pink': '#ce5dae',769 'dark salmon': '#c85a53',770 'greenish grey': '#96ae8d',771 'jade': '#1fa774',772 'ugly green': '#7a9703',773 'dark beige': '#ac9362',774 'emerald': '#01a049',775 'pale red': '#d9544d',776 'light magenta': '#fa5ff7',777 'sky': '#82cafc',778 'light cyan': '#acfffc',779 'yellow orange': '#fcb001',780 'reddish purple': '#910951',781 'reddish pink': '#fe2c54',782 'orchid': '#c875c4',783 'dirty yellow': '#cdc50a',784 'orange red': '#fd411e',785 'deep red': '#9a0200',786 'orange brown': '#be6400',787 'cobalt blue': '#030aa7',788 'neon pink': '#fe019a',789 'rose pink': '#f7879a',790 'greyish purple': '#887191',791 'raspberry': '#b00149',792 'aqua green': '#12e193',793 'salmon pink': '#fe7b7c',794 'tangerine': '#ff9408',795 'brownish green': '#6a6e09',796 'red brown': '#8b2e16',797 'greenish brown': '#696112',798 'pumpkin': '#e17701',799 'pine green': '#0a481e',800 'charcoal': '#343837',801 'baby pink': '#ffb7ce',802 'cornflower': '#6a79f7',803 'blue violet': '#5d06e9',804 'chocolate': '#3d1c02',805 'greyish green': '#82a67d',806 'scarlet': '#be0119',807 'green yellow': '#c9ff27',808 'dark olive': '#373e02',809 'sienna': '#a9561e',810 'pastel purple': '#caa0ff',811 'terracotta': '#ca6641',812 'aqua blue': '#02d8e9',813 'sage green': '#88b378',814 'blood red': '#980002',815 'deep pink': '#cb0162',816 'grass': '#5cac2d',817 'moss': '#769958',818 'pastel blue': '#a2bffe',819 'bluish green': '#10a674',820 'green blue': '#06b48b',821 'dark tan': '#af884a',822 'greenish blue': '#0b8b87',823 'pale orange': '#ffa756',824 'vomit': '#a2a415',825 'forrest green': '#154406',826 'dark lavender': '#856798',827 'dark violet': '#34013f',828 'purple blue': '#632de9',829 'dark cyan': '#0a888a',830 'olive drab': '#6f7632',831 'pinkish': '#d46a7e',832 'cobalt': '#1e488f',833 'neon purple': '#bc13fe',834 'light turquoise': '#7ef4cc',835 'apple green': '#76cd26',836 'dull green': '#74a662',837 'wine': '#80013f',838 'powder blue': '#b1d1fc',839 'off white': '#ffffe4',840 'electric blue': '#0652ff',841 'dark turquoise': '#045c5a',842 'blue purple': '#5729ce',843 'azure': '#069af3',844 'bright red': '#ff000d',845 'pinkish red': '#f10c45',846 'cornflower blue': '#5170d7',847 'light olive': '#acbf69',848 'grape': '#6c3461',849 'greyish blue': '#5e819d',850 'purplish blue': '#601ef9',851 'yellowish green': '#b0dd16',852 'greenish yellow': '#cdfd02',853 'medium blue': '#2c6fbb',854 'dusty rose': '#c0737a',855 'light violet': '#d6b4fc',856 'midnight blue': '#020035',857 'bluish purple': '#703be7',858 'red orange': '#fd3c06',859 'dark magenta': '#960056',860 'greenish': '#40a368',861 'ocean blue': '#03719c',862 'coral': '#fc5a50',863 'cream': '#ffffc2',864 'reddish brown': '#7f2b0a',865 'burnt sienna': '#b04e0f',866 'brick': '#a03623',867 'sage': '#87ae73',868 'grey green': '#789b73',869 'white': '#ffffff',870 "robin's egg blue": '#98eff9',871 'moss green': '#658b38',872 'steel blue': '#5a7d9a',873 'eggplant': '#380835',874 'light yellow': '#fffe7a',875 'leaf green': '#5ca904',876 'light grey': '#d8dcd6',877 'puke': '#a5a502',878 'pinkish purple': '#d648d7',879 'sea blue': '#047495',880 'pale purple': '#b790d4',881 'slate blue': '#5b7c99',882 'blue grey': '#607c8e',883 'hunter green': '#0b4008',884 'fuchsia': '#ed0dd9',885 'crimson': '#8c000f',886 'pale yellow': '#ffff84',887 'ochre': '#bf9005',888 'mustard yellow': '#d2bd0a',889 'light red': '#ff474c',890 'cerulean': '#0485d1',891 'pale pink': '#ffcfdc',892 'deep blue': '#040273',893 'rust': '#a83c09',894 'light teal': '#90e4c1',895 'slate': '#516572',896 'goldenrod': '#fac205',897 'dark yellow': '#d5b60a',898 'dark grey': '#363737',899 'army green': '#4b5d16',900 'grey blue': '#6b8ba4',901 'seafoam': '#80f9ad',902 'puce': '#a57e52',903 'spring green': '#a9f971',904 'dark orange': '#c65102',905 'sand': '#e2ca76',906 'pastel green': '#b0ff9d',907 'mint': '#9ffeb0',908 'light orange': '#fdaa48',909 'bright pink': '#fe01b1',910 'chartreuse': '#c1f80a',911 'deep purple': '#36013f',912 'dark brown': '#341c02',913 'taupe': '#b9a281',914 'pea green': '#8eab12',915 'puke green': '#9aae07',916 'kelly green': '#02ab2e',917 'seafoam green': '#7af9ab',918 'blue green': '#137e6d',919 'khaki': '#aaa662',920 'burgundy': '#610023',921 'dark teal': '#014d4e',922 'brick red': '#8f1402',923 'royal purple': '#4b006e',924 'plum': '#580f41',925 'mint green': '#8fff9f',926 'gold': '#dbb40c',927 'baby blue': '#a2cffe',928 'yellow green': '#c0fb2d',929 'bright purple': '#be03fd',930 'dark red': '#840000',931 'pale blue': '#d0fefe',932 'grass green': '#3f9b0b',933 'navy': '#01153e',934 'aquamarine': '#04d8b2',935 'burnt orange': '#c04e01',936 'neon green': '#0cff0c',937 'bright blue': '#0165fc',938 'rose': '#cf6275',939 'light pink': '#ffd1df',940 'mustard': '#ceb301',941 'indigo': '#380282',942 'lime': '#aaff32',943 'sea green': '#53fca1',944 'periwinkle': '#8e82fe',945 'dark pink': '#cb416b',946 'olive green': '#677a04',947 'peach': '#ffb07c',948 'pale green': '#c7fdb5',949 'light brown': '#ad8150',950 'hot pink': '#ff028d',951 'black': '#000000',952 'lilac': '#cea2fd',953 'navy blue': '#001146',954 'royal blue': '#0504aa',955 'beige': '#e6daa6',956 'salmon': '#ff796c',957 'olive': '#6e750e',958 'maroon': '#650021',959 'bright green': '#01ff07',960 'dark purple': '#35063e',961 'mauve': '#ae7181',962 'forest green': '#06470c',963 'aqua': '#13eac9',964 'cyan': '#00ffff',965 'tan': '#d1b26f',966 'dark blue': '#00035b',967 'lavender': '#c79fef',968 'turquoise': '#06c2ac',969 'dark green': '#033500',970 'violet': '#9a0eea',971 'light purple': '#bf77f6',972 'lime green': '#89fe05',973 'grey': '#929591',974 'sky blue': '#75bbfd',975 'yellow': '#ffff14',976 'magenta': '#c20078',977 'light green': '#96f97b',978 'orange': '#f97306',979 'teal': '#029386',980 'light blue': '#95d0fc',981 'red': '#e50000',982 'brown': '#653700',983 'pink': '#ff81c0',984 'blue': '#0343df',985 'green': '#15b01a',986 'purple': '#7e1e9c'}987# Normalize name to "xkcd:<name>" to avoid name collisions.988XKCD_COLORS = {'xkcd:' + name: value for name, value in XKCD_COLORS.items()}989# https://drafts.csswg.org/css-color-4/#named-colors990CSS4_COLORS = {991 'aliceblue': '#F0F8FF',992 'antiquewhite': '#FAEBD7',993 'aqua': '#00FFFF',994 'aquamarine': '#7FFFD4',995 'azure': '#F0FFFF',996 'beige': '#F5F5DC',997 'bisque': '#FFE4C4',998 'black': '#000000',999 'blanchedalmond': '#FFEBCD',1000 'blue': '#0000FF',1001 'blueviolet': '#8A2BE2',1002 'brown': '#A52A2A',1003 'burlywood': '#DEB887',1004 'cadetblue': '#5F9EA0',1005 'chartreuse': '#7FFF00',1006 'chocolate': '#D2691E',1007 'coral': '#FF7F50',1008 'cornflowerblue': '#6495ED',1009 'cornsilk': '#FFF8DC',1010 'crimson': '#DC143C',1011 'cyan': '#00FFFF',1012 'darkblue': '#00008B',1013 'darkcyan': '#008B8B',1014 'darkgoldenrod': '#B8860B',1015 'darkgray': '#A9A9A9',1016 'darkgreen': '#006400',1017 'darkgrey': '#A9A9A9',1018 'darkkhaki': '#BDB76B',1019 'darkmagenta': '#8B008B',1020 'darkolivegreen': '#556B2F',1021 'darkorange': '#FF8C00',1022 'darkorchid': '#9932CC',1023 'darkred': '#8B0000',1024 'darksalmon': '#E9967A',1025 'darkseagreen': '#8FBC8F',1026 'darkslateblue': '#483D8B',1027 'darkslategray': '#2F4F4F',1028 'darkslategrey': '#2F4F4F',1029 'darkturquoise': '#00CED1',1030 'darkviolet': '#9400D3',1031 'deeppink': '#FF1493',1032 'deepskyblue': '#00BFFF',1033 'dimgray': '#696969',1034 'dimgrey': '#696969',1035 'dodgerblue': '#1E90FF',1036 'firebrick': '#B22222',1037 'floralwhite': '#FFFAF0',1038 'forestgreen': '#228B22',1039 'fuchsia': '#FF00FF',1040 'gainsboro': '#DCDCDC',1041 'ghostwhite': '#F8F8FF',1042 'gold': '#FFD700',1043 'goldenrod': '#DAA520',1044 'gray': '#808080',1045 'green': '#008000',1046 'greenyellow': '#ADFF2F',1047 'grey': '#808080',1048 'honeydew': '#F0FFF0',1049 'hotpink': '#FF69B4',1050 'indianred': '#CD5C5C',1051 'indigo': '#4B0082',1052 'ivory': '#FFFFF0',1053 'khaki': '#F0E68C',1054 'lavender': '#E6E6FA',1055 'lavenderblush': '#FFF0F5',1056 'lawngreen': '#7CFC00',1057 'lemonchiffon': '#FFFACD',1058 'lightblue': '#ADD8E6',1059 'lightcoral': '#F08080',1060 'lightcyan': '#E0FFFF',1061 'lightgoldenrodyellow': '#FAFAD2',1062 'lightgray': '#D3D3D3',1063 'lightgreen': '#90EE90',1064 'lightgrey': '#D3D3D3',1065 'lightpink': '#FFB6C1',1066 'lightsalmon': '#FFA07A',1067 'lightseagreen': '#20B2AA',1068 'lightskyblue': '#87CEFA',1069 'lightslategray': '#778899',1070 'lightslategrey': '#778899',1071 'lightsteelblue': '#B0C4DE',1072 'lightyellow': '#FFFFE0',1073 'lime': '#00FF00',1074 'limegreen': '#32CD32',1075 'linen': '#FAF0E6',1076 'magenta': '#FF00FF',1077 'maroon': '#800000',1078 'mediumaquamarine': '#66CDAA',1079 'mediumblue': '#0000CD',1080 'mediumorchid': '#BA55D3',1081 'mediumpurple': '#9370DB',1082 'mediumseagreen': '#3CB371',1083 'mediumslateblue': '#7B68EE',1084 'mediumspringgreen': '#00FA9A',1085 'mediumturquoise': '#48D1CC',1086 'mediumvioletred': '#C71585',1087 'midnightblue': '#191970',1088 'mintcream': '#F5FFFA',1089 'mistyrose': '#FFE4E1',1090 'moccasin': '#FFE4B5',1091 'navajowhite': '#FFDEAD',1092 'navy': '#000080',1093 'oldlace': '#FDF5E6',1094 'olive': '#808000',1095 'olivedrab': '#6B8E23',1096 'orange': '#FFA500',1097 'orangered': '#FF4500',1098 'orchid': '#DA70D6',1099 'palegoldenrod': '#EEE8AA',1100 'palegreen': '#98FB98',1101 'paleturquoise': '#AFEEEE',1102 'palevioletred': '#DB7093',1103 'papayawhip': '#FFEFD5',1104 'peachpuff': '#FFDAB9',1105 'peru': '#CD853F',1106 'pink': '#FFC0CB',1107 'plum': '#DDA0DD',1108 'powderblue': '#B0E0E6',1109 'purple': '#800080',1110 'rebeccapurple': '#663399',1111 'red': '#FF0000',1112 'rosybrown': '#BC8F8F',1113 'royalblue': '#4169E1',1114 'saddlebrown': '#8B4513',1115 'salmon': '#FA8072',1116 'sandybrown': '#F4A460',1117 'seagreen': '#2E8B57',1118 'seashell': '#FFF5EE',1119 'sienna': '#A0522D',1120 'silver': '#C0C0C0',1121 'skyblue': '#87CEEB',1122 'slateblue': '#6A5ACD',1123 'slategray': '#708090',1124 'slategrey': '#708090',1125 'snow': '#FFFAFA',1126 'springgreen': '#00FF7F',1127 'steelblue': '#4682B4',1128 'tan': '#D2B48C',1129 'teal': '#008080',1130 'thistle': '#D8BFD8',1131 'tomato': '#FF6347',1132 'turquoise': '#40E0D0',1133 'violet': '#EE82EE',1134 'wheat': '#F5DEB3',1135 'white': '#FFFFFF',1136 'whitesmoke': '#F5F5F5',1137 'yellow': '#FFFF00',...

Full Screen

Full Screen

Auto blues and key dimensions.py

Source:Auto blues and key dimensions.py Github

copy

Full Screen

1"""2This script calculates blue values and key dimensions based on existing glyphs in font.3Note that this script will change any existing values which you have set manually.4Any blue values which cannot be determined from existing glyphs take the value calaculated for the baseline overshoot.5If the baseline overshoot cannot be determined, a default value is used (defined on line 87).6"""7f = CurrentFont()8## Find the extreme points in a glyph (min or max):9def ExtremeGlyph(top_bottom, glyph):10 y_list = []11 g = f[glyph]12 13 for c in g:14 for p in c.points:15 y_list.append(p.y)16 if top_bottom == 'bottom':17 return min(y_list)18 if top_bottom == 'top':19 return max(y_list)20 21 22## Check if in font then find extremes:23def ExtremePoint(min_max, top_bottom, List):24 InFont = []25 for glif in List:26 if glif in f and len(f[glif]) > 0:27 InFont.append(glif)28 X_Vals = []29 if len(InFont) > 0:30 if min_max == 'Min':31 for h in InFont:32 i = ExtremeGlyph(top_bottom, h)33 X_Vals.append(i)34 x = int(min(X_Vals))35 BluePair['min'] = x36 if min_max == 'Max':37 for h in InFont:38 i = ExtremeGlyph(top_bottom, h)39 X_Vals.append(i)40 x = int(max(X_Vals))41 BluePair['max'] = x42## Check pair for missing values, estimate them and add pair to Blue List:43def AddPair(pair_list):44 if len(BluePair) < 1:45 print 'Unable to determine blue values for ' + Name46 else: 47 if 'min' not in BluePair:48 print 'Estimating value for ' + Name + '_min'49 BluePair['min'] = BluePair['max'] - overshoot50 if 'max' not in BluePair:51 print 'Estimating value for ' + Name + '_max'52 BluePair['max'] = BluePair['min'] + overshoot53 54 pair_list.append(BluePair['min'])55 pair_list.append(BluePair['max'])56 57 BlueSize = abs(BluePair['max'] - BluePair['min'])58 ZoneSizes.append(BlueSize)59 print 'Overshoot at ' + Name + ' is ' + str(BlueSize)60################################################61## If possible, determine value for default overshoot:62BluePair = {}63B_Base_min = ['C','G','O','S','c','e','o','s']64ExtremePoint('Min', 'bottom', B_Base_min)65if len(BluePair) > 0:66 overshoot = abs(int(BluePair['min']))67 print '================================================================='68 print 'Default value for overshoot (=' + str(overshoot) + ') determined by existing glyphs'69 print '================================================================='70else:71 overshoot = 1072 print '================================================================='73 print 'Default value for overshoot (=' + str(overshoot) + ') determined by manual value (line 79)'74 print '================================================================='75 76################################################77BlueVals = []78OtherBlueVals = []79ZoneSizes = []80################################################81## Determine pair of blue values for Descenders:82BluePair = {}83Name = 'Descenders'84B_Desc_min = ['g','j','y']85ExtremePoint('Min', 'bottom', B_Desc_min)86B_Desc_max = ['p','q']87ExtremePoint('Max', 'bottom', B_Desc_max)88AddPair(OtherBlueVals)89################################################90## Determine pair of blue values for Baseline:91BluePair = {}92Name = 'Baseline'93B_Base_min = ['C','G','O','S','c','e','o','s']94ExtremePoint('Min', 'bottom', B_Base_min)95BluePair['max'] = 096AddPair(BlueVals)97################################################98## Determine pair of blue values for x-height:99BluePair = {}100Name = 'x-height'101B_x_min = ['v','w','x','y','z']102ExtremePoint('Min', 'top', B_x_min)103B_x_max = ['a','c','e','n','o','s']104ExtremePoint('Max', 'top', B_x_max)105AddPair(BlueVals)106if 'min' in BluePair:107 xh = BluePair['min']108else:109 xh = 0110################################################111## Determine pair of blue values for Cap-height:112BluePair = {}113Name = 'Cap-height'114B_Cap_min = ['E','F','H','I','J','K','L','T','U','V','X','Y','Z']115ExtremePoint('Min', 'top', B_Cap_min)116B_Cap_max = ['A','C','G','M','O','Q','S']117ExtremePoint('Max', 'top', B_Cap_max)118AddPair(BlueVals)119if 'min' in BluePair:120 Caph = BluePair['min']121else:122 Caph = 0123 124################################################125## Determine pair of blue values for Ascenders:126BluePair = {}127Name = 'Ascenders'128B_Asc_min = ['b','d','h','k','l']129ExtremePoint('Min', 'top', B_Asc_min)130B_Asc_max = ['f']131ExtremePoint('Max', 'top', B_Asc_max)132AddPair(BlueVals)133## Deal with potential zero value:134if BlueVals[-1] - BlueVals[-2] < 1:135 BlueVals[-2] = BlueVals[-1] - overshoot136 print '================================================================='137 print 'Check Ascender overshoot. Zero value adjusted to default.'138 print '================================================================='139################################################140## Set Blue Values in font:141f.prepareUndo('Set Blue Values')142f.info.postscriptBlueValues = BlueVals143f.info.postscriptOtherBlues = OtherBlueVals144print '================================================================='145print 'Blue Values set in font: ' + str(BlueVals)146print 'Other Blue Values set in font: ' + str(OtherBlueVals)147print '================================================================='148f.info.postscriptBlueFuzz = 0 # Recommended value149print 'Set BlueFuzz value to 0 (recommended value)'150#f.info.postscriptBlueShift = 7151print 'BlueShift left as default value'152## Calculate BlueScale:153MaxZoneSize = max(ZoneSizes)154f.info.postscriptBlueScale = 3/float(4 * MaxZoneSize)155print 'Calculated BlueScale value: ' + str(f.info.postscriptBlueScale)156print '================================================================='157################################################158## Set Key Dimensions in font:159print 'KEY DIMENSIONS:'160if xh > 0:161 f.info.xHeight = xh162 print 'x-height set to ' + str(xh)163if Caph > 0:164 f.info.capHeight = Caph165 print 'Cap-height set to ' + str(Caph)166## Determine Asc/Desc values and round to nearest 10:167if f.info.unitsPerEm == 1000:168 if len(OtherBlueVals) > 0:169 Gap = float(1000 - (BlueVals[-1] - OtherBlueVals[0]))/10170 if Gap > 0:171 Asch = 10 * int((round((BlueVals[-1]/10)+(Gap/2))))172 Desch = Asch - 1000173 f.info.ascender = Asch174 print 'Ascender set to ' + str(Asch)175 f.info.descender = Desch176 print 'Descender set to ' + str(Desch)177 print '================================================================='178 else:179 print '================================================================='180 print 'Ascender and Descender exceed 1000 units. Check dimensions.'181 print '================================================================='182 else:183 print '================================================================='184 print 'Unable to calculate key Descender value.\nSetting based on Ascender or Cap-height value.'185 print '================================================================='186 Gap = 1000 - BlueVals[-1]187 f.info.ascender = BlueVals[-1] + (Gap/2)188 f.info.descender = f.info.ascender - 1000 189else:190 print '================================================================='191 print 'Font is not 1000 units per Em.\nPlease calculate Ascender and Descender values manually.'192 print '================================================================='193f.performUndo()...

Full Screen

Full Screen

blur.py

Source:blur.py Github

copy

Full Screen

1"""2File: blur.py3Name:4-------------------------------5This file shows the original image first,6smiley-face.png, and then compare to its7blurred image. The blur algorithm uses the8average RGB values of a pixel's nearest neighbors.9"""10from simpleimage import SimpleImage11BLUR_INDEX = 512def main():13 """14 TODO: put in a picture and show the blurred version of it15 """16 old_img = SimpleImage("images/smiley-face.png")17 old_img.show()18 blurred_img = blur(old_img)19 for i in range(BLUR_INDEX):20 blurred_img = blur(blurred_img)21 blurred_img.show()22def blur(img):23 """24 :param img: An image to be blurred25 :return: a blurred image26 """27 new_img = SimpleImage.blank(img.width, img.height)28 for x in range(img.width):29 for y in range(img.height):30 pixel = new_img.get_pixel(x, y)31 sum_red = 032 sum_blue = 033 sum_green = 034 if x == 0:35 if y == 0:36 for i in range(0, 2):37 for j in range(0, 2):38 neighbor = img.get_pixel(x + i, y + j)39 sum_red += neighbor.red40 sum_blue += neighbor.blue41 sum_green += neighbor.green42 pixel.red = sum_red / 443 pixel.blue = sum_blue / 444 pixel.green = sum_green / 445 elif y == img.height-1:46 for i in range(0, 2):47 for j in range(-1, 1):48 neighbor = img.get_pixel(x + i, y + j)49 sum_red += neighbor.red50 sum_blue += neighbor.blue51 sum_green += neighbor.green52 pixel.red = sum_red / 453 pixel.blue = sum_blue / 454 pixel.green = sum_green / 455 else:56 for i in range(0, 2):57 for j in range(-1, 2):58 neighbor = img.get_pixel(x + i, y + j)59 sum_red += neighbor.red60 sum_blue += neighbor.blue61 sum_green += neighbor.green62 pixel.red = sum_red / 663 pixel.blue = sum_blue / 664 pixel.green = sum_green / 665 elif y == 0:66 if x == img.width-1:67 for i in range(-1, 1):68 for j in range(0, 2):69 neighbor = img.get_pixel(x + i, y + j)70 sum_red += neighbor.red71 sum_blue += neighbor.blue72 sum_green += neighbor.green73 pixel.red = sum_red / 474 pixel.blue = sum_blue / 475 pixel.green = sum_green / 476 else:77 for i in range(-1, 2):78 for j in range(0, 2):79 neighbor = img.get_pixel(x + i, y + j)80 sum_red += neighbor.red81 sum_blue += neighbor.blue82 sum_green += neighbor.green83 pixel.red = sum_red / 684 pixel.blue = sum_blue / 685 pixel.green = sum_green / 686 elif x == img.width-1:87 if y == img.height-1:88 for i in range(-1, 1):89 for j in range(-1, 1):90 neighbor = img.get_pixel(x + i, y + j)91 sum_red += neighbor.red92 sum_blue += neighbor.blue93 sum_green += neighbor.green94 pixel.red = sum_red / 495 pixel.blue = sum_blue / 496 pixel.green = sum_green / 497 else:98 for i in range(-1, 1):99 for j in range(-1, 2):100 neighbor = img.get_pixel(x + i, y + j)101 sum_red += neighbor.red102 sum_blue += neighbor.blue103 sum_green += neighbor.green104 pixel.red = sum_red / 6105 pixel.blue = sum_blue / 6106 pixel.green = sum_green / 6107 elif y == img.height-1:108 for i in range(-1, 2):109 for j in range(-1, 1):110 neighbor = img.get_pixel(x + i, y + j)111 sum_red += neighbor.red112 sum_blue += neighbor.blue113 sum_green += neighbor.green114 pixel.red = sum_red / 6115 pixel.blue = sum_blue / 6116 pixel.green = sum_green / 6117 else:118 for i in range(-1, 2):119 for j in range(-1, 2):120 neighbor = img.get_pixel(x+i, y+j)121 sum_red += neighbor.red122 sum_blue += neighbor.blue123 sum_green += neighbor.green124 pixel.red = sum_red/9125 pixel.blue = sum_blue/9126 pixel.green = sum_green/9127 return new_img128# ---- DO NOT EDIT CODE BELOW THIS LINE ---- #129if __name__ == '__main__':...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run green automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful