User Tag List

Results 1 to 5 of 5

Thread: Problems with Gravity.

  1. #1
    No Products Registered

    Join Date
    Sep 2009
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problems with Gravity.

    Hi, I'm new in this forum and I started to use MMF2 4 days ago so, I'm still in the basic learning process. As I've read, making a platform game with the default options of MMF2 is a wrong way, so I started to learning "Fast Loops" tutorials. I read the Fastloop Custom Platform Movement by David Newton (DavidN). But I want to change something about the Gravity.

    I want to make a Mega Man X game, so I'm trying to emulate the physics, the engine, but there is a lot of questions bugging me hehe. So first, when jumping, the player goes up and down very fast (at least more fast than the original Mega Man X game), and I wanted to edit that but failed.

    I checked the increasing of Y position, and it have this formula: Set Y position to Y("Player")+1. I tried to make Y("Player")+0.5 but it failed (I think is not possible of move 0.5 pixels hehe). So I'm out of ideas, how should I modify the Gravity so the player goes up and down more slower?

    I was thinking on make a Counter that have number 5, and each fast loop decrease it by 1, and when it reaches 0, then activate the "Set Y position to Y("Player")+1" event, and start again with number 5 in the same Counter. So that way the process of adding 1 pixel to the position will be slower than original. But I don't know if that could work.

    I hope you can help me, thanks!

    EDIT: I forgot to ask you something, is there a way to check how many pixels the player jumps or dash in a game like MegamanX so we can easily emulate them? Or it's just by trying? Thanks again.

  2. #2
    No Products Registered

    Join Date
    Dec 2008
    Location
    U.S.
    Posts
    133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problems with Gravity.

    Did you read the entire tutorial? Also, that tutorial (this is other people's opinion) may be a little advanced for someone new.

  3. #3
    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: Problems with Gravity.

    The tutorial does use some fairly advanced ideas for people completely new to programming, but it sounds like you have a fairly good understanding of what's going on.

    You're right that you can't move an object by less than a pixel per frame - the idea of counting off a value every frame and only allowing a change when that's a certain value will work - I use that in a few places myself when moving 1 pixel per frame is still too fast. However, it might be easier in this case to just lower the amount that the gravity variable is increased per frame (I think it's 0.7 in the tutorial, from memory...) - alterable values can hold values that aren't whole numbers!

    There was someone making a Mega Man game like this ages ago - to get completely accurate jumps to the original movement, what he did was to record the jumps in an emulator, then counted the pixels to see how far the player character moved on each frame.

    And welcome to the forums, and MMF2

  4. #4
    No Products Registered

    Join Date
    Dec 2008
    Location
    U.S.
    Posts
    133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problems with Gravity.

    Yes, that's hwat I meant because later in the tutorial, you change grav from always adding 1 to adding 0.5 or something.

  5. #5
    No Products Registered

    Join Date
    Sep 2009
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problems with Gravity.

    Thank you for the answers. I've edited some values and I think I reached almost the same jumping height and speed. Now I'm looking for A.I. tutorials or something because I need to add movement to an enemy.

    Also, I'm maybe a noob in MMF2 but I have time editing and programming SMW (Super Mario World from SNES), and I have some knowledge since some things are the same.

    And a screenshoot of what I've done:



    EDIT: I don't know hy the picture is rezised. Anyway there is the original link in the original size: http://img245.imageshack.us/img245/8644/shoot.png

Similar Threads

  1. Box gravity
    By gkinfinity in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 18th November 2013, 07:19 PM
  2. Gravity
    By danjo in forum Fusion 2.5
    Replies: 5
    Last Post: 18th October 2013, 07:14 AM
  3. Gravity
    By Degamer in forum The Games Factory 2 - Technical Support
    Replies: 7
    Last Post: 12th July 2010, 07:11 PM
  4. New Gravity
    By Guitaristinmakin in forum File Archive
    Replies: 7
    Last Post: 16th December 2007, 04:24 PM

Posting Permissions

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