🛞[Java Project]TankGame_EN
00 分钟
2024-5-6
2024-5-11
type
status
date
slug
summary
tags
category
icon
password

[Java Project]TankGame_EN(English)

A beginner's project to learn Java and strive to achieve playability in the end.
Project source: Teacher Han Shunping[https://space.bilibili.com/651245581]

Website:
Source Code:
TankGame_Java
ZZHow1024Updated May 12, 2024
Releases:

Instructions for use

  • Determine the operating system you are using
    • Windows:
      • Select .zip package/.exe installation package/.msi installation package
    • Linux:
      • Select .deb installation package/ .rpm installation package
    • macOS:
      • Select .dmg disk image/ .pkg installation package
  • Download the corresponding file.
  • Windows can directly run .exe files, while Linux and macOS require installation operations before running.

Function Introduction

  • TankGame1.0
    • Form title and icon display
    • Game panel drawing (gray rectangle)
    • Our tank is drawn and can be controlled to move up, down, left, and right using the WASD key
    • Enemy tank drawing, immovable
  • TankGame2.0
    • Enemy tanks can move randomly
    • Enemy tanks can fire bullets randomly
    • Our tank can fire bullets through the space bar
    • Game victory/failure judgment
    • Show game time
    • Game start confirmation
    • Game replay

Summary of knowledge points

  • TankGame1.0
    • Java Collection Class(Vector)
    • Java drawing(JFrame classPanel classGraphics class and Color class)
    • Reading images(getImage() method and getResource() method)
    • Keyboard Listening(KeyListener Interface and keyPressed() method)
  • TankGame2.0
    • Java multithreading (extends Thread class/implements Runnable interface)

Renderings

Tank Game 1.0
Tank Game 1.0
Tank Game 2.0
Tank Game 2.0