Fenix Code Help


Nilsiboy

1337 T045T
Joined
Jul 9, 2004
Messages
561
Age
31
Website
Visit site
i just saw what i wrote is stupid... up and down is no diagonal, but impossible...strangely, I can find this nowhere in my code o_0

Anyway, let's just pretend it's up and left.

If I press UP and LEFT together, all three of the lines are used, aren't they?
 

Racemaniac

Scorched GP programmer
Joined
Nov 3, 2003
Messages
587
Website
Visit site
use elsif's...
so
if(up and left)
elseif(left and down)
elseif(down and right)
.........

once one if statement has been satisfied the others won't even be checked, so do all the diagonals first, and if one of them is true the individual directions won't be checked anymore :)
 

Nilsiboy

1337 T045T
Joined
Jul 9, 2004
Messages
561
Age
31
Website
Visit site
mhh..i think you both got me wrong :(
my problem is that it is TOO precise with the diagonals; if you don't hit up and left at the exact same time, you have no chance... and because you cannot hold it down, its too damn hard...

just came to my mind: couldn#t I use while? like
Code:
while(key(_up))
 if(key(_left)...
 if(key(_right)...
end;
 

Goity

VIP Sleaze
Joined
Jun 22, 2004
Messages
5,598
Location
Isle of Ewe
mhh..i think you both got me wrong :(
my problem is that it is TOO precise with the diagonals; if you don't hit up and left at the exact same time, you have no chance... and because you cannot hold it down, its too damn hard...

just came to my mind: couldn#t I use while? like
Code:
while(key(_up))
 if(key(_left)...
 if(key(_right)...
end;
How about

Code:
If(KEY(_up) And Not Key(_LEFT))
Do whatever you gotta do;
END
If(KEY(_up) And Key(_LEFT))
Do something else;
END
?
 
Last edited by a moderator:

Racemaniac

Scorched GP programmer
Joined
Nov 3, 2003
Messages
587
Website
Visit site
mhh..i think you both got me wrong :(
my problem is that it is TOO precise with the diagonals; if you don't hit up and left at the exact same time, you have no chance... and because you cannot hold it down, its too damn hard...

just came to my mind: couldn#t I use while? like
Code:
while(key(_up))
 if(key(_left)...
 if(key(_right)...
end;
well, there's only 1 solution to that: waiting a few frames to see if the user isn't doing a diagonal, however this'll probably result in sluggisch controls if it's something realtime, you'll have to make a choice...
 
Last edited by a moderator:

Nilsiboy

1337 T045T
Joined
Jul 9, 2004
Messages
561
Age
31
Website
Visit site
okay, I thought so already :/
just one more question: does the GP32 have dedicated microswitches for the diagonals in the d-stick? if so, it would be a lot easier to hit them than on the PC ^.^
 

Racemaniac

Scorched GP programmer
Joined
Nov 3, 2003
Messages
587
Website
Visit site
okay, I thought so already :/
just one more question: does the GP32 have dedicated microswitches for the diagonals in the d-stick? if so, it would be a lot easier to hit them than on the PC ^.^
just wondering, what the hell are you making that works realtime and needs different controls for diagonals than for the individual directions combined?
 
Last edited by a moderator:

Nilsiboy

1337 T045T
Joined
Jul 9, 2004
Messages
561
Age
31
Website
Visit site
I'm tring to make a DDR/Rez mashup game, ie you have to press up,down,left,right,diagonals or a or b button, but not in a prepared scheme; the background music itself is gonna be very puristic, but every action produces a different sound

Well, that's how it was thought to be, but first, I got to admit that my programming skills are not that good, so it will go to beta or demo stage and then rot forever most likely, and second, I got the diagonal Problem. I could, however, just leave out the diagonals and thus make the game a LOT easier...
 
Top