PDA

View Full Version : just curious


Angel_Light
10-06-2007, 06:36 AM
On my ti calc I can simple do x+(k=24)+(k=26)->x so could I do this in GS2?


function onKeyPressed( code, char)
{

k = code;

player.x += ( k == 39) - ( k == 37);
player.y += ( k == 40) - ( k == 38);

}


which mean if "k" equals 37 it would be true or in binary 1 and not 0 and so on and so forth.

Tolnaftate2004
10-06-2007, 06:40 AM
Sure, why not.

DustyPorViva
10-06-2007, 07:42 AM
Best bet is to try it out and see.
If not, post it to the ideas section, I like it.

napo_p2p
10-06-2007, 07:53 PM
Yes, you can do that.

Zanzel
10-08-2007, 12:24 PM
Don't see why you shouldn't try :p

coreys
10-08-2007, 05:29 PM
Yeah, you can do condition checks in parenthesis, and it'll return 1 or 0.

Kyranki
10-08-2007, 07:26 PM
Interesting.

Googi
10-09-2007, 05:23 AM
Even in GS1 you could do this.

Zanzel
10-09-2007, 07:22 AM
really :o ?
I didnt think you could much in gs1 :p
well, as much as you can in gs2 anyway.

Angel_Light
10-09-2007, 01:54 PM
http://forums.graalonline.com/forums/showthread.php?p=1351369#post1351369

zokemon
10-09-2007, 06:14 PM
I actually prefer coding like this and almost always do as it usually shortens the number of lines you have to use and fits your algorithms in a nice package.