User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Retro RPG Movement (Grid)

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export Module

    Join Date
    Dec 2012
    Location
    Copenhagen, Denmark
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Retro RPG Movement (Grid)

    I've been working on something involving grid-movement, I found an example where it in essence used 4 flags (up, down, left and right) and it uses a counter going to 32 (adding 1 every 22 milliseconds; so it moves 32 pixels at a time, and shows the movement so you can see the animations). The thing is, sometimes it would get off the 'grid'. I tried increasing the time to 1.5 seconds, and it never got off the 'grid'... so I think sometimes the thread "skips a beat".

    If I'm right, using the timer for movement is not optimal, as I never want the player to get off the 'grid'. Is there a better way to do a grid-based movement of 4 directions, and still showing the animation from one tile to the other (so it's not moved the 32 pixels in the direction right away; that is easy :P)

    Thanks in advance. I'd appreciate it if I could get a pointer without showing any of my code, as it's quite lengthy.

  2. #2
    Clicker Multimedia Fusion 2iOS Export ModuleXNA Export Module
    Asholay's Avatar
    Join Date
    Nov 2008
    Location
    England
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is an old file of mine which does grid movement.

    Grid.mfa

    Does that help?

  3. #3
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    I also have a four direction fast loop grid movement on my website. Use number 2.

    Link:
    http://castles-of-britain.com/mmfexamples-e.htm

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  4. #4
    Clicker Fusion 2.5

    Join Date
    Jun 2007
    Location
    French
    Posts
    699
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hello.

    The best choice for engine displacement player character rpg card is the four directions box by box.

    Examples (6 lines):
    http://files.getwebb.org/download.php?id=cre63eaj

    Bye.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export Module

    Join Date
    Dec 2012
    Location
    Copenhagen, Denmark
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Even after literally copying everything from Nivram and Springup into my own project to try it out, it sometimes goes off grid and gets stuck in the obstacles. It works fine when I run it in your own files.
    This makes no sense at all; considering I've actually copied the exact same thing.

  6. #6
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by hellii View Post
    Even after literally copying everything from Nivram and Springup into my own project to try it out, it sometimes goes off grid and gets stuck in the obstacles. It works fine when I run it in your own files.
    This makes no sense at all; considering I've actually copied the exact same thing.
    If it is not too late, build your engine around one of the examples instead of trying to add the example to your game.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export Module

    Join Date
    Dec 2012
    Location
    Copenhagen, Denmark
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could be last resort, but it would be awesome if I knew what was wrong..

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export Module

    Join Date
    Dec 2012
    Location
    Copenhagen, Denmark
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've just tried to put the whole of my project into the example. Then I took the objects from the example and put it into the first frame I got of my game... and it does the same thing: sometimes snaps to the obstacles. It makes no sense at all, it's as if something in my own code collides with the example code, but it's separate. It's really frustrating when something that SHOULD work just doesn't. And it pains me not to know what the problem is.

    Springup's example was what I used, and I actually get the same problem when I tried navrim's example. It works fine in the example file, but when I put the whole thing into my own, it collides and gets stuck with the obstacles on the map.

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2007
    Location
    UK
    Posts
    306
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    helliii, I'm not sure if this is what you want, but if you want your player to move 32 pixels before coming to a stop, you need to do something like this:

    Repeat while "player" moved left
    +Alterable value a of "player" = 0
    - set direction left
    - set Alterable value a to 32

    "player" is facing a direction left
    + Alterable value a>0
    - set x position to x position("player")-1
    - sub 1 from Alterable value a

    The above will make the player move left 1 pixel 32 times. To prevent the player overlapping obstacles, add a sensor 32 pixels to the left of the player. And add the following to the first line of code:

    X(negate) "left sensor" is overlapping a backdrop

    When done, your code should look something like this:

    Repeat while "player" moved left
    + Alterable value a of "player" = 0
    + X(negate) "left sensor" is overlapping a backdrop
    - set direction left
    - set Alterable value a to 32

    "player" is facing a direction left
    + Alterable value a>0
    - set x position to x position("player")-1
    - sub 1 from Alterable value a

    For the sensor:

    Always
    - Set position at (-32,0) from "player"


    Do the same for the other directions and place each new sensor on the correct side of the player.

  10. #10
    Clicker Multimedia Fusion 2iOS Export ModuleXNA Export Module
    Asholay's Avatar
    Join Date
    Nov 2008
    Location
    England
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Caesar View Post
    helliii, I'm not sure if this is what you want, but if you want your player to move 32 pixels before coming to a stop, you need to do something like this:
    That's the method I use in the above posted example file - works fine, no need for fast loops or any resource hungry coding - and perfectly reliable.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Grid movement?
    By Zambaku in forum The Games Factory 2 - Technical Support
    Replies: 4
    Last Post: 23rd July 2009, 09:29 AM
  2. Grid Movement
    By Joni in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 6th January 2007, 09:51 AM
  3. Grid Movement Example
    By DavidN in forum File Archive
    Replies: 1
    Last Post: 30th November 2006, 06:15 PM
  4. Grid Movement?
    By DizzyDoo in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 22nd October 2006, 05:57 AM
  5. Grid Movement?
    By DizzyDoo in forum File Archive
    Replies: 0
    Last Post: 21st October 2006, 07:45 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
  •