?
Solved

smooth jump

Posted on 2009-12-20
1
Medium Priority
?
423 Views
Last Modified: 2013-12-26
I am making a 2D platform game that scrolls vertically on higher  platforms  .

MY issue is when i reach a certain height I want the screen to move down. I can do this but it looks awkward.

If I jump up at over 300pixels on screen I then move all objects down to so the player only ever can stand on 300px . IT look a little jerky when the screen moves down suddenly.
0
Comment
Question by:jagguy
1 Comment
 
LVL 1

Accepted Solution

by:
Kagetsuki earned 2000 total points
ID: 26096506
Without more information and perhaps a sample of your code it's difficult to give you specific advice, but it sounds like you only need to test when the player is above 300px and if that is the case have jumps not elevate the player but rather shift the world down (Super Mario World style). Some meta-code for you is attached. In the ShiftScreen function there you'll want to move the screen down and the player down, say shifting the screen down at twice the rate of the player. That way the player will float more toward the middle of the screen after the translation. That jump function there is also extremely primitive, since I don't know what your code looks like I just wrote something fairly basic that I thought would be easy to understand.


Jump(float time) //reduce time each step untill the jump has ended
{
    if (time <= 0.0f)
        return;

    if (Player.Y >= 300)
        ShiftScreen(time);
    else
        Player.Y += jumpHeight / time;
}

Open in new window

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question