Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
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 (AndrewAMD, Ayumi, kzhao, 7th_zorro), 739 guests, and 7 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
move var question #154799
09/17/07 11:42
09/17/07 11:42
Joined: Jan 2007
Posts: 295
Portugal
Sam_Be Offline OP
Member
Sam_Be  Offline OP
Member

Joined: Jan 2007
Posts: 295
Portugal
hi
if i want that the camera moves forward or sidewards with the keys "wsad" how do i have to define this??
i know how to define it with the til an pan but not to move the camera.
could somebody write here the code??
please
thx
sam


GS-Extra Looking for a scripter Suche einen scripter. Estou a procura de um "Scripter".
Re: move var question [Re: Sam_Be] #154800
09/17/07 11:56
09/17/07 11:56
Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Code:

while (1)
{
if (key_w) camera.x += 3*time_step;
if (key_s) camera.x -= 3*time_step;
if (key_a) camera.y += 3*time_step;
if (key_d) camera.y -= 3*time_step;
wait(1);
}


hope this helps..

Re: move var question [Re: Tobias] #154801
09/17/07 13:05
09/17/07 13:05
Joined: Jan 2007
Posts: 295
Portugal
Sam_Be Offline OP
Member
Sam_Be  Offline OP
Member

Joined: Jan 2007
Posts: 295
Portugal
hi
thanks!!
now i have an other problem:

my script:
____________________________________________________________________________

while (1)
{
mouse_pos.x = mouse_cursor.x;
mouse_pos.y = mouse_cursor.y;
camera.pan -= mouse_force.x;
camera.tilt += mouse_force.y;
if (key_w) camera.x -= 3*time_step;
if (key_s) camera.x += 3*time_step;
if (key_a) camera.y += 3*time_step;
if (key_d) camera.y -= 3*time_step;
wait(1);

}

__________________________________________________________________________

now if i move the camera with the mouse the x and y positions from the wsad keys stay the same, they don't move with the camera. so if i move the camera 180 degrees i can move dackwards with the key "w".
can somebody tell me the sullution??
thx
sam


GS-Extra Looking for a scripter Suche einen scripter. Estou a procura de um "Scripter".
Re: move var question [Re: Sam_Be] #154802
09/17/07 13:22
09/17/07 13:22
Joined: Apr 2007
Posts: 249
Louisana, USA
Ilidrake Offline
Member
Ilidrake  Offline
Member

Joined: Apr 2007
Posts: 249
Louisana, USA
while (1)
{
camera.pan -= mouse_force.x;
camera.tilt += mouse_force.y;
if (key_w) camera.x -= 3*time_step;
if (key_s) camera.x += 3*time_step;
if (key_a) camera.y += 3*time_step;
if (key_d) camera.y -= 3*time_step;
wait(1);
}
This should work (at work so I ain't real sure. Make sure mouse_mode is set to the proper mode though. Maybe someone else can verify this for you. Sorry I can't be more help.


Just Because Your Paranoid Doesn't Mean They Aren't After You...Because They Really Are

http://spearbang.awardspace.com/news.php

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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