realbasic-games
[Top] [All Lists]

Re: Accelerated Jump

To: "REALbasic Games" <REALbasic-Games at lists dot realsoftware dot com>
Subject: Re: Accelerated Jump
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Wed, 15 Oct 2003 08:43:44 -0500
References: <3F8CC455 dot B57D4BA7 at prodigy dot net>
At 10:51 PM -0500 10/14/03, Eric wrote:

 >What's the point in having a pair of Set/Get methods? Just make Y_Accel
accessible instead.

Someone told me that I shouldn't access a classes properties directly
from the outside.

That's an exaggeration. A pair of get/set methods exposes your property just as directly as exposing the property itself. Save yourself the hassle.

However now that I think about  an object should be able access it own
properties.

Actually an object can ALWAYS access its own properties.

 >                  So if the hero is standing still the the Y_Accel
would be small ?
                   If he is just walking just a tad bit bigger?
                   Then if he is running then a big number?

 No, he's not accelerating in any of those cases. His Y velocity is
also zero. He's not rising or falling, is he?

I forgot to say - if the hero is standing still then jumps the YAccel
would be small?
If he is just walking and jumps increase it a bit?  Then if he is
running and jumps
YAccel increased more? Is that right?

Ah, now I see! Well, technically these things wouldn't affect YAccel at all; they would only affect how fast he moves forward (his XVelocity). But video games often play loose with the laws of physics, and I've seen ones where running means you can jump higher. Do whatever feels right when you play it.

Cheers,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout           REAL Software, Inc.                |
|    joe at realsoftware dot com       http://www.realsoftware.com        |
`------------------------------------------------------------------'

- - -
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>