当前位置:网站首页>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
边栏推荐
- On the origin of the dispute between the tradition and the future of database -- AWS series column
- vue中缓存组件keep-alive
- Leetcode question brushing: String 01 (inverted string)
- Gamefi active users, transaction volume, financing amount and new projects continue to decline. Can axie and stepn get rid of the death spiral? Where is the chain tour?
- 这些地区考研太疯狂!哪个地区报考人数最多?
- 基于SSH框架的学生信息管理系统
- Détails de l'annotation des ressources sentinelles
- Separate save file for debug symbols after strip
- 开发者调查:Rust/PostgreSQL 最受喜爱,PHP 薪水偏低
- Stringutils judge whether the string is empty
猜你喜欢

c语言99乘法表
![[Bayesian classification 2] naive Bayesian classifier](/img/44/dbff297e536508a7c18b76b21db90a.png)
[Bayesian classification 2] naive Bayesian classifier

Matrix calculator design for beginners of linear algebra based on Qt development

Leetcode question brushing: String 06 (implement strstr())

西瓜书重温(七): 贝叶斯分类器(手推+代码demo)

Disruptor local thread queue_ Use transprocessor processor and workpool to compare consumption - Notes on inter thread communication 005

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

Detailed explanation of retrospective thinking

Leetcode: String 04 (reverse the words in the string)

Disruptor本地线程队列_使用transProcessor处理器和WorkPool两种方式进行消费对比---线程间通信工作笔记005
随机推荐
Leetcode: hash table 08 (sum of four numbers)
C primer plus learning notes - 3. Character IO (input / output)
Development of NFT for digital collection platform
Feitian +cipu body brings more imagination to the metauniverse
证券开户安全吗,有没有什么危险呢
leetcode刷题:哈希表08 (四数之和)
【protobuf 】protobuf 升级后带来的一些坑
710. 黑名单中的随机数
Leetcode question brushing: String 05 (Sword finger offer 58 - ii. left rotation string)
Sword finger offer II 098 Number of paths / Sword finger offer II 099 Sum of minimum paths
Leetcode question brushing: String 03 (Sword finger offer 05. replace space)
Detailed explanation of stored procedures in MySQL
windows系统下怎么安装mysql8.0数据库?(图文教程)
What are the specific steps for opening a stock account? Is it safe to open an account online?
后台查找,如何查找网站后台
Arduino UNO + DS1302利用31字节静态RAM存储数据并串口打印
Is it safe to open an account for CICC Wealth Online?
GameFi 活跃用户、交易量、融资额、新项目持续性下滑,Axie、StepN 能摆脱死亡螺旋吗?链游路在何方?
Detailed explanation of shutter textfield
[most detailed] the latest and complete redis interview (70)