Discussion forum > Suggestions
Pedometer Command
LIEKABOWSE:
--- Quote from: CazualxGrenade on July 02, 2013, 07:27:46 am ---//wand and //count to us Players? Negative. Plus there would be no way staff would give us that.
But anyways this is mcoon's topic not mine right? :P
--- End quote ---
I don't see a problem with it, but meh I see your point. Anyways back ontopic time.
Yeah, I agree with this now.
mcoon1:
I'm thinking something as simple as:
(click to show/hide)float dis=0;
onTick(){
if(upkey.ispresssed) || downkey.ispressed){ if(upkey.ispressed && downkey.ispressed) { } else{ dis+= walkspeed/ticksPerSec;
if(leftkey.ispresssed) || rightkey.ispressed){ if(leftkey.ispressed && rightkey.ispressed) { } else{ dis+= walkspeed/ticksPerSec;
}
void clear(){
dis=0;
}
void read(){
cout<<dis;
}
Simple. Quick. Done.
LIEKABOWSE:
--- Quote from: mcoon1 on July 02, 2013, 07:44:46 am ---I'm thinking something as simple as:
(click to show/hide)float dis=0;
onTick(){
if(upkey.ispresssed) || downkey.ispressed){ if(upkey.ispressed && downkey.ispressed) { } else{ dis+= walkspeed/ticksPerSec;
if(leftkey.ispresssed) || rightkey.ispressed){ if(leftkey.ispressed && rightkey.ispressed) { } else{ dis+= walkspeed/ticksPerSec;
}
void clear(){
dis=0;
}
void read(){
cout<<dis;
}
Simple. Quick. Done.
--- End quote ---
Wait uhm, with the arrows, are you meaning for WSAD or just a seperate function for the arrow keys?
mcoon1:
Ya. Sorry about that. It was pseudocode, afterall.
raul7legend:
I was thinking about pedometer. You got me confused for a sec :p
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version