I caught my files nefariously drinking mustard in my documents folder - Thanks Electric File Monitor!
Brastin
83
Posts
1
Topics
150
Followers
25
Following
A member registered Jul 06, 2017 · View creator page →
Recent community posts
Sunbound (64p Starbound Clone) jam comments · Replied to darida12321 in Sunbound (64p Starbound Clone) jam comments
Oh yeah that was so annoying. The way I fixed it was instead of checking if a key was pressed using keyPressed and checking hat key was being held at the time, I had up, left, down, and right variables. In the keyPressed() function I check what key is pressed and change the variable to true, and in the keyReleased() function I check which key gets released and change the variable to false. This way you can check if multiple keys are pressed at a time, and it doesn't do that weird thing where it can't decide what key is being pressed. Sorry if that was confusing but I hope it helped :)
Heres an example with two buttons (left and right)
boolean left; boolean right; int x; void keyPressed(){ if(keyCode==LEFT||key=='a'){ left=true; } if(keyCode==RIGHT||key=='d'){ right=true; } } void keyReleased(){ if(keyCode==LEFT||key=='a'){ left=false; } if(keyCode==RIGHT||key=='d'){ right=false; } } void move(){ if(left){ x--; } if(right){ x++; } }
Sunbound (64p Starbound Clone) jam comments · Replied to renato_grottesi in Sunbound (64p Starbound Clone) jam comments
Sunbound (64p Starbound Clone) jam comments · Replied to darida12321 in Sunbound (64p Starbound Clone) jam comments