当前位置:网站首页>Simple Lianliankan games based on QT
Simple Lianliankan games based on QT
2022-06-26 20:59:00 【biyezuopinvip】
Resource download address :https://download.csdn.net/download/sheziqiong/85788216
Resource download address :https://download.csdn.net/download/sheziqiong/85788216
Simple Lianliankan games .
Overall process
Realize the idea :
Define game model class and game window class , Use the buttons to complete the game interface settings
Algorithm
Mainly in the storage of icons and the judgment of confusion and connection

Storage and disorder of icons : Using one-dimensional array , Assign values to the array two by two , It is a pair of icons , Assign values to an array 1~ Number of icons ICON, The values in the array correspond to the corresponding numbered pictures . Then generate random numbers , Swap the values of array elements in pairs , Achieve disruption
Connection judgment : There are three main types of connections : Straight line connection 、 Connect after turning once 、 Turn twice and connect , As follows :
① Direct connection :

Case 1: Judge that the array element values on the line are all 0.

Case 2: Judge that the array element values on the line are all 0.
②

Connect after turning once :
Order of switching points before connection , Make the point with the smaller abscissa in front .
Case 3: The connection first turns right and then up or down , Judge the inflection point as 0, Then judge the inflection point and the starting point 、 The ends are connected in a straight line .

Case 4: The connection goes up or down and then turns right , Judge the inflection point as 0, Then judge the inflection point and the starting point 、 The ends are connected in a straight line .

③ Turn twice and connect :
The same sequence of switching points before connection , Make the point with the smaller abscissa in front .
Case 5: Go up or down to a point first , Take a turn to the end ( The points that the connection passes through initially store pictures ).


Case 6: Go left or right to a point first , Take a turn to the end ( The points that the connection passes through initially store pictures ).
Case 7、8、9、10: When connecting, the connection passes through the area where the icon is not stored

unit testing
Output through the application , Generate window , Play games
unit testing
test result
The game can run normally , Each button can be used normally
Harvest
Use multiple at the same time for the first time .cpp File implementations call each other
Learned the game design concept of separating the game model from the form
To study the Qt Many functions of the button class
Normal use
Harvest
Use multiple at the same time for the first time .cpp File implementations call each other
Learned the game design concept of separating the game model from the form
To study the Qt Many functions of the button class
Resource download address :https://download.csdn.net/download/sheziqiong/85788216
Resource download address :https://download.csdn.net/download/sheziqiong/85788216
边栏推荐
- SentinelResource注解詳解
- 分布式ID生成系统
- [serialization] how to master the core technology of opengauss database? Secret 5: master database security (6)
- [most detailed] the latest and complete redis interview (70)
- 回溯思路详解
- Distributed ID generation system
- Bonne Recommandation: développer des outils de sécurité pour les terminaux mobiles
- Matrix calculator design for beginners of linear algebra based on Qt development
- Dynamic parameter association using postman
- MySQL - table creation and management
猜你喜欢

【山东大学】考研初试复试资料分享

Three basic backup methods of mongodb
![[serialization] how to master the core technology of opengauss database? Secret 5: master database security (6)](/img/a8/622cddae2ac8c383979ed51d36bca9.jpg)
[serialization] how to master the core technology of opengauss database? Secret 5: master database security (6)

MySQL - table creation and management

众多碎石3d材质贴图素材一键即可获取

记录一次Redis大Key的排查

leetcode刷题:字符串02( 反转字符串II)
![[Bayesian classification 2] naive Bayesian classifier](/img/44/dbff297e536508a7c18b76b21db90a.png)
[Bayesian classification 2] naive Bayesian classifier

Leetcode: hash table 08 (sum of four numbers)

【连载】说透运维监控系统01-监控系统概述
随机推荐
c语言简单的登录
Is it safe to open a securities account? Is there any danger
MySQL stored procedure
Matrix calculator design for beginners of linear algebra based on Qt development
[Bayesian classification 2] naive Bayesian classifier
Review of watermelon book (VII): Bayesian classifier (manual push + code demo)
不要做巨嬰了
与 MySQL 建立连接
GameFi 活跃用户、交易量、融资额、新项目持续性下滑,Axie、StepN 能摆脱死亡螺旋吗?链游路在何方?
30. concatenate substrings of all words
Development of NFT for digital collection platform
Is there any risk in opening a mobile stock registration account? Is it safe?
Redis + Guava 本地缓存 API 组合,性能炸裂!
lotus configurations
C exercise. Class list plus records, display records and clear records
Comment installer la base de données MySQL 8.0 sous Windows? (tutoriel graphique)
On the origin of the dispute between the tradition and the future of database -- AWS series column
JWT operation tool class sharing
定长内存池
回首望月