Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 831 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
accelerate problem #364521
03/18/11 22:05
03/18/11 22:05
Joined: Apr 2009
Posts: 141
dakilla Offline OP
Member
dakilla  Offline OP
Member

Joined: Apr 2009
Posts: 141
hey, I have used accelerate and vec_accelerate a lot recently however I am completely frustrated with it in this occasion. Is it that I cannot use vec_accelerate and accelerate in the same function? - I cannot see a reason why not, however when I try and use this code:

var aspeed = 0;
vec_add(camera.pan,accelerate(aspeed,0,0));

The variable aspeed switches between 9 and -9 within every second and the camera pans all over the place. Notice that there is no input into the acceleration function and no friction, so all i would expect is there to be no camera movement. If it means anything, in the same function I am using vec_accelerate but all of the variables and vectors have different names.

Thanks for any helps


One day there will be an unfixable bug,
That day is not today.
Re: accelerate problem [Re: dakilla] #364524
03/18/11 22:13
03/18/11 22:13
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
you can use vec_accelerate and accelerate as often in as many function as you like.

I am sorry, but "vec_add(camera.pan,accelerate(aspeed,0,0));" is nonsense. vec_add expects two vectors. Accelerate returns the distance to cover in quants, i.e. a scalar. I guess the other two missing vector elements will be random memory from the stack in your case. Apart from that: calling accelerate with a friction and an acceleration of 0 does not make any sense.


Always learn from history, to be sure you make the same mistakes again...

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