# mcf1lmnfs

Member Since 08 Nov 2011
Offline Last Active Jun 30 2012 12:25 AM

### In Topic: how to find view angle from display size

31 May 2012 - 03:17 PM

thank you very much, i will test this method after a week, and i will iform you about a result, i cant check it right now =/

### In Topic: Changing a billboard-enemy sprite

30 May 2012 - 07:42 PM

you are right with "there has to be a relation between the camera's direction and the enemy's"

for example if he has the same dir like you he is going to be faceing away from you, so you will see his back,

the pseudocode for this is

if abs(enemy.dir-my.dir)<45 degrees
his.picture=facing_away
else if abs(enemy.dir-my.dir-90degrees)<45 degrees
his.picture=facing_left
else if abs(enemy.dir-my.dir+90degrees)<45 degrees
his.picture=facing_right
else
his.picture=facing_toyou

you should change this code a little though it is a pseudocode!!! with some commemnts arround

for proper working of this code dir shoud be in degrees and you shoud limit it between 0 and 360
if dir<0
dir+=360
if dir>360
dir-=360

### In Topic: Keyboard Check Direct

13 May 2012 - 09:23 PM

```{
if(checked=0&&keyboard_check_direct(ord('S'))=1) then checked+=1
else if(checked=1&&keyboard_check_direct(ord('U'))=1) then checked+=1
else if(checked=2&&keyboard_check_direct(ord('D'))=1) then checked+=1
else if(checked=3&&keyboard_check_direct(ord('E'))=1) then checked+=1
else if(checked=4&&keyboard_check_direct(ord('K'))=1) then checked+=1
else if(checked=5&&keyboard_check_direct(ord('I'))=1)then {
checked=0;
//some functions...
} else if(keyboard_check_direct(vk_anykey)=1){checked=0;}```

i don't whether this is the problem, but you should know this:
These keyboard checking doesn't check in which order the keys are typed.
But before I can look to the problem you need to specify the problem, do you get any errors or not.

<{POST_SNAPBACK}>

It does check in which order the keys are typed. That is the checked variable.
the problem is that the script reloops when your still holding the s key down.(the program is faster then you can release the button) Then this piece of code comes in action: } else if(keyboard_check_direct(vk_anykey)=1){checked=0;}

I hoped to solve that problem with this:
do{}until(keyboard_check_direct(vk_anykey)=0)

But it still doesn't work. And without resetting checked you could typ in ssuuddeekkoofffnneeii and it will still read sudeki. That's my problem.

EDIT:
Solved a little bit but I have trouble with vk_nokey and vk_anykey.

edit by t3mp3st... I edited the content in your following two posts into this one. Please note that while many sections have a bumping allowance after one day, in Novice/Advanced it is 3 days, so you're bumps were deleted.

keyboard_check_direct(vk_anykey) will never work correctly, because that gives the same result like keyboard_check_direct(mb_left)

vk_anykey should never be used with direct checking!!!

(sorry for so late reply, i know that it is to late but i wrote that in hope that the same problem wont happen to someone again)

### In Topic: Windows Key

13 May 2012 - 09:03 PM

that is true, but soulution to the given problem still hadn't been here, so i wrote it down. I hope that somebody will find that useful =)

### In Topic: Windows Key

13 May 2012 - 12:33 AM

try using keyboard_check_direct(91) that should give you true when left windows key is pressed and holded
for right one use 92 insted 91

please reply to this post, and tell me if it is working as you wanted,  all coments are welcome