ࡱ> Root EntryRoot Entryp|YrRASHPr_J &Contents@6(Page 1ESymbol 20 y  !"#$%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTSymbol 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 1O0 j CPicPage CPicLayer CPicFrame CPicSprite char CPicShape@j 0 j dd? char @ 0 j dd? char @j 0 j 8dd?Layer 1O 0 j CPicPage 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 1OD0 j CPicPage 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 CPicFrameNNd0d00?Layer 1OCPicPage CPicLayer CPicFrameCPicText( @text_sans?Layer 1O CPicLayer CPicFrameCPicTexCPicPage CPicLayer CPicFrames0P0P0?P000P?0P0P0?Layer 1OCPicPage CPicLayer CPicFrame?Layer 1OCPicPage CPicLayer CPicFrame CPicShapeDDWxff sf  sf  ?Layer 1OCPicShapeDDWxff 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, 0, 0, 0, 1], [1, 0, 1, 4, 0, 0, 0, 1], [1, 0, 0, 5, 0, 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 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)'ladder tile, can be climbed up and down game.Tile4function () { }game.Tile4.prototype.walkablefalsegame.Tile4.prototype.frame2game.Tile4.prototype.laddertruegame.Tile4.prototype.itemladder'ladder tile, can be climbed up and down game.Tile5function () { }game.Tile5.prototype.walkabletruegame.Tile5.prototype.frame1game.Tile5.prototype.laddertruegame.Tile5.prototype.itemladderdeclare enemies8enemies array is in the order [enemy type, xtile, ytile] myEnemies[[0], [[0]], [[2, 3, 2]]]declare enemie types game.Enemyp1function () { }game.Enemyp1.prototype.xMove0game.Enemyp1.prototype.yMove1game.Enemyp1.prototype.speed2 game.Enemyp2function () { }game.Enemyp2.prototype.xMove1game.Enemyp2.prototype.yMove0game.Enemyp2.prototype.speed2declare 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, jumpstart:-18, gravity:2, jump:false, climb:false, 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 i0ob.dirxdirxare we jumping?Math.abs(jump) == 1speedob.jumpspeed*jumpspeedob.speedvertical movementwhere are our edges?)first we look for y movement, so x is old)'getMyCorners(ob.x, ob.y+speed*diry, ob),move got dammit... and check for collisions.going up diry == -1ob.upleft and ob.uprightno wall in the way, move on)ob.y += speed*diry&hit the wall, place char near the wallob.yob.ytile*game.tileH+ob.height2are we jumping around and have hit the tile above? ob.jumpspeed0 if going down diry == 1ob.downleft and ob.downright)ob.y += speed*diryob.y!(ob.ytile+1)*game.tileH-ob.heightob.jumpfalsehorisontal movement&changing x with speed and taking old y)'getMyCorners(ob.x+speed*dirx, ob.y, ob) if going left dirx == -1ob.downleft and ob.upleftset climbing flag to falseob.climbtrue)ob.x += speed*dirxcheck for tile below)fall(ob)ob.xob.xtile*game.tileW+ob.widthif going right dirx == 1ob.upright and ob.downrightset climbing flag to falseob.climbtrue)ob.x += speed*dirxcheck for tile below)fall(ob)ob.x (ob.xtile+1)*game.tileW-ob.widthupdate char position)updateChar(ob, dirx, diry)((true)&% updateCharob, dirx, diryupdate char position ob.clip._xob.x ob.clip._yob.yface the direction)"ob.clip.gotoAndStop(dirx+diry*2+3)(calculate the tile where chars center isob.xtile!Math.floor(ob.clip._x/game.tileW)ob.ytile!Math.floor(ob.clip._y/game.tileH)check for door:game["t_"+ob.ytile+"_"+ob.xtile].door and ob == _root.char make new map) changeMap(ob)&%jumpobgravity control ob.jumpspeedob.jumpspeed+ob.gravityob.jumpspeed>game.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 = 0i100game.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) do we jumpob.jump keyPressed_root.jump(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])check if we are falling)fall(_root.char) --script--O --script--O18592PublishQT  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"PublishQTProperties::QTSndSettingsCQTAudioSettings