User Tag List

Results 1 to 3 of 3

Thread: Need help for point and click movement?

  1. #1
    No Products Registered

    Join Date
    Jun 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help for point and click movement?

    Hi everybody!
    First of all excuse me for my poor English. I'm still the novice in MMF 2 and try to create a small RPG with a
    top/down view and point and click movement.
    I've created the simple mouse click movement engine, but I have some problem with a piece of code.
    I have a simple code such like this - download the attached file.

    When I press and hold down the left mouse button, the player is moving toward the cursor - it's very good, but when I release the button - player goes to the marker which appeared before(according the code lines from 16 till 22 - see the attached file).
    In short, I need two kinds of movement actions by a mouse click:

    1) When I click by the left button of a mouse on screen and player simply goes to the click point destination.
    (See the code lines from 16 till 22).

    2) When I press and hold down the left mouse button, and player goes constantly toward the mouse cursor and when I release the left mouse button, the player must stop.

    But when I release mouse button, it starts to execute the previous code and player runs toward the marker, and I need that the player stopped.
    I don't know how can I realize the code to cancel this action.
    Can anyone help me with this?
    ================================================
    One more question about how can I learn to use formulas (coding) in MMF 2?
    I mean, I saw very much of examples where they used difficult math formulas for coding....
    I saw nothing all around internet about the base learning of knowledge in order to code in MMF 2.
    What I have to know?.....Mathematic?.....Trigonometry?........Del fi...Borland or Python?....
    MMF help file has no such information. Where experienced users are taking math formulas from?
    How newbies can learn MMF 2, if no tutorials, except the examples, but the examples are showing HOW it's made, but not WHY just like this - and this most important!

    Thank you in advance!
    Attached files Attached files

  2. #2
    Clicker Multimedia Fusion 2
    Fralex's Avatar
    Join Date
    Sep 2008
    Location
    Melrose, MA
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post

    Well, since it will constantly cycle through all the events in the Event Editor, the previous code is going to keep getting executed as long as the conditions set for it still apply. While the mouse button is down, what happens according to the code is this:


    At 19, it sees that there's 1 Marker and 1 Center of marker, so Player turns to face the Marker, begins moving, then turns to face the Center( having it turn to face the Marker is actually unnecessary, since afterward it's immediately turned to face the Center in that same line of code, and also because the Marker and the Center have the same coordinates anyway).

    At 26, it sees that the mouse button is down, so Player turns to face the Cursor. Keep in mind that no time has passed since Event 19, FAIAP. I'm not exactly sure how it decided that this particular direction change would take priority if it tried to make Player look at both the Center of marker and the Cursor, but that's what happens whenever the mouse button is down.

    Now once the button is up again, the condition for event 26 is false, but event 19's conditions are still true. So from then on it points the Player at the Center of marker, until Player reaches it and triggers the event that destroys the Marker and its Center.


    So it looks like what you need is a way to test how long the mouse button was held down for. If there's just a short click, a target is created and the player moves to it until it reaches it. If the button is pressed for longer than that, the player should instead follow the cursor for as long as the button is held. Here's what I did:

    test movement fixed.mfa

    Hope this helps! :-)

  3. #3
    No Products Registered

    Join Date
    Jun 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank's a lot for your reply, help and the code correcting.
    It just that I wanted. I hope that it'll be helpful not only for me....
    Happy have a nice day, night and so on.....

Similar Threads

  1. Which extension is best for point and click movement?
    By TheSynapse in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 28th March 2012, 06:16 AM
  2. Is possible a point&click game???
    By xiero in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th September 2010, 07:39 PM
  3. Point and Click Example
    By nivram in forum File Archive
    Replies: 5
    Last Post: 19th April 2009, 04:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •