Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, AndrewAMD, NewbieZorro), 16,055 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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