Gamestudio Links
Zorro Links
Newest Posts
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
What are you working on?
by rayp. 11/02/26 13:57
No connection to MT4
by JeyKey II. 10/29/26 09:34
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (Quad), 20,420 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
dabolong, MaliceTheMaker, Haitao_Ren, JimSimons, julienp
19249 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Gravity problems #73338
05/06/06 04:20
05/06/06 04:20
Joined: Dec 2003
Posts: 179
Chameleon_Man Offline OP
Member
Chameleon_Man  Offline OP
Member

Joined: Dec 2003
Posts: 179
Hey guys,

I'm having troubles with creating gravity. I'm trying to use c_move, but it doesnt work. So what should I do when I want gravity to be like so...

action char {
my.x += .....;
}

AKA: What should I fill in the dotted lines?

Thanks a ton,
-Harb

Re: Gravity problems [Re: Chameleon_Man] #73339
05/06/06 04:51
05/06/06 04:51
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
First, find the distance you need to travel. The formula for calculating distance travelled with a given constant acceleration rate is this, only without the absolute value bars:



In simple terms, just find the average speed of travel (by adding the old speed with the new speed, the vertical speed) and multiply by the time you spend at this average speed and you have a simple form of acceleration (without drag). It's mainly just the matter of converting between units, mainly quants to feet (or meters), and seconds to ticks (16 ticks make one second).

This'll get you started.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: Gravity problems [Re: ulillillia] #73340
05/07/06 04:16
05/07/06 04:16
Joined: Dec 2003
Posts: 179
Chameleon_Man Offline OP
Member
Chameleon_Man  Offline OP
Member

Joined: Dec 2003
Posts: 179
Thanks for that, but this is just a simple problem of syntax. I just want to know what code I put in the dotted lines to make sure my player moves down, lets say, 5 quants per frame unless it hits a block (don't worry about different modes).

Re: Gravity problems [Re: Chameleon_Man] #73341
05/07/06 05:01
05/07/06 05:01
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
c_move(my, vector(5,0,0), nullvector, glide); // relative direction

or

c_move(my, nullvector, vector(5,0,0), glide); // absolute direction.


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1