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
ZZHow1024 • Updated 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 class
、Panel class
、Graphics class
andColor class
) - Reading images(
getImage() method
andgetResource() method
) - Keyboard Listening(
KeyListener Interface
andkeyPressed() method
)
- TankGame2.0
- Java multithreading (extends
Thread class
/implementsRunnable interface
)
Renderings
- 作者:ZZHow
- 链接:https://zzhow.com/TankGameEN
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。