ࡱ> Root EntryRoot Entryp|YrRASH`4 &Contents:6(Page 1`9Symbol 20 y  !"#$%&'()*+,-./0123456789;<=>?@ABCDEFGHIJKLMNSymbol 3 Symbol 1<Symbol 4QSymbol 5} Symbol 11lSymbol 17 [Symbol 19JSymbol 12 4ISymbol 13,Symbol 14 ISymbol 15I  !"#$%&'()*+-./012356789:;<=>?@ABCDEFGHIKLMNOPQRSTUVWXYZ\]^_`abcdefghijkmnopqrstuvwxyz{|~CPicPage 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 CPicShape0000 @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 CPicSprited char?dchar?dchar?dchar?Layer 1OCPicPage CPicLayer CPicFrame CPicSprited char?dchar?dchar?dchar?Layer 1OCPicPage CPicLayer CPicFrame CPicSprite char?char?char?char?Layer 1OCPicPage CPicLayer CPicFrameN0d0d0?Layer 1OCPicPage CPicLayer CPicFrameCPicText( @text_sans?Layer 1OCPicPage CPicLayer CPicFrames0P0P0?P000P?0P0P0?Layer 1OCPicPage CPicLayer CPicFrame?Layer 1OCPicPage CPicLayer CPicFrame CPicShapeDDWxff sf  sf  ?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, 1, 0, 0, 1], [1, 0, 1, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 1, 0, 1], [1, 0, 0, 1, 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, 1, 0, 0, 0, 0, 1], [1, 0, 0, 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 infogame3{tileW:30, tileH:30, currentMap:1, bulletcounter:0} game.bullets new Array() 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)declare enemies8enemies array is in the order [enemy type, xtile, ytile] myEnemies[[0], [[1, 6, 1]], [[2, 1, 3]]]declare enemy types game.Enemyp1function () { }game.Enemyp1.prototype.xMove0game.Enemyp1.prototype.yMove1game.Enemyp1.prototype.speed2game.Enemyp1.prototype.turning5 game.Enemyp2function () { }game.Enemyp2.prototype.xMove1game.Enemyp2.prototype.yMove0game.Enemyp2.prototype.speed2game.Enemyp2.prototype.turning5declare bullet game.Bulletfunction () { }game.Bullet.prototype.speed5game.Bullet.prototype.dirx0game.Bullet.prototype.diry-1game.Bullet.prototype.width2game.Bullet.prototype.height2Cdeclare char object, xtile and ytile are tile where chars center ischar,{xtile:2, ytile:1, speed:4, shootspeed:1000}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 iob.turning move enemy) moveChar(ob, ob.xMove, ob.yMove)change enemy direction ob.xMove == 0ob.xMove random(2)*2-1ob.yMove0)@getMyCorners(ob.x+ob.speed*ob.xMove, ob.y+ob.speed*ob.yMove, ob):!ob.downleft or !ob.upleft or !ob.downright or !ob.uprightob.xMove -ob.xMoveob.xMove0ob.yMove random(2)*2-1)@getMyCorners(ob.x+ob.speed*ob.xMove, ob.y+ob.speed*ob.yMove, ob):!ob.downleft or !ob.upleft or !ob.downright or !ob.uprightob.yMove -ob.yMove$check if we have collision with hero'xdist = ob.x-char.x'ydist = ob.y-char.y6Math.sqrt(xdist*xdist+ydist*ydist)100game.bulletcounter0name of new bullet'"name = "bullet"+game.bulletcounter"make new bullet object in the game game[name]new game.Bullet()add id to bullet game[name].idgame.bulletcounteradd bullet to bullets Array)game.bullets.push(game[name]).make sure bullet is heading where player faces)take values from player if char has movedob.dirx or ob.dirygame[name].dirxob.dirxgame[name].diryob.diryadd starting tilegame[name].xtileob.xtilegame[name].ytileob.ytileadd bullet to the stage)?game.clip.attachMovie("bullet", name, 10100+game.bulletcounter)!declare clip in the bullet objectgame[name].clipgame.clip[name]calculate position game[name].x(ob.x+game[name].dirx*ob.width) game[name].y (ob.y+game[name].diry*ob.height) place clipgame.clip[name]._x game[name].xgame.clip[name]._y game[name].y&% moveBullets+loop through all bullets currently on stage, var i = 0igetMyCorners(ob.x+ob.speed*ob.dirx, ob.y+ob.speed*ob.diry, ob)9ob.downleft and ob.upleft and ob.downright and ob.uprightmove it)moveChar(ob, ob.dirx, ob.diry)delete bullet mc)ob.clip.removeMovieClip()delete bullet object$!game["bullet"+game.bullets[i].id] remove bullet from bullets Array)game.bullets.splice(i, 1)check if we have shot the enemy, var j = 0jKey.isDown(Key.SHIFT) and getTimer()>ob.lastshot+ob.shootspeed)_root.shoot(ob)walk animation !keyPressed)ob.clip.char.gotoAndStop(1))ob.clip.char.play())_root.enemyBrain())_root.moveBullets()& make the map)(buildMap(_root["myMap"+game.currentMap]) --script--O --script--O  CDocumentPage Page 1Scene 1@u;g? Symbol 20bullet?bullet? Symbol 3empty;empty; Symbol 1tileFu;tileY? Symbol 4loaderX)8>C? Symbol 5startbutC?O? Symbol 11char f%?charS? Symbol 17enemy1w?enemy1w? Symbol 19enemy2s?enemy2? 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 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*](o"PublishQTProperties::QTSndSettingsCQTAudioSettings