User Tag List

Results 1 to 7 of 7

Thread: Moving tiles

  1. #1
    No Products Registered

    Join Date
    Sep 2008
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Moving tiles

    Please bear with me, I'm a complete newbie with MMF2. I'm trying to set up a screen as a play area with square tiles that constantly move, or at least try to move.

    They have specific facings that determine the direction of movement.
    They have to move until they hit the edge of the screen or until they hit another object that blocks forward movement. If they hit such an obstacle, they need to stop.
    When the player clicks one of these tiles, they need to flip to the next facing and move in that direct instead.

    I've currently got some of this working using vector movement, but they aren't reacting to mouse clicks, and I'm finding some issues with consistent movement speeds (they seem to vary slightly from tile to tile) and collision detection.

    I'm basically looking for suggestions on tutorials I can read, examples I can look at, etc, and to know if there's a movement type that might be better suited to what I'm trying to do here.

    Thanks in advance for any help anyone can offer!


  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Moving tiles

    Here are some things to get you going - To change the direction of the tiles, you could use an event such as User clicks on an object (tile) -> Set direction of tile to Dir("Tile") + 8 (this is assuming 32-directional movement, though, and I'm not sure of the Vector movement's number of angles) - it would make a tile perform a quarter turn.)

    I thought that the vector movement was pretty consistent in its speed, but if not, you could even try the Bouncing Ball movement (which in addition to the movement suggested by its name can cause an object to go in a straight line at a certain speed until an event tells it to change). You could also even control the movement through events entirely by manipulating the X and Y co-ordinates of each tile object.

  3. #3
    No Products Registered

    Join Date
    Sep 2008
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Moving tiles

    It seasons reasonably consistent, but not perfectly consistent. It's probably more than good enough for my purposes, it just surprised me that there was any variation.
    Thanks for the suggestions, I'll see if I can get it working with those ideas.


  4. #4
    No Products Registered

    Join Date
    Sep 2008
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Moving tiles

    Hmmm, controlling position by x and y coordinates would be almost completely ideal for my purposes. It's going to make collision detection difficult though. I'd pretty much have to code it myself, I think.

  5. #5
    No Products Registered

    Join Date
    Sep 2008
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Moving tiles

    Okay, just as an update:
    I have movement working pretty well by setting the X and Y coordinates directly. I'm having several additional problems now, and I'm hoping someone can help.

    1) Everything works fine if the tiles are oriented left, right, or down. If they're oriented left (direction 16), they're supposed to switch to point up (direction 8). I implemented this by having it explicitly check that it's pointed in direction 16, and specifically set it to point in direction 8; no adding or subtracting of numbers.
    What actually happens is instead of switching to Up (8), it switches to Right (0) instead.

    My other question is slightly premature, but I'll ask it now anyway in the hopes that some good solutions will appear in time for me to be ready to try it out.

    I'm creating a variation of a 'group 3' game like Bejeweled. I'm not using the advanced game board object, as I've poked around at it and it's a little beyond my ability right now. Does anyone have any suggestions on how to go about detecting groups of 3+ tiles of the same color, without using the advanced game board? (Or using it is an option, if there's a tutorial for the criminally newbie-ish user out there somewhere.)

  6. #6
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Moving tiles

    Did you then check if it was pointed up, then make it point right, on the line after where you made it point up?

  7. #7
    No Products Registered

    Join Date
    Sep 2008
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Moving tiles

    Yeah... actually a colleague here helped me figure it out. The code block with all my player input lines was running too fast, so each input condition, if matched, now turns off the whole input block, and it gets turned back on automatically elsewhere in the code, so it works now. Thanks for the attempt at helping though!


Similar Threads

  1. Endless Tiles
    By Jeff in forum iOS Released Games & Apps
    Replies: 0
    Last Post: 7th October 2011, 02:35 PM
  2. Video game tiles: how big is too big?
    By Atherton in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 21st December 2010, 05:20 AM
  3. Tiles?
    By Atom in forum File Archive
    Replies: 5
    Last Post: 22nd April 2009, 05:49 PM
  4. Smart Tiles
    By Novabrain in forum Extension Developers Lobby
    Replies: 6
    Last Post: 25th September 2007, 05:43 PM
  5. Background Tiles
    By mercedes1 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 12th March 2007, 01:21 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
  •