Real-time Control software fourth week operation

Source: Internet
Author: User
Tags exit in

    • Ice hockey game system module design:
    1. GUI Window module: Responsible for the entire game interface drawing, as the entire game software operating vector, the current plan to use the QT form program to create the main window of the game;
    2. OpenGL module: The drawing of the game elements in the GUI window;
    3. Physical Engine module: responsible for the calculation of physical logic, mainly collision and speed;
    4. Timer module: Responsible for controlling the drawing frequency;
    5. Game elements
    • Processing of AI Logic:

The main is how to make robot AI judge the trajectory of the ball and intercept.

    • The specific design is as follows:

Module interface: All modules should not use constructors and destructors to ensure initialization and exit in a certain order. Use startup and shutdown instead of constructors and destructors.

1#include <QObject>2 3 classBasemanager: PublicQobject4 {5 Q_object6 7  Public:8 9     Virtual voidStartUp () =0;Ten     Virtual voidShutDown () =0; One  A  PublicSlots: -  -     Virtual voidUpdate () =0; the};

OpenGL Manager: The general framework is as follows, details to be perfected.

1#include <QOpenGLWidget>2#include"Basemanager.h"3 4 classOpenglmanager: PublicQopenglwidget, PublicBasemanager5 {6 Q_object7 8  Public:9 Ten     Staticopenglmanager*getinstance (); One  A     voidStartUp (); -  -     voidShutDown (); the  -  PublicSlots: -  -     voidUpdate (); +  - protected: +  A     voidPaintEvent (Qpaintevent *Event) Q_decl_override; at  - Private: -  - Openglmanager (); -  -     Staticopenglmanager*m_pinstance; in  -};

  

Real-time Control software fourth week operation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.