ࡱ> Root EntryRoot Entryp|YrRASHA&Contents:g(Page 18Symbol 17 ?  !"#$%&'()*+,-./0123456789;<=>?@ABCDEFGHIJKLMNSymbol 3 Symbol 19Symbol 4QSymbol 5} Symbol 11lSymbol 12 VISymbol 13NSymbol 14 8ISymbol 15"ISymbol 18Symbol 19  !#$%&'()*+,-./012345679:;<=>?@ABCDEFGHIJKLMOPQRSTUWXYZ[\]^_`abcdefghijkmnopqrstuvwxyz{|~CPicPage CPicLayer CPicFrame CPicSprited char?dchar?dchar?dchar?Layer 1O0 j CPicPage CPicLayer CPicFrame CPicSprited char?dchar?dchar?dchar?Layer 1OddCPicPage CPicLayer CPicFrame CPicSprite char CPicShape@j 0 j @ 0 j? char @j 0 j @0 j? char @j0 j @ 0 j?Layer 1O@CPicPage CPicLayer CPicFrame CPicSprite char CPicShape@j 0 j dd? char @ 0 j dd? char @j 0 j 8dd?Layer 1O?CPicPage CPicLayer CPicFrame CPicShapep 0000@j0 j@0 j?Layer 1OCPicPage CPicLayer CPicFrame CPicSprite char CPicShape@0 j dd? char @0 j 8dd? char @D0 j dd?Layer 1OCPicPage CPicLayer CPicFrame CPicSprite char?char?char?char?Layer 1O00) add " LOADED ..."4CPicPage CPicLayer CPicFrameNNd0d00?Layer 1O) controllerCPicPage CPicLayer CPicFrameCPicText( @text_sans?Layer 1OCPicPage CPicLayer CPicFrame0P0P0?P000P?0P0P0?Layer 1O, 0, 0,CPicPage CPicLayer CPicFrame?Layer 1Oe.Tile0.prototype.walkabletrCPicPage CPicLayer CPicFrame f d00dpPd03p03pd3?Layer 1Ogame.Tile2.prototype.frame3game.Tile2.prototype.doortrue'ladder tile, can be climbed up and down game.Tile3function () { }game.Tile3.prototype.walkabletruegame.Tile3.prototype.frame1game.Tile3.prototype.laddertruegame.Tile3.prototype.itemladderCPicPage CPicLayer CPicFrame CPicSprite textoint( _parent.getBytesLoaded()/1000) add " KBYTES OF " add int(_parent.getBytesTotal() /1000) add " LOADED ..."4 _parent.getBytesTotal() == _parent.getBytesLoaded())_parent.gotoAndStop(2)? CPicButton \V  3 CPicTextC=G TextField1_sansCLICK HERE TO START?   )_root.detectKeys() controller?assetsOO? allowscalefalseshowmenufalse??f allowscalefalse allowscalefalseour map is 2-dimensional arraymyMap1[[1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 1], [1, 0, 1, 4, 0, 0, 0, 1], [1, 0, 0, 5, 1, 1, 0, 1], [1, 0, 0, 5, 0, 0, 0, 2], [1, 1, 1, 1, 1, 1, 1, 1]]myMap2[[1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 1], [1, 0, 1, 1, 1, 1, 0, 1], [3, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1]]#declare game object that holds infogame"{tileW:30, tileH:30, currentMap:1} walkable tile game.Tile0function () { }game.Tile0.prototype.walkabletruegame.Tile0.prototype.frame1 wall tile game.Tile1function () { }game.Tile1.prototype.walkablefalsegame.Tile1.prototype.frame2door object prototype game.Doorspfunction (newmap, newcharx, newchary) { this.newmap = newmap;this.newcharx = newcharx;this.newchary = newchary;}game.Doors.prototype.walkabletruegame.Doors.prototype.frame3game.Doors.prototype.doortrue door tilesKmake those tiles from the door object passing newmap, newcharx and newchary game.Tile2function () { }game.Tile2.prototypenew game.Doors(2, 1, 4) game.Tile3function () { }game.Tile3.prototypenew game.Doors(1, 6, 4)'ladder tile, can be climbed up and down game.Tile5function () { }game.Tile5.prototype.walkabletruegame.Tile5.prototype.frame1game.Tile5.prototype.laddertruegame.Tile5.prototype.itemladder'ladder tile, can be climbed up and down game.Tile4function () { }game.Tile4.prototype.walkablefalsegame.Tile4.prototype.frame2game.Tile4.prototype.laddertruegame.Tile4.prototype.itemladderdeclare enemies8enemies array is in the order [enemy type, xtile, ytile] myEnemies[[], [[1, 5, 2]], [[2, 3, 2]]]declare enemie types game.Enemyp1function () { }game.Enemyp1.prototype.xMove1game.Enemyp1.prototype.yMove0game.Enemyp1.prototype.speed3 game.Enemyp2function () { }game.Enemyp2.prototype.xMove1game.Enemyp2.prototype.yMove0game.Enemyp2.prototype.speed2Cdeclare char object, xtile and ytile are tile where chars center ischarN{xtile:2, ytile:1, speed:4, jumpstart:-18, gravity:2, jump:false, climb:false}building the world%buildMapmap.attach empty mc to hold all the tiles and char)&_root.attachMovie("empty", "tiles", 1)declare clip in the game object game.clip _root.tilesget map dimensions'mapWidth = map[0].length'mapHeight = map.lengthloop to place tiles on stage, var i = 0 igame.tileH ob.jumpspeed game.tileHob.jumpspeed<0going up)moveChar(ob, 0, -1, -1)ob.jumpspeed>0 going down)moveChar(ob, 0, 1, 1)&9check if we have walked off the tile and should fall down%fallobob.climbfalsenot while jumping!ob.jump)getMyCorners(ob.x, ob.y+1, ob)both tile below are emptyob.downleft and ob.downright falling down ob.jumpspeed0ob.jumptrue&check if we can climb up% checkUpLadderobfind up and down center points'1downY = Math.floor((ob.y+ob.height-1)/game.tileH)'-upY = Math.floor((ob.y-ob.height)/game.tileH)check if one of them is ladder'-upLadder = game["t_"+upY+"_"+ob.xtile].ladder'1downLadder = game["t_"+downY+"_"+ob.xtile].ladderupLadder or downLadder((true))fall(ob)&check if we can climb down%checkDownLadderob#find down center point after moving'8downY = Math.floor((ob.speed+ob.y+ob.height)/game.tileH)check if it is ladder'1downLadder = game["t_"+downY+"_"+ob.xtile].ladder downLadder((true))fall(ob)&climb up or down%climbob, diryset climbing flag to trueob.climbtrueob.jumpfalsemove it)ob.y += ob.speed*diry9center char to the ladder and thats in the center of tileob.x"(ob.xtile*game.tileW)+game.tileW/2update char position)updateChar(ob, 0, diry)((true)&% enemyBrain+loop through all enemies currently on stage, var i = 0iC? Symbol 5startbutC?O? Symbol 11char f%?charS? Symbol 12char_up C? Y? Symbol 13 char_grph %?#Y? Symbol 14 char_leftC?"UY? Symbol 15 char_downC?$YY? Symbol 18enemy1w?enemy1&? Symbol 19enemy2s?enemy2&?hhhh PublishRNWKProperties::speed256K0!PublishGifProperties::PaletteName"PublishHtmlProperties::StartPaused0%PublishFormatProperties::htmlFileName tut04.html PublishQTProperties::LayerOption PublishQTProperties::AlphaOption"PublishQTProperties::MatchMovieDim1PublishHtmlProperties::Loop1Vector::External Font Files0Vector::Generator EncodingVector::Debugging Permitted0PublishFormatProperties::jpeg0&PublishRNWKProperties::speedSingleISDN0&PublishRNWKProperties::singleRateAudio0PublishQTProperties::Width240$PublishPNGProperties::OptimizeColors1PublishHtmlProperties::Units0Vector::Generator Command%PublishRNWKProperties::mediaCopyright 2000#PublishRNWKProperties::flashBitRate1200PublishGifProperties::Smooth1&PublishFormatProperties::flashFileName tut04.swf%PublishFormatProperties::projectorMac0!PublishRNWKProperties::exportSMIL1 PublishRNWKProperties::speed384K0"PublishRNWKProperties::exportAudio1"PublishGifProperties::DitherOptionPublishHtmlProperties::Quality4(PublishHtmlProperties::VerticalAlignment1Vector::Generator Height180$PublishFormatProperties::pngFileName tut04.pngPublishFormatProperties::html1'PublishRNWKProperties::mediaDescription"PublishPNGProperties::FilterOption!PublishHtmlProperties::DeviceFont0Vector::Generator ColorVector::Override Sounds0PublishQTProperties::Flatten1PublishJpegProperties::DPI4718592PublishPNGProperties::BitDepth24-bit with AlphaPublishPNGProperties::Smooth1"PublishGifProperties::DitherSolids0PublishGifProperties::Interlace0"PublishHtmlProperties::DisplayMenu0*PublishHtmlProperties::HorizontalAlignment1Vector::Quality80Vector::Protect0*PublishFormatProperties::generatorFileName tut04.swtPublishFormatProperties::gif0Vector::Template$PublishRNWKProperties::mediaKeywords!PublishRNWKProperties::mediaTitlePublishRNWKProperties::speed28K1PublishGifProperties::Loop1PublishGifProperties::Width240#PublishFormatProperties::qtFileName tut04.mov$PublishRNWKProperties::speedDualISDN0$PublishRNWKProperties::realVideoRate100000PublishJpegProperties::Quality80"PublishPNGProperties::DitherOption#PublishGifProperties::PaletteOption#PublishGifProperties::MatchMovieDim1Vector::Generator LoadOrderVector::Generator Width240PublishFormatProperties::flash1$PublishJpegProperties::MatchMovieDim1#PublishPNGProperties::PaletteOption#PublishPNGProperties::MatchMovieDim1PublishHtmlProperties::Align0-PublishFormatProperties::projectorWinFileName tut04.exe#PublishQTProperties::PlayEveryFrame0"PublishJpegProperties::Progressive0"PublishPNGProperties::DitherSolids0PublishHtmlProperties::Height180PublishHtmlProperties::Width240Vector::Debugging PasswordVector::Omit Trace Actions0%PublishFormatProperties::jpegFileName tut04.jpgPublishJpegProperties::Size0PublishPNGProperties::Interlace0PublishGifProperties::Height180'PublishHtmlProperties::TemplateFileName/C:\PROGRA~1\MACROM~1\FLASH5~1\Html\Default.html!PublishHtmlProperties::WindowMode0Vector::TopDown0-PublishFormatProperties::projectorMacFileName tut04.hqxPublishFormatProperties::rnwk0PublishFormatProperties::png0PublishRNWKProperties::speed56K1PublishQTProperties::Height180%PublishPNGProperties::RemoveGradients0PublishGifProperties::MaxColors255'PublishGifProperties::TransparentOptionPublishGifProperties::LoopCountVector::Report0"PublishFormatProperties::generator"PublishRNWKProperties::audioFormat0$PublishGifProperties::OptimizeColors1Vector::Version5Vector::Event Format0Vector::Stream Compress7PublishFormatProperties::qt0 PublishRNWKProperties::speed512K0PublishJpegProperties::Height180PublishPNGProperties::Height180PublishPNGProperties::Width240%PublishGifProperties::RemoveGradients0PublishHtmlProperties::Scale0Vector::Event Compress7"PublishRNWKProperties::mediaAuthor(PublishRNWKProperties::speedCorporateLAN0&PublishRNWKProperties::showBitrateDlog1"PublishRNWKProperties::exportFlash1PublishQTProperties::Looping0*PublishQTProperties::UseQTSoundCompression0PublishJpegProperties::Width240!PublishPNGProperties::PaletteName!PublishPNGProperties::Transparent0&PublishGifProperties::TransparentAlpha128PublishGifProperties::Animated0Vector::Stream Format0$PublishFormatProperties::gifFileName tut04.gifPropSheet::ActiveTab1621"PublishQTProperties::PausedAtStart0%PublishQTProperties::ControllerOption0PublishPNGProperties::MaxColors255Vector::MatchMovieDim1Vector::Generator FPS12%PublishFormatProperties::rnwkFileName tut04.smil%PublishFormatProperties::projectorWin0%PublishFormatProperties::defaultNames1 CColorDef3PfP0PHP`Px333(3f<03CH3F`3Hxf0f30ff(0f5Hf<`f@x3330333xf3d03]H3Z`3Xx3333303f3PPH33Px`33Px33Pf30f33PHff3(PHf3<x`f3Cxf3Ffff`f03f0ffx0fkHfd`f`x3f033fPH3ffxPH3fdx`3f]x3fZff0f3fPHfff`ffP0xffPxffPH3HfHxH̙n`hx3H33x`3fx`3xx`3̙kx3dfHf3x`ff0xfx0xf̙dxf]`3`f``x`px3`33x3fx3x3xx3nf`f3xffxfxfxxfkx3xfxxxxx3x333f333xfxf3fffffxxH3 HfH(H2`8x`3 `f`̙`(`0xx3xfxx x(xPx3H33x`f3x`3(x`35x3<3`33xf3 x̙3x3(x323x33f3 333(xfH3fx`ff0xf(0xf<xfCf`3fxffx̙fxf(xf5fx3ffff ff((xH3x`f0x̙PPP`3xfx̙P̙(P<x3f̙(xx`3xfxPxPd`3xfx̙PPx3f(xx3fxx3f̙xx3ff`zf*](oitems1d? "PublishQTProperties::QTSndSettingsCQTAudioSettings