Password System help
Ok I am working on a game which I would like to add a password System too .
Here is what my screen looks like
U= Up Button
D= Down Button
// Just a guide for the picture
U U U U
# # # #
D D D D
Now this is what I want it to do
I want to make it so when you click the first Up arrow only the first number goes up or if you click the down arrow only the first # goes down
and the same thing for the other 3 Images I made
This is what I have done
I have it so the buttons change the correct int
Add MouseClicked Since I used KeyPressed
This is what I need
All I need now is to check if the password is correct when they place in the password
This was what I was trying
//in run so it always checking
A place to start.
// This is ineffective - always checking is something one
// Ok, very simple - for a game. No supercrunching or anything.
// I suppose we could start like this:
// A little complicated for a starter effort.
int pwStore = new int;
// conceptual - to be coded .....
// We can unroll the loop for simplicity.
for(pwStore.length) = passwordAsInt;
// ..... other code here
int loopControl = pwStore.length;
// this next line is not correct
if(pwStore.[--loopControl] == suppliedValue)
while(loopControl > 0);
// would place in the run loop in a game
Also, for four numbers - the way I have the array is incorrect. Several things in the code are indeterminate until you provide us some feedback....