In Java development, the Tank Wars project and the 23 design patterns are undoubtedly the classic of the classic, even developers who have been developing for 5 years or even more than 10 years can not say that they have truly mastered the 23 design patterns, I hope you can study hard and master these details.

Tank Wars Project

The tank wars project takes you through a hand-by-hand, line-by-line development process of an online battle game that allows you to understand and use the basics of JavaSE, DesignPatterns, TCP/IP, multithreading, NIO, and more. Truly understand the project development process, and experience the difficulties and pain points of project development. Remember, the true test of what you have learned is to do the project.

Tank Wars project catalog

  1. New opens a window

  2. Set the title bar content

  3. TankFrame inherits + display from Frame

  4. Learn about paint method rewriting

  5. Learn graphics

  6. Learn the Repaint method

  7. Implement MyKeyListener to respond to the keyboard

  8. MyKeyListener inherits from KeyAdapter

  9. Get specific key information

  10. Adjust the tank position according to the specific button to hold the other reference

  11. Abstract out of the tank class learning to use enumeration types to record keyboard state

  12. Put the listener handler class MyKeyListener inside the TankFrame

  13. Handle window closing with anonymous inner classes

  14. Change tank orientation according to button status

  15. Move position according to tank direction

  16. To stop work

  17. Test package knowledge about classLoader

  18. Replaced the tank with a picture version

  19. Draw a bullet and let it fly — for a while

  20. Press CTRL to fire a shell from the MBT

  21. Fire multiple rounds

  22. The bullet was fired from the center of the tank

  23. Bullets die (fly out of the game area)

  24. You don’t need to define rectangle properties new every time

  25. Shell new automatically added to the container when it died automatically removed

  26. Separate players and robots treat boundaries differently

  27. Eliminate flicker with double buffering

  28. Add a bunch of enemy tanks

  29. Do collision detection

  30. According to explosion

  31. Add voice

  32. Make enemy tanks smarter

  33. – Added Group attribute to tanks and bullets

  34. Different groups can bump into each other

  35. Test the use of the Properties class

  36. Establish PropertyMgr class

  37. MV separate Model View separate

  38. GameModel changed to singleton mode

  39. Handling of collisions

  40. Class. forName().newInstance()

  41. Abstract the superclass of the game object

  42. Combine the List of various objects in GameModel into one

  43. List

  44. Improve the chain of responsibility model

  45. Join the wall

  46. Button toggle launch strategy

  47. Implement pause function

  48. Realize the function of saving disks

  49. Test the server loop using Junit

  50. Remove enemy tanks (machine-controlled tanks)

  51. Process received messages

  52. Player new constructor

  53. So that the next person can see who joined first

  54. – Added news of tank orientation change

  55. Refactor the code

  56. Make Player moving true when receiving tank direction change messages

  57. Send message that MBT has stopped

  58. – Send message to MBT to start moving (direction unchanged)

  59. Add bullet and Player impact logic

  60. Added main battle tanks to the List

  61. Complete the online version

Tank Wars project – Architecture video

Tank Wars project tutorial notes

Because the content is too much, xiaobian will not do more introduction, like this article to see the end of the free access

23 design patterns

Directory creation type

Factory Method

Abstract Factory

The Builder

Prototype

Singleton structural type

Adapter Class/Object

Bridge (Bridge)

A Composite

Decorator

Facade

Flyweight

Proxy Indicates the Proxy behavior

Interpreter (Interpreter)

Template Method

Chain of Responsibility

I can’t Command you.

An Iterator.

Mediator

Memento

An Observer

State of affairs

Strategy

Visitor (Visitor)

Below are documents and videos for the 23 design patterns

In Java development, the Tank Wars project and the 23 design patterns are undoubtedly the classic of the classic, even developers who have been developing for 5 years or even more than 10 years can not say that they have truly mastered the 23 design patterns, I hope you can study hard and master these details. These videos and notes are free to share. You can click here to get free screenshots