Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Wtf, i cant make it to got curved(Not shure how to say(curved))

Author
Message
FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 20th Dec 2008 17:30
hi i am making my game and i got to the point of controls for the left rifht forward..blablabla

so first i made the basic left right forward backward stuf whit this code


It worked grait....but i notice whille debugin you can go like curved(when pressing w and d or w a it goes just whats pressed the last(forward(back.)or left and right

it would be greit if somebody could teell me how to make it go curved
i tryed this code but it didnt even detect it(the picture)


i also try this

dosent make any difrence.

Game.Love
FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 20th Dec 2008 17:34
NO mathere i solve it i forgot the
strcmp in the second function.

Game.Love
FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 20th Dec 2008 17:45
have new problem.

if i use this:


it goes curved but if i hold just w it workes the sain(curved)

Game.Love
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 20th Dec 2008 18:09 Edited at: 20th Dec 2008 18:09
You don't have to use strcmp(), in fact you don't have to use strings at all. Just use dbKeyState() istead of dbInKey(). dbKeyState() takes a scancode as a parameter and returns a 1 if the given key is being pressed and a 0 if not.

FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 20th Dec 2008 18:12
could you show me how to use keystate i am a little confused.

Game.Love
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 20th Dec 2008 19:40
Ya, sorry I was in a hurry when I posted that.

Basically, each key on your keyboard has a code assigned to it, for example 'W' is 17, 'A' is 30, 'S' is 31, and 'D' is 32. With the dbKeyState() function, you tell it the code of the key you want to check, and it'll return a 1 if it is pressed, and a 0 if not. If I wanted to check for the 'W' key (17), here's what I'd do:



As for you problem, what exactly do you want your camera to do? How do you want your camera to move?

FIGHTEX
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 20th Dec 2008 20:31
tnx works perfectly.

Game.Love
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 20th Dec 2008 20:55
No problem

Login to post a reply

Server time is: 2024-09-30 13:23:32
Your offset time is: 2024-09-30 13:23:32