control

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Guest

Post by Guest »

Check out the tutorial to see how to handle a key no longer being pressed down. In this case you'd could set the velocity to 0
Cleves
Posts: 224
Joined: Mon Sep 08, 2003 6:40 pm

Post by Cleves »

ya i already done it...thanks anyway
Cleves
Posts: 224
Joined: Mon Sep 08, 2003 6:40 pm

Post by Cleves »

mmm...i can't find the tutorial your talking about.
t

Post by t »

you can handle it like this:

Code: Select all

	if (event.KeyInput.Key == KEY_KEY_W)
		{
			if (event.KeyInput.PressedDown) 
			{
				ship_velocity.Y = 4;
				

			} else
			{
				ship_velocity.Y = 0;
				//if (ship_velocity.Y > -2)

			}
		}
Cleves
Posts: 224
Joined: Mon Sep 08, 2003 6:40 pm

Post by Cleves »

mmm..it's exaclty what i have done..but dosen't seem to work..i'll go and double check everything :o
Cleves
Posts: 224
Joined: Mon Sep 08, 2003 6:40 pm

Post by Cleves »

ok i got it, everything works fine.

Thanks a lot,t.
t

Post by t »

No problem :)
Maybe I shoudl write a short tutorial about this kind of thing.
Cleves
Posts: 224
Joined: Mon Sep 08, 2003 6:40 pm

Post by Cleves »

it will be a great idea :lol:
WingedWarrior
Posts: 8
Joined: Mon Nov 10, 2003 2:34 pm

Post by WingedWarrior »

Hi all

The code below posted by 'T', excellant. :D

One question though, does anyone know how to / have any code to rotate the camera up and down (ie X & Z rotations), the center of the rotation being the target (ie shipnode from the below code fragment).

I have been trying for a few days and can seem to figure it out. :cry:
Post Reply