![]() ![]() you don't need to repeat the generic type on the right-hand side. I this statement: private LinkedList body = new LinkedList() It's clearer and less likely to cause bugs when being maintained. If fact, I put braces around all the clauses in an if statement. Never put the else clause on the same on the same line as else. Private Snake initSnake() else isCovered = false Public boolean isDirectionChanged = false ![]() Private Direction snakeDirection = Direction.LEFT // initial direction is LEFT Return Math.abs(head.getX() - food.getX()) + Math.abs(head.getY() - food.getY()) = 0 Private LinkedList body = new LinkedList() ![]() Pretty much anything that will help me become a better programmer.Īlso, I have commented a few things out of pure guess, so if it appears as if I have gotten something wrong, please correct me!Īlso, any extra tips for my future projects would be much appreciated! ![]() I am asking those who are more advanced programmers to help me with implementing programming techniques, better organization, how to comment better, etc. I don't really want help on how to make the game better in visuals, levels, or anything like that. I am skeptical on how good of a programmer I am, and I code messy. I have rearranged the program into separate classes & methods. I have recently created a snake game in Java with the help of an online tutorial. I am a self-taught coder, and have been learning Java for the last 2 months. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |