macromedia DIRECTOR MX 1002004 training from the source [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

macromedia DIRECTOR MX 1002004 training from the source [Electronic resources] - نسخه متنی

Dave Mennenoh

نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
افزودن یادداشت
افزودن یادداشت جدید











Solving the Game


This is going to be a short section. Can you guess why? With the way the game works, there's really just one way to know when all of the matches have been made: when matchList is full.

When matchList has 16 entries, all of the cards have been added to it, and all of the matches have been made. Of course, there are other ways you could approach this, such as creating a variable and incrementing each time a match was made and then checking when its value reached 8. But since matchList is already available, you might as well use it. Currently the only thing it's doing is making it so you can't click on already matched cards.


1.

Right-click the 3D sprite and select Script from the context menu.

You can now modify the enterFrame handler to test if the matchList is full.

2.

Within the enterFrame handler, add the following conditional test. This test needs to go within the block of code that gets executed when a match occurs.

Currently, these three lines get executed:


matchList.add(flippedList[1])
matchList.add(flippedList[2])
flippedList = []

You want to place the conditional test following these three lines so that the cards are added to matchList before you test it.

Add the if statement:


if matchList.count() = 16 then
_movie.go("gameOver")
end if

Now, as soon as the final match is made and all the cards added to matchList, the movie will jump to the gameOver markerwhich you are about to create.

3.

Close the script window and save the movie.



/ 165