-
Notifications
You must be signed in to change notification settings - Fork 64
Fixed the username text position, changed the username text color due to low visibility on sand #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed the username text position, changed the username text color due to low visibility on sand #16
Conversation
Fixed the position for the username text and cached the divisions.
| this.colour = Colours.get(-1, 111, shirtCol, faceCol); | ||
| fireRate = Small.FIRE_RATE; | ||
| // Perfectly matches the text over the head | ||
| nameOffset = (userName.length() / 2) * fontCharSize - ((userName.length() & 1) == 0 ? fontCharSize / 2 : 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might consider splitting the equation from the ternary for readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right about that, didn't observe its over 80 characters long.
| private int fireRate = 0; | ||
|
|
||
| // Need to add a class for constants | ||
| private int fontCharSize = 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could probably be "final" :-)
|
Overall good commit (code wise), didn't yet check it in the game itself though! |
|
I’ll take a look when I get home and pull this commit, thanks for the help!
Edit: Removed email reply
|
ThoughtsI agree it is difficult to see the name tag over the sandy areas, An excellent idea. Issue I foundThe code works only if you input a desired username, however if you blast through without typing a username it isnt aligned at all. Guest names are generated only when the username box is empty. My solutionHowever, I have a solution moving This line into this part. I'm guessing it is because it is after the 'temporary/guest' name has been made. What do you thinkDo you know why this is happening? Do you have another way to deal with this or are you going to try my solution, I'm open to opinions. |
|
Yes, this is because the username initially is blank and gets modified on the go to be replaced with the "guest" one. |
|
It looks a bit ugly (2 lines of code are repeating, could just use a function) + if the name is only 1 character long, its going to recalculate the offset again, but its perfectly aligned over the head. |
|
Thanks for your time and effort |
|
No problem, the pleasure is mine. |
|
I messed up sorry, would you like to push the changes again, I overwritten the master directory when I was merging from previous work |
|
I've not used GitHub/Git in ages and I foolishly pushed a bad merge that was old, And 'reverting merge' opens a new pull request which I didn't know |
|
I made another pr to be easier. |


Changed the name color due to low visibility on sand;
Fixed the position for the username text and cached the divisions.