ࡱ> Root EntryRoot Entryp|YrRASH4Contents+'Page 1'Symbol 3w  !"#$%&'()*,-./0123456789:;<=>Symbol 1f-Symbol 4`QSymbol 5[ Symbol 11JSymbol 12 4ISymbol 13,Symbol 14 ISymbol 15I  !"#$%&'()*+-./012356789:;<=>?@ABCDEFGHIKLMNOPQRSTUVWXYZ\]^_abcdeghijklmnopqrstuvxyzCPicPage CPicLayer CPicFrame CPicSprite char CPicShape@j 0 j @ 0 j? char @j 0 j @0 j? char @j0 j @ 0 j?Layer 1OCPicPage CPicLayer CPicFrame CPicSprite char CPicShape@j 0 j dd? char @ 0 j dd? char @j 0 j 8dd?Layer 1OCPicPage 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 1OCPicPage CPicLayer CPicFrameN0d0d0?Layer 1OCPicPage CPicLayer CPicFrameCPicText( @text_sans?Layer 1OCPicPage CPicLayer CPicFrames0P0P0?sP000P?0P0P0?P0P00?33P000P?00P0P?Layer 1OCPicPage CPicLayer CPicFrame?Layer 1OCPicPage 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?? 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, 0, 5, 0, 0, 0, 1], [1, 0, 0, 4, 4, 0, 0, 1], [1, 0, 6, 6, 6, 6, 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, 1, 0, 0, 0, 1], [1, 0, 1, 0, 0, 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.frame2 cloud tiles game.Tile4function () { }game.Tile4.prototype.walkabletruegame.Tile4.prototype.cloudtruegame.Tile4.prototype.frame4 game.Tile5function () { }game.Tile5.prototype.walkabletruegame.Tile5.prototype.cloudtruegame.Tile5.prototype.frame5 game.Tile6function () { }game.Tile6.prototype.walkabletruegame.Tile6.prototype.cloudtruegame.Tile6.prototype.frame6door 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)Cdeclare char object, xtile and ytile are tile where chars center ischarA{xtile:2, ytile:1, speed:4, jumpstart:-18, gravity:2, jump: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)((true)&9check if we have walked off the tile and should fall down%fallobnot while jumping!ob.jump)getMyCorners(ob.x, ob.y+1, ob)both tile below are empty4ob.downleft and ob.downright and !checkIfOnCloud(ob) falling down ob.jumpspeed0ob.jumptrue&% detectKeys'ob = _root.char'keyPressed = false"Key.isDown(Key.SPACE) and !ob.jumpjumpob.jumptrue ob.jumpspeed ob.jumpstartKey.isDown(Key.RIGHT) keyPressed_root.moveChar(ob, 1, 0)Key.isDown(Key.LEFT) keyPressed_root.moveChar(ob, -1, 0) do we jumpob.jump keyPressed_root.jump(ob)walk animation !keyPressed)ob.clip.char.gotoAndStop(1))ob.clip.char.play()& make the map)(buildMap(_root["myMap"+game.currentMap])check if we are falling)fall(_root.char) --script--O --script--O  CDocumentPage Page 1Scene 1@u;@ Symbol 3empty;empty; Symbol 1tileFu;tileڷ? Symbol 4loaderX)8>C? 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?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 CColorDef   3P fP0 PH P` Px 3 33( 3f<0 3CH 3F` 3Hx f0 f30 ff(0 f5H f<` f@x  3330  3 33x f3d0 3]H 3Z` 3Xx 33 3330 3f3PPH 33Px` 33Px 33P f30 f33PH ff3(PH f3<x` f3Cx f3F  fff`  f0 3f0 ffx0 fkH fd` f`x 3f0 33fPH 3ffxPH 3fdx` 3f]x 3fZ ff0 f3fPH fff` ffP0x ffPx ffP    H 3H fH xH ̙n` hx 3H 33x` 3fx` 3xx` 3̙kx 3d fH f3x` ff0x fx0x f̙dx f]    ` 3` f` ` x` px 3` 33x 3fx 3x 3xx 3n f` f3x ffx fx fxx fk    x 3x fx x x xx 3x 33 3f 3 3 3x fx f3 ff f f fx  x  H 3 H fH (H 2` 8x ` 3 ` f` ̙` (` 0x x 3x fx x  x (x  Px  3H 33x` f3x` 3(x` 35x 3< 3` 33x f3 x ̙3x 3(x 32 3x 33 f3 3 3 3(  x  fH 3fx` ff0x f(0x f<x fC f` 3fx ffx ̙fx f(x f5 fx 3f ff f f f(  (x  H 3x` f0x  ̙PP P ` 3x fx ̙P ̙(P < x 3 f  ̙ (  xx  ` 3x fx P xP d ` 3x fx ̙P  P x 3 f   (  x  x 3 f   x x 3 f ̙  x x 3 f          f`zf *](o"PublishQTProperties::QTSndSettingsCQTAudioSettings