cocos2dx 写的泡泡龙2014
正式开始尝试写blog, 这里把以前写的cocos2dx小游戏共享出来。 本小游戏是本人几个月前, 一边学习cocos2dx, 一边把学到的东西, 写成一个小游戏的, 当时是本来和另一个策划准备写一个三消类的游戏, 所以就以泡泡龙为题材, 进行第一个小游戏的试水,后
正式开始尝试写blog, 这里把以前写的cocos2dx小游戏共享出来。
本小游戏是本人几个月前, 一边学习cocos2dx, 一边把学到的东西, 写成一个小游戏的, 当时是本来和另一个策划准备写一个三消类的游戏, 所以就以泡泡龙为题材, 进行第一个小游戏的试水,后来因为种种原因, 不能和另一名策划继续将这个三消游戏做到上线了, 于是就想到, 不上线, 这代码基本上也烂在肚子里了, 不如放到网上, 一来给一些同学提供一种参考,毕竟这也是我自己花了心思的。 二来,代码也有些bug,自己可能不会认真调了, 因为这个游戏, 很久不看了,也算是一种和大家学习的机会。
本代码使用的资源, 当时是拿的开心泡泡猫这个游戏里面的资源, 但是这个资源的分辨率很高, 我的电脑根本无法完全显示, 所以就做了适配, 缩小一倍。
在写这个泡泡龙之前, 我基本上把安卓市场上, 下了大概10多个泡泡龙游戏都在玩, 发现品质都不是很高, 而且数据结构上,都觉得不尽如人意,但是有这么两个做得很好,一个是Line的Bubble, 一个就是腾讯应用市场上的:开心泡泡猫。 然后最近好像陌陌上, 也有一个泡泡龙游戏(虽然感觉就是抄的Line的Bubble,不管是程序还是UI, 都很像),应该这三个算做的很不错的吧!我这里以开心泡泡猫资源为蓝本, 如有侵权, 请告知我删除,谢谢!
本游戏还是参考了网上不少代码, 其中最多的应该是一个用HGE引擎写的泡泡龙, 还有一个是用Cocos2dx写的泡泡龙。HGE写的那个,品质相当高, 基本上我用到的算法和数据结构, 都是参考它的,但是它是HGE引擎的, 这个就比较蛋疼。 还有另一个是cocos2dx写的,但是那游戏品质就不是很高了, 于是我就干脆结合开发泡泡猫和策划的需求, 把这两个游戏整合起来,加上自己的需求, 就出来了现在这么一个半成品游戏了。
虽然是半成品, 但是泡泡龙的核心玩法, 还是基本上都实现了, 后期只要加上关卡, 策划想些差异化的玩法, UI搞的好看点, 还是有一些参考价值, 游戏特点:
泡泡的排列不是正方形那种, 而是紧挨,成60度紧挨着的。
搜索算法,是使用遍历, 而不是递归
增加了特殊泡泡金泡泡和银泡泡
** function: 游戏的主逻辑,全部放在此模块中, 主要包括:
1、游戏泡泡和等待发射的泡泡初始化
2、游戏触摸的开关和处理
3、泡泡的碰撞检测和处理(调整泡泡的位置)
4、碰撞后查找相同泡泡的算法
5、泡泡的消除
6、消除后是否有悬挂泡泡的检测
http://download.csdn.net/detail/chenhaobright/6807345
https://github.com/chenhaobright
联系我的可以
关注我新浪微博:http://weibo.com/u/1935620123
或者发邮箱:chenhaobright@gmail.com

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

The difference between clustered index and non-clustered index is: 1. Clustered index stores data rows in the index structure, which is suitable for querying by primary key and range. 2. The non-clustered index stores index key values and pointers to data rows, and is suitable for non-primary key column queries.

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

MySQL supports four index types: B-Tree, Hash, Full-text, and Spatial. 1.B-Tree index is suitable for equal value search, range query and sorting. 2. Hash index is suitable for equal value searches, but does not support range query and sorting. 3. Full-text index is used for full-text search and is suitable for processing large amounts of text data. 4. Spatial index is used for geospatial data query and is suitable for GIS applications.

In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.

MySQL and MariaDB can coexist, but need to be configured with caution. The key is to allocate different port numbers and data directories to each database, and adjust parameters such as memory allocation and cache size. Connection pooling, application configuration, and version differences also need to be considered and need to be carefully tested and planned to avoid pitfalls. Running two databases simultaneously can cause performance problems in situations where resources are limited.
