Gamestudio Links
Zorro Links
Newest Posts
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
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
C_move #381230
08/25/11 15:20
08/25/11 15:20
Joined: Aug 2011
Posts: 4
R
Ragada Offline OP
Guest
Ragada  Offline OP
Guest
R

Joined: Aug 2011
Posts: 4
I have this code:
if(key_w) c_move(camera, vector(camera.x,camera.y, camera.z),vector(camera.x+10,camera.y, camera.z),IGNORE_PASSABLE);
and I want to move camera forward for 10. Ist that code right, or how can I correct it? Please help me.
//correct me if I'm wrong
c_move(what, vector_from, vector_to, mode);
Please show me correct code for moving with camera forward.

Re: C_move [Re: Ragada] #381237
08/25/11 15:33
08/25/11 15:33
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
This "c_move(what, vector_from, vector_to, mode);" is nonsense - did you have a look into the manual?
You are mixing up two different functions: c_trace is not the same as c_move!

Re: C_move [Re: Ragada] #381239
08/25/11 15:38
08/25/11 15:38
Joined: Aug 2005
Posts: 14
Bayreuth, Germany
S
swerning Offline
Newbie
swerning  Offline
Newbie
S

Joined: Aug 2005
Posts: 14
Bayreuth, Germany
Hi,

the problem is that you can only move entities with c_move, therefore you have two options:

camera.x+=(key_w-key_s)*5*cos(camera.pan); // 5 is the move speed
camera.y+=(key_w-key_s)*5*sin(camera.pan);

This code updates the camera position manually but does not use collision detection, i.e. the camera can move through walls.

The second option would be to create an entity, make it invisible, move and rotate that entity with c_move and c_rotate and put the camera position/angle at its position/angle.
Hope that helps, best

Stefan


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