Giter VIP home page Giter VIP logo

multi_thread_ball's Introduction

# 弹球
## 作业目标
1. 掌握 Swing 图形用户界面编程以及事件处理等,掌握 Java 绘图技术。

2. 掌握多线程编程的基本原理,能使用 **Runnable**、**ExecutorService** 等接口进行线程的创建、启动等工作。

3. 培养独立查找资料,并解决问题的能力。

## 作业内容
### 1. 设计并编程实现弹球游戏
- 用户能通过 GUI 组件指定生成**小球的数量**,每个小球将从**随机的位置**出现,并具有**随机颜色**,**随机速度**以及**随机的运动方向**,小球沿初始方向匀速运动,当碰到窗口边缘时,小球将依据受力原理改变运动方向。受力只改变小球的运动方向,小球仍按照初始速度匀速运动,不考虑小球之间的碰撞。

- **鼠标**在界面中显示为**方块状**,玩家需来回移动鼠标以避开运动的小球及屏幕四周,如果**鼠标碰到任一小球或者窗口四周**,则游戏结束。

- 程序需提供**计时功能**,并最终显示玩家能坚持多少秒。

### 2. 程序要求
1. 具备相应界面,并通过事件编程,实现相应的GUI组件功能。

2. 在程序窗口区域绘制小球,并以**线程控制小球的移动**,实现动画效果。

3. 实现鼠标与屏幕四周,以及与小球的**碰撞检测**。

multi_thread_ball's People

Contributors

mewchao avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.