Page 1 of 1

Key Down within Filled Region?

PostPosted: Sun Apr 22, 2007 6:07 pm
by d-soldier
So I had a small filled region over my spite "control panel" which activates a lift... thought everything was fine because when my player stood there (where the invisible filled region was) and pressed "e" the lift would activate (activation event from the filled region on "keydown" to the lift)... sure enough, turns out that the lift activates anytime I press "e" from anywhere on the map. So how can I set it up to send ythe activation event only when the player is within the filled region?

PostPosted: Sun Apr 22, 2007 6:29 pm
by pixelpoop
easy non-coding way would be to have an actor created when you step onto (collision) the lift and destroyed when you step off. On this new actor you could have the e button event.

...

PostPosted: Sun Apr 22, 2007 7:32 pm
by d-soldier
Genius! I was so fixated on the filled region it didnt even occur to me to use a non-drawn actor....

PostPosted: Sun Apr 22, 2007 10:01 pm
by Sgt. Sparky
xD
yeah, I bet you're game is going to be AWSOME!!! :D

PostPosted: Sun Apr 22, 2007 11:37 pm
by Game A Gogo
another way to make it whotout the need of creating destroying the actor would be:

Collision repeated on the filled region
char*key=GetKeyState();
if(key[KEY_E]==1)
{
//lifting action here
}[code][/code]

PostPosted: Mon Apr 23, 2007 3:34 am
by Sgt. Sparky
Game A Gogo wrote:another way to make it whotout the need of creating destroying the actor would be:

Collision repeated on the filled region
char*key=GetKeyState();
if(key[KEY_E]==1)
{
//lifting action here
}[code][/code]

[KEY_e] not [KEY_E] xD

PostPosted: Mon Apr 23, 2007 11:25 pm
by Game A Gogo
iwasnt sure x3

PostPosted: Tue Apr 24, 2007 3:56 am
by Sgt. Sparky
xD
the only reason I know is because I looked at the xml function list,
and because I kept on doing the wrong thing! xD