realbasic-games
[Top] [All Lists]

Jumped up and never came back

To: Realbasic - Games <REALbasic-Games at lists dot realsoftware dot com>
Subject: Jumped up and never came back
From: Eric <cire- at prodigy dot net>
Date: Mon, 13 Oct 2003 13:48:20 -0500
Hello -

I'm making some progress on my project but
I'm having just a little problem with jumping and landing.

So far my hero will jump up and float away.
I need to figure out how to have him jump up then when he
reaches a point  fall back down until he reaches the ground or
block/platform whatever.

I know I'll need to check map data to see what he "lands" or is on
but I'll do that later. Right now I just need to get the Jumping
and landing thing.

When the hero is on the ground his Y is 350.

This is what I have for it so far:

Next Frame event

Pike.update
.
.

  if me.keytest(&h37) then // command (jump)

    if  pike.get_Jumping  then
       Pike.jumpCont
    else
       Pike.JumpStart
    end if
        Pike.set_Jumping(true)
 else
        pike.set_jumping(false)
 end if


Hero_class

  JumpStart()

  if Y_Velocity = 0 and not jumping  then
    Y_Velocity = -16
    Jumping = true
  end if

JumpCont()
  if Jumping then
    Y_Velocity = Y_Velocity - 13
  end if

JumpEnd()
Jumping = False

Update()
hero_Sprite.y = hero_Sprite.y + Y_Velocity

Thanks

Eric Richards


 - - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>