LoginLogin

Diagonal D-pad values?

Root / Programming Questions / [.]

CreativityCoreCreated:
VAR SPX%=0
VAR SPY%=0
'Then in loop...
IF BUTTON=() == #UP THEN SPY%=SPY%+1
IF BUTTON=() == #RIGHT THEN SPX%=SPX%+1 
'You get the idea, but how do I get diagonal values? I don't wanna use STICK in this. SP relates to SPOFS. 

'Please tell me I'm not dumb... Am I?

i can certify you are a dumb
IF BUTTON()==#UP+#RIGHT THEN PRINT "Both up and right were pressed!"

'Please tell me I'm not dumb... Am I?
No you're not. You just need to learn stuff. Also AND is useful here.
IF BUTTON() AND #ID THEN'AND checks if the value is INCLUDED in what BUTTON sensed. This doesn't return whether the value that BUTTON received is EXACTLY what you want it to be, like == does, but rather if the button is being pressed. There's some binary logic for you.

'Oh. Dammit, I could've thought of that! FFS... Oh well.

i can certify you are a dumb
IF BUTTON()==#UP+#RIGHT THEN PRINT "Both up and right were pressed!"
'i friggin' figured. Why am I so stupid.

'Wait, but then there's SPX and SPY.

You can do it separately:
IF BUTTON() AND #LEFT THEN DEC SPX
IF BUTTON() AND #RIGHT THEN INC SPX
IF BUTTON() AND #UP THEN DEC SPY
IF BUTTON() AND #DOWN THEN INC SPY

'GUESS WHAT! I DIDN'T EVEN F***ING NEED SEPARATE LINES FOR DIAGONAL VALUES! AND CAN ALLOW FOR THAT! THE HELL WAS I THINKING AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

 'GOD 
 'I'M 
 'SO 
 'STUPID 

Umm please don't spam caps. If you ever had read any forum etiquette rules you'd know it's normally seen as bad behaviour

i can certify you are a dumb
IF BUTTON()==#UP+#RIGHT THEN PRINT "Both up and right were pressed!"
You don't help at all with this kinds of statements. You could be more friendly and say "no, you're not dumb, you could do this and that and also this could work" but your comment doesn't add anything of value to the thread. I know I'm no moderator or something but I suggest you to really think if your posts add to the thread before you post them.