Super Mary 1, classic super Mary

Source: Internet
Author: User

Super Mary 1, classic super Mary
Zookeeper

Written before the game development document (this game was made in the summer of 13 years and lasted for 40 days. It took half a month for the learning engine. The first game had many slots, you can easily view your website. This document was also written at the time, and I am too lazy to fix it and paste it directly ):

I did not consider screen adaptation when writing super Mary. When I finally compiled the code on the Android platform, I found that the screen adaptation should be fixed at the very beginning, so I transplanted the code later. The original resolution of this game is 480*320, and all resources are designed with this resolution. In the final process of screen adaptation, only one line of code is required, the adaptation problem of different screens is fixed, but this solution is not completely solved. The engine provided this method is inherently flawed, but it does not affect the operation and experience of the game.



Stage 1:

Purpose: Display mario on a map. The effect is as follows:

1: create a map in tmx format. The editor used to create the map is the open-source tilemap. This editor is a brick map editor used by many 2D games. The. tmx file generated by the editor can be parsed by the CCTMXTiledMap, CCTMXLayer, and CCTMXObjectGroup types in the cocos2dx engine.

Note: There are many tilemap editors on the Internet. You can search for them.

2: define the role of Mario in the game. The entire game is under control of Mario, so the definition of Mario is crucial. In the current target, you only need to show Mario an image. Without animation, a static image can be translated on the map right and right.

Note: There are two inheritance methods for the main character or monster categories in the game, either inheriting the CCSprite in the engine or inheriting the CCNode in the engine, you can maintain a CCSprite * variable in the class. However, in the game, the author uses the latter method. In this way, when Mario receives collision processing, it shows the nature of CCNode, when switching between States, the private variable CCSprite * can be used to switch the states of Mario (that is, to display an image) and play various Animations (this sort is detailed later ).

3: with a map and a Mario, another layer is required to undertake them. The engine layer is a class with the presentation function, most of the logic in the game is also completed in the layer. Of course, this custom layer CCGameLayer is also inherited from the CCLayer in the engine.

Note: When you add maps and Mario to CCGameLayer, several knowledge points are involved. One is the concept of anchor, which is available on the Internet. I will not elaborate on it here. After all, this document describes the development process, baidu understands some of the small knowledge points. Another important thing is the local coordinate system. Add the addChild (CCNode *) function (this function is a member function of the CCNode class in the engine, CCNode is the base class of all the content displayed in the game. Here we need to grasp the base class of the content that can be displayed, because the base class in the engine is CCOject, which is used to reference the count, it is easy to manage the memory of the engine. If you do not understand it, you can also use the reference count-based memory management principle of the cocos2dx engine under Baidu. There are a lot of articles similar to those on the Internet .)

4: according to the above process, we can see that Mario is at a certain position on the map. The first stage is over.


A version of super Mary

Your next Nintendo FC game has 500
 
PSP's super Mary should be ISO

The games on the PSP platform are not as good as Super Mario. Because Super Mario is produced by Nintendo, it won't appear on the PSP platform (not true in the future )...
If you want to play a Super Mario game, you can simulate GBA or N64... or... you can buy an NDSL ..

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.