// HW10 // Put the required comments below: // Jennifer Shin // Section D // jshin1@andrew.cmu.edu // Copyright © Jennifer Shin April 2011 Pittsburgh, PA 15221 All Rights Reserved // // /*************************** Travel through NYC from 42nd Street (Times Square) to Canal Street on the N subway line.
The N train travels on Broadway Ave in the Manhattan borough and on 31st Street in the Queens borough.
To head Downtown, press the down arrow key.
And to head Uptown and Queens, press the up arrow key.
Each time you travel, you will be notified that the station has changed.
You can even see the station leave while on the subway train!
After you leave the subway station, there are two places you can go visit.
The bottom left box will always have info on an eatery, since eating is extremely important.
The bottom right box will have interesting places to go. Let's mix things up!
Hover over the two locations and see what happens!
**********************************/ PImage p1,pA,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17, p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29,p30,p31,p32,p33,p34, p35,p36,p37,p38,p39; PFont font,font2; import ddf.minim.*; Minim m; AudioPlayer s1; String [ ] stations = {"Astoria-Ditmars","Astoria Boulevard","30 Avenue", "Broadway","36 Avenue","39 Avenue","Queensboro Plaza","Lexington Avenue", "5 Avenue","57 Street","49 Street","42 Street","34 Street","28 Street", "23 Street","14 Street","8 Street","Prince Street","Canal Street"}; String [ ] names = {"Martha's Country Bakery","Taverna Kyclades", "Petey's Burger","Rapture Lounge","Vesta Trattoria & Wine Bar", "Fayrooz Cafe Hookah Lounge","King of Falafel & Shawarma", "Omonia Cafe Lounge","Arepas Cafe","Museum of the Moving Image", "Zante Restaurant","Museum for African Art","Court Square Diner", "MoMA PS1","Dylan's Candy Bar","Wollman Ice Skating Rink", "Rouge Tomate","Bergdorf Goodman","Per Se","Carnegie Hall", "Trattoria Trecolori","Nintendo World Store","John's Pizzeria", "M&M World","Chipotle Mexican Grill","Empire State Building", "The Red Cat","Ace Hotel","Shake Shack","Hotel Giraffe", "Blue 9 Burger","Strand Book Store","Gyu-Kaku","Washington Square Park", "Dean & Deluca","Rice To Riches","Ten Ren's Tea Time","Columbus Park"}; String [ ] info3 = {"cozy bakery","classic Greek eatery","classic burger", "drinks and nightlife","typical Italian cuisine","hookah joint", "Greek outing","coffee & pastries","authentic Venezuelan dining","museum", "gyro & souvlaki","museum","all American diner","contemporary art institution", "ultimate candy store","ice skating rink","New American food", "department store","classic french cuisine","music hall","old school Italian", "game store","smart casual pizzeria","candy galore","Mexican fast food joint", "tourist attraction","smart casual restaurant","hotel","American fast food joint", "hotel","burger joint","books galore","Japanese BBQ","park filled with events", "massive grocery store","rice pudding experts","bubble tea masters", "great people-watching park"}; String [ ] info1 = {"36-21 Ditmars Blvd","33-07 Ditmars Blvd","30-17 30th Ave", "34-27 28th Ave","21-02 30th Ave","28-08 Steinway St","29-10 Broadway", "32-20 Broadway","33-07 36th Ave","36-01 35th Ave","38-38 31st St", "36-01 43rd Ave","45-30 23rd St","22-25 Jackson Ave","1011 3rd Ave", "830 5th Ave","10 E 60th St","754 5th Ave","10 Columbus Cir","881 7th Ave", "254 W 47th St","10 Rockefeller Plaza","260 W 44th St","1600 Broadway", "304 W 34th St","350 5th Ave","227 10th Ave","20 W 29th St","11 Madison Ave #1", "365 Park Ave South","92 3rd Ave","828 Broadway","34 Cooper Sq","1 5th Ave", "560 Broadway","37 Spring St","79 Mott St","67 Mulberry St"}; char [ ] info2 = {'5','2','4','4','6','9','2','2','3','7','1','5','9','9', '2','8','1','1','3','0','2','3','3','7','2','2','9','1','0','5','4','0', '3','3','0','5','6','6'}; String [ ] info4 = {"scrumptious classic cakes","Astoria has the best Greek food", "pretty much like Five Guys","sultry enough to meet men and women", "have some pasta with glass of wine","laid back atmosphere filled with young kids", "falafel sandwiches all day long","eat some baklava","eat everything in sight", "spinning head from The Exorcist-scary","all you can ask for", "modern take on African historical art","two words: blueberry pancakes", "better than the MoMA if you like exhibitions","get ready to go back to your childhood", "view Central Park AND fall on your butt!","healthy made delicious with a twist", "credit card time","Thomas Keller=god; food orgasm","watch or sleep to opera", "squid ink pasta...eat the veal","Pokemon dolls EVERYWHERE", "brick oven pizza that's to die for","beware: crazy flavors", "big food for big men","do not jump off","bacon tempura: enough said", "get comfortable","worth the long wait","no actual giraffes", "best burger sauce ever","interesting finds for $1", "discount specials every day","enjoy the sun and homeless men", "overpriced mediocre food","innovative rice pudding", "best bubble tea you will ever drink","play soccer and observe Asian festivals"}; int t, x; void setup ( ) { size (800, 500 ); m = new Minim(this); s1 = m.loadFile("a.mp3"); noStroke ( ); smooth ( ); p1 = loadImage ( "p1.jpg" ); pA = loadImage ( "pA.jpg" ); p2 = loadImage ( "p2.png" ); p3 = loadImage ( "p3.png" ); p4 = loadImage ( "p4.png" ); p5 = loadImage ( "p5.png" ); p6 = loadImage ( "p6.png" ); p7 = loadImage ( "p7.png" ); p8 = loadImage ( "p8.png" ); p9 = loadImage ( "p9.png" ); p10 = loadImage ( "p10.png" ); p11 = loadImage ( "p11.png" ); p12 = loadImage ( "p12.png" ); p13 = loadImage ( "p13.png" ); p14 = loadImage ( "p14.png" ); p15 = loadImage ( "p15.png" ); p16 = loadImage ( "p16.png" ); p17 = loadImage ( "p17.png" ); p18 = loadImage ( "p18.png" ); p19 = loadImage ( "p19.png" ); p20 = loadImage ( "p20.png" ); p21 = loadImage ( "p21.png" ); p22 = loadImage ( "p22.png" ); p23 = loadImage ( "p23.png" ); p24 = loadImage ( "p24.png" ); p25 = loadImage ( "p25.png" ); p26 = loadImage ( "p26.png" ); p27 = loadImage ( "p27.png" ); p28 = loadImage ( "p28.png" ); p29 = loadImage ( "p29.png" ); p30 = loadImage ( "p30.png" ); p31 = loadImage ( "p31.png" ); p32 = loadImage ( "p32.png" ); p33 = loadImage ( "p33.png" ); p34 = loadImage ( "p34.png" ); p35 = loadImage ( "p35.png" ); p36 = loadImage ( "p36.png" ); p37 = loadImage ( "p37.png" ); p38 = loadImage ( "p38.png" ); p39 = loadImage ( "p39.png" ); image ( p1, 0, 0, width, height ); font = loadFont ("f1.vlw"); font2 = loadFont ("font2.vlw"); fill ( #393535 ); rect ( .175*width, .23*height, .685*width, .14*height ); rect ( .185*width, .68*height, .67*width, .20*height); x = 0; t = 0; textFont ( font2, 64 ); fill ( 255 ); text ( stations[x], .19*width, .34*height); textFont (font, 54 ); text ( "Shindig's Guide to NYC", .16*width, .1*height ); textFont (font2,14); text ( names[t], .19*width, .71*height ); text ( info1[t], .19*width, .74*height ); text ( info2[t] + " blocks away", .19*width, .80*height ); text ( info3[t], .19*width, .77*height ); text ( info4[t], .19*width, .83*height ); text ( names[t+1], .52*width, .71*height ); text ( info1[t+1], .52*width, .74*height ); text ( info2[t+1] + " blocks away", .52*width, .80*height ); text ( info3[t+1], .52*width, .77*height ); text ( info4[t+1], .52*width, .83*height ); textFont (font2,22); text ( stations[0], .67*width, .55*height ); text ( "Queens", .67*width, .585*height ); text ( stations[stations.length-1], .67*width, .63*height ); text ( "Manhattan", .67*width, .665*height ); } void draw ( ) { mouseHover ( ); } void placesToGo ( ) { textFont ( font2, 14 ); fill ( #393535 ); rect ( .185*width, .68*height, .67*width, .20*height); fill (255); text ( names[t], .19*width, .71*height ); text ( info1[t], .19*width, .74*height ); text ( info2[t] + " blocks away", .19*width, .80*height ); text ( info3[t], .19*width, .77*height ); text ( info4[t], .19*width, .83*height ); text ( names[t+1], .52*width, .71*height ); text ( info1[t+1], .52*width, .74*height ); text ( info2[t+1] + " blocks away", .52*width, .80*height ); text ( info3[t+1], .52*width, .77*height ); text ( info4[t+1], .52*width, .83*height ); } void keyPressed ( ) { // if ( key == 'j') // { // saveFrame("HW10.jpg"); // } if ( key == CODED ) { if ( keyCode == DOWN ) { if ( x < stations.length && t < names.length-2 ) { t=t+2; placesToGo ( ); x++; fixInitials ( ); transfers ( ); s1.rewind ( ); s1.play ( ); s1.rewind ( ); } else { x = stations.length - 1; fixInitials ( ); } } else if ( keyCode == UP ) { if ( x > 0 && t > 0 ) { t=t-2; placesToGo ( ); x--; frameCount = 0; fixInitials ( ); transfers ( ); s1.rewind ( ); s1.play ( ); s1.rewind ( ); } else { x = 0; fixInitials ( ); } } } } void fixInitials ( ) { if ( x < stations.length && x >= 0 ) { fill ( #393535 ); rect ( .175*width, .23*height, .685*width, .14*height ); fill ( 255 ); textFont ( font2, 64 ); text ( stations[x], .19*width, .34*height); } } void transfers ( ) { image ( pA, 0, 0, width, height ); } void keyReleased ( ) { image ( p1, 0, 0, width, height ); textFont ( font2, 14 ); fixInitials ( ); placesToGo ( ); textFont (font, 54 ); text ( "Shindig's Guide to NYC", .16*width, .1*height ); } void mouseHover ( ) { if ( x == 0 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p2, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p3, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 1 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p4, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p5, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 2 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p6, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p7, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 3 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p8, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p9, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 4 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p10, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p11, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 5 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p12, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p13, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 6 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p14, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p15, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 7 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p16, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p17, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 8 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p18, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p19, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 9 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p20, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p21, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 10 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p22, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p23, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 11 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p24, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p25, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 12 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p26, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p27, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 13 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p28, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p29, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 14 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p30, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p31, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 15 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p32, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p33, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 16 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p34, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p35, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 17 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p36, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p37, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } if ( x == 18 ) { if ( mouseX < .52*width && mouseX > .19*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p38, .5*width, .5*height ); imageMode (CORNER); } else if ( mouseX < .85*width && mouseX > .52*width && mouseY < .83*height && mouseY > .68*height ) { keyReleased ( ); imageMode (CENTER); image ( p39, .5*width, .5*height ); imageMode (CORNER); } else { keyReleased ( ); } } } //http://www.marthascountrybakery.com/ //http://www.tavernakyclades.com/ //http://www.peteysburger.com/ //http://www.rapturelounge.com/HOME.html //http://www.vestavino.com/ //http://www.fayroozcafe.com/ //http://www.thekingfalafel.com/ //http://www.omoniacafe.com/ //http://www.arepascafe.com/arepas/home.php //http://www.movingimage.us/ //http://www.urbanspoon.com/r/3/43483/restaurant/New-York/Astoria/Zante-Restaurant-Queens //http://www.africanart.org/ //http://www.yelp.com/biz/court-square-diner-long-island-city //http://www.ps1.org/ //http://www.dylanscandybar.com/ //http://www.wollmanskatingrink.com/main_wollman.htm //http://www.rougetomatenyc.com/ //http://www.bergdorfgoodman.com/ //http://www.perseny.com/ //http://www.carnegiehall.org/ //http://www.trattoriatrecolori.com/ //http://www.nintendoworldstore.com/ //http://www.yelp.com/biz/johns-pizzeria-new-york-2 //http://www.mymms.com/merchandise/locations.aspx //http://www.chipotle.com/en-US/Default.aspx?type=default //http://www.esbnyc.com/ //http://www.theredcat.com/redcat.php //http://www.acehotel.com/ //http://www.shakeshack.com/ //http://www.hotelgiraffe.com/ //http://www.yelp.com/biz/blue-9-burger-new-york-2 //http://www.strandbooks.com/ //http://www.gyu-kaku.com/ //http://www.nycgovparks.org/parks/washingtonsquarepark //http://www.deandeluca.com/ //http://www.ricetoriches.com/puddy.aspx //http://www.tenren.com/ //http://www.nycgovparks.org/parks/M015/ //http://articles.nydailynews.com/2008-12-14/local/17912417_1_mta-plan-mta-board-subway-stations //http://www.adventuresofagoodman.com/wp-content/gallery/gallery-selects/nyc-subway.jpg