Quote:
Originally posted by LiquidIce00
vecx and vecy is weird but it works.
erm ill try to explain what it does and how it does..
what it does is ..
it returns a -1 or a 0 or a 1 . depending on the playerdir. and its used to move things ''forward'' or backwards or whatever..
if you do
playerx+=vecx(playerdir);
playery+=vecy(playerdir);
it will move the player 1 spot forward. (the way hes facing)
how it does is simple..
ill tell you in english
if playerdir is 0 (up) vecx returns 0 and vecy -1
if playerdir is 1 (left) vecx returns -1 and vecy 0
if playerdir is 2 (down) vecx returns 0 and vecy 1
if playerdir is 3 (left) vecx returns 1 and vecy 0
its also usefull for triggeraction
triggeraction playerx+1.5+(vecx(playerdir)*2),
playery+2+(vecy(playerdir)*2),blabla;
=)
|
Thanks man. Now I understand how to use Vec better. I still dont quit get triggeraction but i may learn if I keep playing with it. Thanks again =D