![]() ![]() Creates a new thread so our GUI can process itselfĮventQueue. SetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) 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! Property Data Types Here is a short overview of the data types used to add properties to the game. I am asking those who are more advanced programmers to help me with implementing programming techniques, better organization, how to comment better, etc. How to Code the Classic Snake the Game To keep the article simple, the following section is divided into different steps of coding the game. ![]() 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. The game can be configured (in the Board.java) file to edit the number of snakes on the board, how each snake is controlled (at most two snakes can be controlled by humans using the WASD or arrows keys), the game speed, and the board size. I am a self - taught coder, and have been learning Java / C# for the last 2 1/2 years (inconsistently). The SnakeAI2.java file is a template for anyone else that wants to try creating their own AI. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |