Cocos2d-x 3.2 Monopoly game project development-Part 5 standalone game-levels choose ScrollView, monopoly Standalone
Click MenuScene. cpp to call
Director: getInstance ()-> pushScene (MapChooseScene: createScene ());
Go to the level selection interface. We use the ScrollView control to create this interface.
Becaus
Cocos2d-x 3.2 Monopoly game project development-Part 1 skill improvement and game end judgment, cocos2d-x Project DevelopmentThis section focuses on the increase of skill escalation events and game end judgment. The game judgment is simply handled. If there is a role whose c
the number of rounds before it is flushed, so the previous purge is cleared for (auto it = Refreshroundvector.begin (); it! = Refreshroundvector.end (); it++) {((sprite*) *it)->setvisible (false);} Refreshroundvector.clear (); int count = Gameroundcount; Sprite* st;//When the game starts, show the number of rounds as 0 if (count ==0) {st = sprite::createwithspriteframe (digiteroundvector.at (0)); AddChild (ST); Refreshroundvector.pushback (ST);} Conv
Cocos2d-x 3.2 Monopoly game project development-Part 4 exit dialog box, cocos2d-x Project Development
First look at the MenuScene. cpp: popupLayer () {// define a pop-up layer and input a background image PopupLayer * popDialog = PopupLayer: create (DIALOG_BG ); // ContentSize is an optional setting and can be left unspecified. If it is set as a 9-figure zoom popDialog-> setContentSize (CCSizeMake (Qui
Cocos2d-x 3.2 Monopoly game project development-Part 7 get role PATH
Create a RouteNavigation class and define the getPath () method to obtain the role path. We design this class in the single-sample mode. First, let's look at the definition of this class.
RouteNavigation. hclass RouteNavigation {public: static RouteNavigation * routeNav_Instance; // static RouteNavigation * getInstance (); // obtain the s
Finish.This will allow you to install the APK test.7. Other questions:(1) After you import an Android project after opening eclipse, exit and then open and sometimes encounter a java.lang.NullPointerException error.File under Proj.android ". Cproject" Delete(2) cannot find a variable such as float int, the test discovery is due to comments, there may be an inappropriate character in the comments or the encoding format is not the result ofYou can just remove the comment.such as LineChart.hThe fo
", _RAND1);//based on the ID, remove the coordinates Vec2 vec2forplayer1 = waylayerpass_vector.at (_RAND1);// This we add a tiledheight height to the vertical position in order to have the character centered on the road vec2forplayer1.y +=tiledheight; Sets the location of the role, as well as the anchor Point Player1->setposition (vec2forplayer1);p Layer1->setanchorpoint (CCP (0,0.5));//log related int col = Vec2forplayer1.x/tiledwidth;int row = Vec2forplayer1.y/tiledheight;log ("player1 positio
Cocos2d-x 3.2 Monopoly game project development-Part 2 improve the role walking experience, cocos2d-x Project Development
Before obtaining the number of random steps, a friendly prompt should be provided to the player indicating which role to start walking. A few steps are required.
In this way, let the role flash before walking, and mark the path to be taken by the role in a special color. The effect is as
Cocos2d-x 3.2 Monopoly game project development-Part 1 buy space animation, cocos2d-x Project Development
When purchasing an open space, we add an animation:
The animation consists of two parts. The first part is to increase the footprint from small to small, and then from large to small. The second part is to play a particle effect after the footprint decreases.
First download particle editing tool: Cocos2
Cocos2d-x 3.2 Monopoly game project development-Part 2 crab Road (code), cocos2d-x Project DevelopmentIn this section, we add a crab wounding event. The Crab genie is randomly added to the road location. When the role finishes walking, if it encounters a crab at the position, the animation is played first, and then the ambulance takes the role away.When this role is in turn walking, the toast prompts that t
Cocos2d-x 3.2 Monopoly game project development-Part 1 Toast prompt box, cocos2d-xtoast
When a toll is paid, the number of reduced funds is displayed near the role, and the number of funds added is displayed for the role that receives the toll.
I have made some changes to this information on the Internet.
Write a CocosToast class
#ifndef __CocosToast_H__#define __CocosToast_H__#include "cocos2d.h"#includ
Cocos2d-x 3.2 Monopoly game project development-Part 3 menu scenario
In the previous section, after introducing titles animation, go to the menu scenario and set the scenario effect.
The MenuScene. h header file is as follows:
Class MenuScene: public LayerColor {public: static Scene * createScene (); virtual bool init (); CREATE_FUNC (MenuScene); private: Size visibleSize; // LabelTTF * settingsGame
Cocos2d-x 3.2 Monopoly game project development-Part 3 menu scene, cocos2d-x Project Development
In the previous section, after introducing titles animation, go to the menu scenario and set the scenario effect.
The MenuScene. h header file is as follows:
Class MenuScene: public LayerColor {public: static Scene * createScene (); virtual bool init (); CREATE_FUNC (MenuScene); private: Size visibleSize
Cocos2d-x 3.2 Monopoly game project development-Part 1 show round counter, cocos2d-x Project Development
The number of game rounds is displayed in the lower right corner:
Implementation Method:
1. Create a frame cache in the GameBaseScene class to store SpriteFrame with ten digits, representing 0-9 Arabic numerals and placing them in a Vector.
2. Define the varia
Cocos2d-x 3.2 Monopoly game project development-Part 1 internationalization-Solving Chinese Garbled text
Solve the Chinese Garbled text first. cheyiliu, a netizen, provides a simple solution as follows. If you have a better solution, please provide it.
1. Compile the plist file string_zh.plist to display Chinese characters in the file:
Single_game
Single Player
Cocos2d-x 3.2 Monopoly game project development-Part 2 crab RoadIn this section, we add a crab wounding event. The Crab genie is randomly added to the road location. When the role finishes walking, if it encounters a crab at the position, the animation is played first, and then the ambulance takes the role away.When this role is in turn walking, the toast prompts that the hospital is still in hospital for a
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.