
-----------------------------------
Mayb123
Thu Nov 22, 2007 12:28 pm

Jump help
-----------------------------------
Hello fellow programmers. i'm trying to make a jumping procedure where height is determined by how long you hold the 'w' key, but it adds a fraction of the speed, but say, if you let go partway up the jump, the arc of the jump is lower and you fall down. for example, in N-Game, if anyone here has played it, the longer you hold the jump button, the higher you jump, but there's still a limit. what kind of code would i use?

procedure jump %fix this part by adding horizontal motion

if y > mcrad then
        vy -= gravity
    else
        vy := 0
        end if
    if vy = 0 and key ('w') then
vy+=3
    end if    
    
%     if vy=0 and key ('w') and y>=platformx2(1) and y>= platformy1(2)
%     % if key ('w') then
%     %     vy += ax
%     %
%     % % end if
%     % % if round (y) > 10 then
%     % %     ax += gravity %Fix these
%     % % end if
%     % if round (y) 