Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,486 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 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 | chip programmers | 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