Movement Events


We now have three ducks that are positioned in the user interface, and it’s time to enable them to interact in the frame. As MMF works in a step-by-step manner, we’ll continue to do our work in the same way:

  1. Open the Event Editor.

  2. Double-click New Condition to open the New Condition window.

  3. Right-click the first duck and choose Position, Test Position from the pop-up menu. This will display a new window (see Figure 19.42).


    Figure 19.42: The Test Position window.

  4. The arrow pointing left and inside the inner square (see Figure 19.43) is the one that needs to be clicked. Click OK to close the window.


    Figure 19.43: You can see the arrow that needs to be selected.

    The new event is created (see Figure 19.44).

    click to expand
    Figure 19.44: The new event has been created.

  5. Right-click the column beneath the first duck in this row and select Movement, Wrap Around Play Area. This will force the duck to continue wrapping around as it reaches the right side of the screen.

  6. Repeat the steps for each duck, and your events should now resemble Figure 19.45.

    click to expand
    Figure 19.45: You can repeat the steps for every duck.

  7. Close the Event Editor for now and open the Frame Editor.

  8. Add a new active object to the frame by choosing Insert, Object, Active. The Animation Editor opens immediately.

  9. Double-click Frame 1 to open the image, which is a diamond by default.

  10. Choose the Eraser from the tools along the left side of the screen (see Figure 19.46) and erase the diamond.


    Figure 19.46: The eraser can be selected.

  11. Choose Continuous Brush Tool (see Figure 19.47).


    Figure 19.47: The Continuous Brush tool.

    Along the bottom of the screen, there is a palette of colors available for our tool (see Figure 19.48).

    click to expand
    Figure 19.48: There are many colors available.

  12. Choose a red color so that when we draw, it will be easily visible on the screen.

    The Continuous Brush tool displays a toolbar along the top of the screen as well (see Figure 19.49). This toolbar, which is positioned beneath the standard toolbar when the Continuous Brush is selected, contains a variety of options. Among them is the size of the brush (see Figure 19.50).

    click to expand
    Figure 19.49: A toolbar is available for the tool.


    Figure 19.50: One of the options is the brush size.

  13. Click the largest of the three visible options.

  14. Position your mouse in approximately the middle of the Animation Editor, which is currently completely empty, and single-click the mouse to create a red dot in the middle of it.

  15. Close the new image and save the changes.

  16. Close the Animation Editor and save the changes.

    The dot is now visible in the Frame Editor and is named Active4 by default.

  17. Open the Event Editor.

  18. Double-click New Condition.

  19. Right-click the icon that looks like a chessboard and choose Start of Application.

  20. Right-click the Mouse and Keyboard column next to the newly created event and choose Hide Windows Mouse Pointer.

  21. Create a new condition.

  22. Right-click the icon called Special, which looks like two networked PCs, and choose Always Never, Always.

  23. Right-click the Active4 column positioned in the newly created event row and choose Position, Set X Coordinate. This displays the Set X Coordinate window (see Figure 19.51).

    click to expand
    Figure 19.51: The Set X Coordinate window is displayed with the Expression Editor.

  24. Type XMouse into the window (see Figure 19.52) and click OK.

    click to expand
    Figure 19.52: XMouse has been entered as the expression.

  25. Right-click the same square beneath Active4 and Position, Set Y Coordinate.

  26. In the Set Y Coordinate window, type YMouse and click OK. The dot will now be positioned wherever you move the mouse and will act as a sort of scope for our next step.

  27. Create a new condition. Choose Mouse and Keyboard from the New Condition window and choose The Mouse, User Clicks On an Object.

  28. This will display the User Clicks On an Object window (see Figure 19.53). Click OK, leaving default objects. Click the first duck and click OK.


    Figure 19.53: The User Clicks On an Object window.

  29. In the new event column we just created, right-click the square located beneath the first duck and choose Destroy. Although the mouse is not visible in our frame, MMF still checks for the events associated with the mouse. Now, when we click on the first duck, it will be destroyed.

  30. Create a new condition. Right-click on the first duck in the New Condition window and choose Animation, Has an Animation Finished. Choose Disappearing from the Has an Animation Finished window.

  31. Right-click the square located under the Create New Objects column and choose Create Object. Choose the first duck from the available options. Position your cursor in the lower-right corner in the approximate location where the upper-left coordinate of the duck is currently located (see Figure 19.54) and click OK. We’ll now have a duck re-created every time you destroy one.

    click to expand
    Figure 19.54: Position the cursor near the duck.

  32. Repeat steps 30–34 for the remaining two ducks, adjusting the positions when you create the new objects.




Awesome 3d Game Development(c) No Programming Required
Awesome 3d Game Development: No Programming Required (Charles River Media Game Development)
ISBN: 1584503254
EAN: 2147483647
Year: 2006
Pages: 168

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net