Soumettre la recherche
Mettre en ligne
Cocos2dx 7.1-7.2
•
0 j'aime
•
545 vues
Kyungryul KIM
Suivre
Technologie
Signaler
Partager
Signaler
Partager
1 sur 12
Télécharger maintenant
Télécharger pour lire hors ligne
Recommandé
Students to Business Day 2012: Rob Miles
Students to Business Day 2012: Rob Miles
Frederik De Bruyne
Windows Phone: From Idea to Published Game in 75 minutes
Windows Phone: From Idea to Published Game in 75 minutes
Microsoft Developer Network (MSDN) - Belgium and Luxembourg
Introduction to Game Programming Tutorial
Introduction to Game Programming Tutorial
Richard Jones
Making Games in JavaScript
Making Games in JavaScript
Sam Cartwright
The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88
Mahmoud Samir Fayed
The Ring programming language version 1.7 book - Part 74 of 196
The Ring programming language version 1.7 book - Part 74 of 196
Mahmoud Samir Fayed
Intro to Game Programming
Intro to Game Programming
Richard Jones
The Ring programming language version 1.2 book - Part 50 of 84
The Ring programming language version 1.2 book - Part 50 of 84
Mahmoud Samir Fayed
Recommandé
Students to Business Day 2012: Rob Miles
Students to Business Day 2012: Rob Miles
Frederik De Bruyne
Windows Phone: From Idea to Published Game in 75 minutes
Windows Phone: From Idea to Published Game in 75 minutes
Microsoft Developer Network (MSDN) - Belgium and Luxembourg
Introduction to Game Programming Tutorial
Introduction to Game Programming Tutorial
Richard Jones
Making Games in JavaScript
Making Games in JavaScript
Sam Cartwright
The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 52 of 88
Mahmoud Samir Fayed
The Ring programming language version 1.7 book - Part 74 of 196
The Ring programming language version 1.7 book - Part 74 of 196
Mahmoud Samir Fayed
Intro to Game Programming
Intro to Game Programming
Richard Jones
The Ring programming language version 1.2 book - Part 50 of 84
The Ring programming language version 1.2 book - Part 50 of 84
Mahmoud Samir Fayed
CoW Documentatie
CoW Documentatie
Constantin Lucian
XNA coding series
XNA coding series
Uditha Bandara (.NET MVP)
The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.10 book - Part 71 of 212
Mahmoud Samir Fayed
The Ring programming language version 1.9 book - Part 80 of 210
The Ring programming language version 1.9 book - Part 80 of 210
Mahmoud Samir Fayed
OOXX
OOXX
Weihong Lee
The Ring programming language version 1.5.1 book - Part 51 of 180
The Ring programming language version 1.5.1 book - Part 51 of 180
Mahmoud Samir Fayed
The Ring programming language version 1.5.3 book - Part 79 of 184
The Ring programming language version 1.5.3 book - Part 79 of 184
Mahmoud Samir Fayed
The Ring programming language version 1.8 book - Part 76 of 202
The Ring programming language version 1.8 book - Part 76 of 202
Mahmoud Samir Fayed
The Ring programming language version 1.8 book - Part 59 of 202
The Ring programming language version 1.8 book - Part 59 of 202
Mahmoud Samir Fayed
Chaco Step-by-Step
Chaco Step-by-Step
Enthought, Inc.
libGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame Animation
Jussi Pohjolainen
The Ring programming language version 1.10 book - Part 64 of 212
The Ring programming language version 1.10 book - Part 64 of 212
Mahmoud Samir Fayed
The Ring programming language version 1.6 book - Part 52 of 189
The Ring programming language version 1.6 book - Part 52 of 189
Mahmoud Samir Fayed
The Ring programming language version 1.5.2 book - Part 49 of 181
The Ring programming language version 1.5.2 book - Part 49 of 181
Mahmoud Samir Fayed
The Ring programming language version 1.5.1 book - Part 48 of 180
The Ring programming language version 1.5.1 book - Part 48 of 180
Mahmoud Samir Fayed
libGDX: Tiled Maps
libGDX: Tiled Maps
Jussi Pohjolainen
The Ring programming language version 1.10 book - Part 70 of 212
The Ring programming language version 1.10 book - Part 70 of 212
Mahmoud Samir Fayed
The Ring programming language version 1.4.1 book - Part 19 of 31
The Ring programming language version 1.4.1 book - Part 19 of 31
Mahmoud Samir Fayed
Real life XNA
Real life XNA
Johan Lindfors
libGDX: Simple Frame Animation
libGDX: Simple Frame Animation
Jussi Pohjolainen
11.scripting
11.scripting
Kyungryul KIM
Node ch12
Node ch12
Kyungryul KIM
Contenu connexe
Tendances
CoW Documentatie
CoW Documentatie
Constantin Lucian
XNA coding series
XNA coding series
Uditha Bandara (.NET MVP)
The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.10 book - Part 71 of 212
Mahmoud Samir Fayed
The Ring programming language version 1.9 book - Part 80 of 210
The Ring programming language version 1.9 book - Part 80 of 210
Mahmoud Samir Fayed
OOXX
OOXX
Weihong Lee
The Ring programming language version 1.5.1 book - Part 51 of 180
The Ring programming language version 1.5.1 book - Part 51 of 180
Mahmoud Samir Fayed
The Ring programming language version 1.5.3 book - Part 79 of 184
The Ring programming language version 1.5.3 book - Part 79 of 184
Mahmoud Samir Fayed
The Ring programming language version 1.8 book - Part 76 of 202
The Ring programming language version 1.8 book - Part 76 of 202
Mahmoud Samir Fayed
The Ring programming language version 1.8 book - Part 59 of 202
The Ring programming language version 1.8 book - Part 59 of 202
Mahmoud Samir Fayed
Chaco Step-by-Step
Chaco Step-by-Step
Enthought, Inc.
libGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame Animation
Jussi Pohjolainen
The Ring programming language version 1.10 book - Part 64 of 212
The Ring programming language version 1.10 book - Part 64 of 212
Mahmoud Samir Fayed
The Ring programming language version 1.6 book - Part 52 of 189
The Ring programming language version 1.6 book - Part 52 of 189
Mahmoud Samir Fayed
The Ring programming language version 1.5.2 book - Part 49 of 181
The Ring programming language version 1.5.2 book - Part 49 of 181
Mahmoud Samir Fayed
The Ring programming language version 1.5.1 book - Part 48 of 180
The Ring programming language version 1.5.1 book - Part 48 of 180
Mahmoud Samir Fayed
libGDX: Tiled Maps
libGDX: Tiled Maps
Jussi Pohjolainen
The Ring programming language version 1.10 book - Part 70 of 212
The Ring programming language version 1.10 book - Part 70 of 212
Mahmoud Samir Fayed
The Ring programming language version 1.4.1 book - Part 19 of 31
The Ring programming language version 1.4.1 book - Part 19 of 31
Mahmoud Samir Fayed
Real life XNA
Real life XNA
Johan Lindfors
libGDX: Simple Frame Animation
libGDX: Simple Frame Animation
Jussi Pohjolainen
Tendances
(20)
CoW Documentatie
CoW Documentatie
XNA coding series
XNA coding series
The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.9 book - Part 80 of 210
The Ring programming language version 1.9 book - Part 80 of 210
OOXX
OOXX
The Ring programming language version 1.5.1 book - Part 51 of 180
The Ring programming language version 1.5.1 book - Part 51 of 180
The Ring programming language version 1.5.3 book - Part 79 of 184
The Ring programming language version 1.5.3 book - Part 79 of 184
The Ring programming language version 1.8 book - Part 76 of 202
The Ring programming language version 1.8 book - Part 76 of 202
The Ring programming language version 1.8 book - Part 59 of 202
The Ring programming language version 1.8 book - Part 59 of 202
Chaco Step-by-Step
Chaco Step-by-Step
libGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame Animation
The Ring programming language version 1.10 book - Part 64 of 212
The Ring programming language version 1.10 book - Part 64 of 212
The Ring programming language version 1.6 book - Part 52 of 189
The Ring programming language version 1.6 book - Part 52 of 189
The Ring programming language version 1.5.2 book - Part 49 of 181
The Ring programming language version 1.5.2 book - Part 49 of 181
The Ring programming language version 1.5.1 book - Part 48 of 180
The Ring programming language version 1.5.1 book - Part 48 of 180
libGDX: Tiled Maps
libGDX: Tiled Maps
The Ring programming language version 1.10 book - Part 70 of 212
The Ring programming language version 1.10 book - Part 70 of 212
The Ring programming language version 1.4.1 book - Part 19 of 31
The Ring programming language version 1.4.1 book - Part 19 of 31
Real life XNA
Real life XNA
libGDX: Simple Frame Animation
libGDX: Simple Frame Animation
En vedette
11.scripting
11.scripting
Kyungryul KIM
Node ch12
Node ch12
Kyungryul KIM
32 osx app_release
32 osx app_release
Kyungryul KIM
Meteor ddp
Meteor ddp
Kyungryul KIM
Ch4 pugixml
Ch4 pugixml
Kyungryul KIM
DDP - Meteor
DDP - Meteor
Michael Lazarski
En vedette
(6)
11.scripting
11.scripting
Node ch12
Node ch12
32 osx app_release
32 osx app_release
Meteor ddp
Meteor ddp
Ch4 pugixml
Ch4 pugixml
DDP - Meteor
DDP - Meteor
Similaire à Cocos2dx 7.1-7.2
ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdf
ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdf
rajkumarm401
Ocr code
Ocr code
wi7sonjoseph
Flappy bird
Flappy bird
SantiagoYepesSerna
Game age ppt
Game age ppt
Ahmed Yousef
import java.awt.;import java.awt.event.;import javax.swing.;.pdf
import java.awt.;import java.awt.event.;import javax.swing.;.pdf
aoneonlinestore1
Mobile Gameand Application withJ2ME - Collision Detection
Mobile Gameand Application withJ2ME - Collision Detection
Jenchoke Tachagomain
Mobile Gameand Application with J2ME
Mobile Gameand Application with J2ME
Jenchoke Tachagomain
Introduction to Computer Graphics using OpenGLCan someone tell me .pdf
Introduction to Computer Graphics using OpenGLCan someone tell me .pdf
fathimafancyjeweller
662305 LAB12
662305 LAB12
Nitigan Nakjuatong
Mouse and Cat Game In C++
Mouse and Cat Game In C++
Programming Homework Help
The Ring programming language version 1.8 book - Part 56 of 202
The Ring programming language version 1.8 book - Part 56 of 202
Mahmoud Samir Fayed
The Ring programming language version 1.2 book - Part 38 of 84
The Ring programming language version 1.2 book - Part 38 of 84
Mahmoud Samir Fayed
The Ring programming language version 1.5.4 book - Part 50 of 185
The Ring programming language version 1.5.4 book - Part 50 of 185
Mahmoud Samir Fayed
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
anyacarpets
Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.
UA Mobile
Need to make a ReversiOthello Board game in JAVAThe board size ca.pdf
Need to make a ReversiOthello Board game in JAVAThe board size ca.pdf
flashfashioncasualwe
I have been working on this ROCK, PAPER, SCISSORS project for the pa.pdf
I have been working on this ROCK, PAPER, SCISSORS project for the pa.pdf
fasttracksunglass
UI Design From Scratch - Part 5 - transcript.pdf
UI Design From Scratch - Part 5 - transcript.pdf
ShaiAlmog1
Game dev 101 part 3
Game dev 101 part 3
Christoffer Noring
Whenever I run my application my Game appears with the pict.pdf
Whenever I run my application my Game appears with the pict.pdf
aarthitimesgd
Similaire à Cocos2dx 7.1-7.2
(20)
ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdf
ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdf
Ocr code
Ocr code
Flappy bird
Flappy bird
Game age ppt
Game age ppt
import java.awt.;import java.awt.event.;import javax.swing.;.pdf
import java.awt.;import java.awt.event.;import javax.swing.;.pdf
Mobile Gameand Application withJ2ME - Collision Detection
Mobile Gameand Application withJ2ME - Collision Detection
Mobile Gameand Application with J2ME
Mobile Gameand Application with J2ME
Introduction to Computer Graphics using OpenGLCan someone tell me .pdf
Introduction to Computer Graphics using OpenGLCan someone tell me .pdf
662305 LAB12
662305 LAB12
Mouse and Cat Game In C++
Mouse and Cat Game In C++
The Ring programming language version 1.8 book - Part 56 of 202
The Ring programming language version 1.8 book - Part 56 of 202
The Ring programming language version 1.2 book - Part 38 of 84
The Ring programming language version 1.2 book - Part 38 of 84
The Ring programming language version 1.5.4 book - Part 50 of 185
The Ring programming language version 1.5.4 book - Part 50 of 185
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.
Need to make a ReversiOthello Board game in JAVAThe board size ca.pdf
Need to make a ReversiOthello Board game in JAVAThe board size ca.pdf
I have been working on this ROCK, PAPER, SCISSORS project for the pa.pdf
I have been working on this ROCK, PAPER, SCISSORS project for the pa.pdf
UI Design From Scratch - Part 5 - transcript.pdf
UI Design From Scratch - Part 5 - transcript.pdf
Game dev 101 part 3
Game dev 101 part 3
Whenever I run my application my Game appears with the pict.pdf
Whenever I run my application my Game appears with the pict.pdf
Plus de Kyungryul KIM
Cocos2 d x-7.3_4
Cocos2 d x-7.3_4
Kyungryul KIM
Cocos2d x-ch5-1
Cocos2d x-ch5-1
Kyungryul KIM
Coco2d x
Coco2d x
Kyungryul KIM
23 drag drop
23 drag drop
Kyungryul KIM
Hadoop ch5
Hadoop ch5
Kyungryul KIM
전문검색기술도전
전문검색기술도전
Kyungryul KIM
Nib_NSWindowController
Nib_NSWindowController
Kyungryul KIM
Dsas
Dsas
Kyungryul KIM
서버인프라를지탱하는기술5 1 2
서버인프라를지탱하는기술5 1 2
Kyungryul KIM
Chaper24 languages high_and_low
Chaper24 languages high_and_low
Kyungryul KIM
Ch22 운영체제
Ch22 운영체제
Kyungryul KIM
Mibis ch20
Mibis ch20
Kyungryul KIM
Mibis ch15
Mibis ch15
Kyungryul KIM
Mibis ch8
Mibis ch8
Kyungryul KIM
Mibis ch4
Mibis ch4
Kyungryul KIM
14 strategy design
14 strategy design
Kyungryul KIM
Ddd ch12-13
Ddd ch12-13
Kyungryul KIM
DDD-07-Using The Language
DDD-07-Using The Language
Kyungryul KIM
Cleancode ch16 serialdate_refactoring
Cleancode ch16 serialdate_refactoring
Kyungryul KIM
Cleancode ch14-successive refinement
Cleancode ch14-successive refinement
Kyungryul KIM
Plus de Kyungryul KIM
(20)
Cocos2 d x-7.3_4
Cocos2 d x-7.3_4
Cocos2d x-ch5-1
Cocos2d x-ch5-1
Coco2d x
Coco2d x
23 drag drop
23 drag drop
Hadoop ch5
Hadoop ch5
전문검색기술도전
전문검색기술도전
Nib_NSWindowController
Nib_NSWindowController
Dsas
Dsas
서버인프라를지탱하는기술5 1 2
서버인프라를지탱하는기술5 1 2
Chaper24 languages high_and_low
Chaper24 languages high_and_low
Ch22 운영체제
Ch22 운영체제
Mibis ch20
Mibis ch20
Mibis ch15
Mibis ch15
Mibis ch8
Mibis ch8
Mibis ch4
Mibis ch4
14 strategy design
14 strategy design
Ddd ch12-13
Ddd ch12-13
DDD-07-Using The Language
DDD-07-Using The Language
Cleancode ch16 serialdate_refactoring
Cleancode ch16 serialdate_refactoring
Cleancode ch14-successive refinement
Cleancode ch14-successive refinement
Dernier
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Jeffrey Haguewood
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
apidays
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
apidays
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
apidays
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
DianaGray10
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Product Anonymous
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Igalia
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Edi Saputra
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
MIND CTI
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Zilliz
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
apidays
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
The Digital Insurer
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Drew Madelung
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
The Digital Insurer
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
Dernier
(20)
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
Cocos2dx 7.1-7.2
1.
*
2.
지금까지
3.
만든것은
4.
게임
5.
오브젝트를
6.
터치로
7.
이동시켜서
8.
게임
9.
오브젝트 를
10.
교환하는
11.
부분밖에
12.
없음 *
13.
7-1에서는
14.
게임
15.
오브젝트를
16.
이동시켰을
17.
때
18.
같은
19.
색상의
20.
게임
21.
오브젝트 가
22.
3개
23.
이상
24.
나열되어
25.
매칭되면
26.
오브젝트를
27.
삭제하는
28.
기능
29.
구현 void
30.
GameObject::SlidingCompleteHandler() {
31.
32.
33.
34.
int
35.
x1
36.
=
37.
m_prevBoardX;
38.
39.
40.
41.
int
42.
y1
43.
=
44.
m_prevBoardY;
45.
46.
47.
48.
int
49.
x2
50.
=
51.
m_targetBoardX;
52.
53.
54.
55.
int
56.
y2
57.
=
58.
m_targetBoardY;
59.
60.
61.
62.
63.
64.
65.
66.
m_pGameLayer-SlidingFinished(x1,
67.
y1,
68.
x2,
69.
y2); } void
70.
GameObject::SetGameLayer(GameLayer*
71.
pGameLayer) {
72.
73.
74.
75.
m_pGameLayer
76.
=
77.
pGameLayer; } void
78.
GameLayer::StartGame() {
79.
80.
81.
82.
srand(time(NULL));
83.
84.
85.
86.
87.
88.
89.
90.
for
91.
(int
92.
x=0;
93.
xCOLUMN_COUNT;
94.
++x)
95.
{
96.
97.
98.
99.
100.
101.
102.
103.
for
104.
(int
105.
y=0;
106.
yROW_COUNT;
107.
++y)
108.
{
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
int
121.
type
122.
=
123.
rand()
124.
%
125.
TYPE_COUNT;
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
GameObject*
150.
pGameObject
151.
=
152.
GameObject::Create(type);
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
m_pBoard[x][y]
165.
=
166.
pGameObject;
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
pGameObject-setAnchorPoint(ccp(0,
191.
1));
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
pGameObject-setPosition(Common::ComputeXY(x,
204.
y));
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
pGameObject-SetGameLayer(this);
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
addChild(pGameObject,
229.
zGameObject);
230.
231.
232.
233.
234.
235.
236.
237.
}
238.
239.
240.
241.
}
242.
243.
244.
245.
246.
247.
248.
249.
m_bTouchStarted
250.
=
251.
false;
252.
253.
254.
255.
m_numOfSlidingObjects
256.
=
257.
0; } *
258.
이제
259.
실제로
260.
게임
261.
오브젝트가
262.
이동을
263.
완료했을
264.
때의
265.
처리를
266.
구현 class
267.
GameLayer
268.
:
269.
public
270.
CCLayer { public:
271.
272.
273.
274.
void
275.
SlidingFinished(int
276.
x1,
277.
int
278.
y1,
279.
int
280.
x2,
281.
int
282.
y2); protected:
283.
284.
285.
286.
//
287.
이동
288.
중인
289.
오브젝트의
290.
수
291.
292.
293.
294.
int
295.
m_numOfSlidingObjects; *
296.
이동중인
297.
오브젝트의
298.
수는
299.
왜
300.
저장하는걸까?
301.
게임오브젝트를
302.
이동시키 면
303.
하나만
304.
이동되는게
305.
아니고
306.
2개의
307.
오브젝트가
308.
이동함.
309.
하지만
310.
한번의
311.
이벤트만
312.
처리하면
313.
되기
314.
때문에
315.
모든
316.
오브젝트의
317.
이동이
318.
완료된
319.
후
320.
한번 만
321.
이벤트를
322.
처리하기
323.
위해서. void
324.
GameLayer::SlidingFinished(int
325.
x1,
326.
int
327.
y1,
328.
int
329.
x2,
330.
int
331.
y2) {
332.
333.
334.
335.
--m_numOfSlidingObjects;
336.
337.
338.
339.
if
340.
(m_numOfSlidingObjects
341.
==
342.
0)
343.
{
344.
345.
346.
347.
348.
349.
350.
351.
352.
353.
354.
355.
356.
} } void
357.
GameLayer::SwapObjects(int
358.
x1,
359.
int
360.
y1,
361.
int
362.
x2,
363.
int
364.
y2) {
365.
366.
367.
368.
m_numOfSlidingObjects
369.
=
370.
2;
371.
372.
373.
374.
... } *
375.
오브젝트
376.
이동이
377.
완료되면
378.
한번만
379.
매칭
380.
로직이
381.
수행되도록
382.
만들었음.
383.
실제
384.
매칭
385.
로직을
386.
계속
387.
만들어보자. void
388.
GameLayer::SlidingFinished(int
389.
x1,
390.
int
391.
y1,
392.
int
393.
x2,
394.
int
395.
y2) {
396.
397.
398.
399.
--m_numOfSlidingObjects;
400.
401.
402.
403.
if
404.
(m_numOfSlidingObjects
405.
==
406.
0)
407.
408.
409.
410.
411.
{
412.
413.
414.
415.
416.
417.
418.
419.
if
420.
(IsStreak(x1,
421.
y1)
422.
||
423.
IsStreak(x2,
424.
y2))
425.
426.
427.
428.
429.
430.
431.
432.
433.
434.
{
435.
436.
437.
438.
439.
440.
441.
442.
443.
444.
445.
446.
//
447.
매칭된
448.
줄은
449.
삭제한다.
450.
451.
452.
453.
454.
455.
456.
457.
458.
459.
460.
461.
if
462.
(IsStreak(x1,
463.
y1))
464.
465.
466.
467.
468.
469.
470.
471.
472.
473.
474.
475.
476.
{
477.
478.
479.
480.
481.
482.
483.
484.
485.
486.
487.
488.
489.
490.
491.
492.
RemoveObject(x1,
493.
y1);
494.
495.
496.
497.
498.
499.
500.
501.
502.
503.
504.
505.
}
506.
507.
508.
509.
510.
511.
512.
513.
514.
515.
516.
517.
518.
519.
520.
521.
522.
523.
524.
525.
526.
527.
528.
529.
if
530.
(IsStreak(x2,
531.
y2))
532.
533.
534.
535.
536.
537.
538.
539.
540.
541.
542.
543.
544.
{
545.
546.
547.
548.
549.
550.
551.
552.
553.
554.
555.
556.
557.
558.
559.
560.
RemoveObject(x2,
561.
y2);
562.
563.
564.
565.
566.
567.
568.
569.
570.
571.
572.
573.
}
574.
575.
576.
577.
578.
579.
580.
581.
}
582.
583.
584.
585.
} } bool
586.
GameLayer::IsStreak(int
587.
x,
588.
int
589.
y) {
590.
591.
592.
593.
return
594.
StreakHorz(x,
595.
y)
596.
597.
2
598.
||
599.
StreakVert(x,
600.
y)
601.
602.
2; } int
603.
GameLayer::StreakHorz(int
604.
x,
605.
int
606.
y) {
607.
608.
609.
610.
if
611.
(x
612.
613.
0
614.
||
615.
x
616.
=
617.
COLUMN_COUNT)
618.
{
619.
620.
621.
622.
623.
624.
625.
626.
return
627.
0;
628.
629.
630.
631.
}
632.
633.
634.
635.
636.
637.
638.
639.
if
640.
(y
641.
642.
0
643.
||
644.
y
645.
=
646.
ROW_COUNT)
647.
{
648.
649.
650.
651.
652.
653.
654.
655.
return
656.
0;
657.
658.
659.
660.
}
661.
662.
663.
664.
665.
666.
667.
668.
GameObject*
669.
pCurrentGameObject
670.
=
671.
m_pBoard[x][y];
672.
673.
674.
675.
if
676.
(pCurrentGameObject
677.
==
678.
NULL)
679.
{
680.
681.
682.
683.
684.
685.
686.
687.
return
688.
0;
689.
690.
691.
692.
}
693.
694.
695.
696.
697.
698.
699.
700.
int
701.
streak
702.
=
703.
1;
704.
705.
706.
707.
int
708.
temp
709.
=
710.
x;
711.
712.
713.
714.
715.
716.
717.
718.
//
719.
왼쪽으로
720.
검사해나감
721.
722.
723.
724.
while
725.
(CheckType(pCurrentGameObject-GetType(),
726.
temp
727.
-
728.
1,
729.
y))
730.
{
731.
732.
733.
734.
735.
736.
737.
738.
--temp;
739.
740.
741.
742.
743.
744.
745.
746.
++streak;
747.
748.
749.
750.
}
751.
752.
753.
754.
755.
756.
757.
758.
temp
759.
=
760.
x;
761.
762.
763.
764.
//
765.
오른쪽으로
766.
검사해나감
767.
768.
769.
770.
while
771.
(CheckType(pCurrentGameObject-GetType(),
772.
temp
773.
+
774.
1,
775.
y))
776.
{
777.
778.
779.
780.
781.
782.
783.
784.
++temp;
785.
786.
787.
788.
789.
790.
791.
792.
++streak;
793.
794.
795.
796.
}
797.
798.
799.
800.
801.
802.
803.
804.
return
805.
streak; } bool
806.
GameLayer::CheckType(int
807.
type,
808.
int
809.
x,
810.
int
811.
y) {
812.
813.
814.
815.
if
816.
(x
817.
818.
0
819.
||
820.
x
821.
=
822.
COLUMN_COUNT)
823.
{
824.
825.
826.
827.
828.
829.
830.
831.
return
832.
false;
833.
834.
835.
836.
}
837.
838.
839.
840.
841.
842.
843.
844.
if
845.
(y
846.
847.
0
848.
||
849.
y
850.
=
851.
ROW_COUNT)
852.
{
853.
854.
855.
856.
857.
858.
859.
860.
return
861.
false;
862.
863.
864.
865.
}
866.
867.
868.
869.
870.
871.
872.
873.
if
874.
(m_pBoard[x][y]
875.
==
876.
NULL)
877.
{
878.
879.
880.
881.
882.
883.
884.
885.
return
886.
false;
887.
888.
889.
890.
}
891.
892.
893.
894.
895.
896.
897.
898.
return
899.
type
900.
==
901.
m_pBoard[x][y]-GetType(); } int
902.
GameLayer::StreakVert(int
903.
x,
904.
int
905.
y) {
906.
907.
908.
909.
if
910.
(x
911.
912.
0
913.
||
914.
x
915.
=
916.
COLUMN_COUNT)
917.
{
918.
919.
920.
921.
922.
923.
924.
925.
return
926.
0;
927.
928.
929.
930.
}
931.
932.
933.
934.
935.
936.
937.
938.
if
939.
(y
940.
941.
0
942.
||
943.
y
944.
=
945.
ROW_COUNT)
946.
{
947.
948.
949.
950.
951.
952.
953.
954.
return
955.
0;
956.
957.
958.
959.
}
960.
961.
962.
963.
964.
965.
966.
967.
GameObject*
968.
pCurrentGameObject
969.
=
970.
m_pBoard[x][y];
971.
972.
973.
974.
if
975.
(pCurrentGameObject
976.
==
977.
NULL)
978.
{
979.
980.
981.
982.
983.
984.
985.
986.
return
987.
0;
988.
989.
990.
991.
}
992.
993.
994.
995.
996.
997.
998.
999.
int
1000.
streak
1001.
=
1002.
1;
1003.
1004.
1005.
1006.
int
1007.
temp
1008.
=
1009.
y;
1010.
1011.
1012.
1013.
1014.
1015.
1016.
1017.
//
1018.
위쪽으로
1019.
검사해나감
1020.
1021.
1022.
1023.
while
1024.
(CheckType(pCurrentGameObject-GetType(),
1025.
x,
1026.
temp
1027.
-
1028.
1))
1029.
{
1030.
1031.
1032.
1033.
1034.
1035.
1036.
1037.
--temp;
1038.
1039.
1040.
1041.
1042.
1043.
1044.
1045.
++streak;
1046.
1047.
1048.
1049.
}
1050.
1051.
1052.
1053.
1054.
1055.
1056.
1057.
temp
1058.
=
1059.
y;
1060.
1061.
1062.
1063.
1064.
1065.
1066.
1067.
//
1068.
아래쪽으로
1069.
검사해나감
1070.
1071.
1072.
1073.
while
1074.
(CheckType(pCurrentGameObject-GetType(),
1075.
x,
1076.
temp
1077.
+
1078.
1))
1079.
{
1080.
1081.
1082.
1083.
1084.
1085.
1086.
1087.
++temp;
1088.
1089.
1090.
1091.
1092.
1093.
1094.
1095.
++streak;
1096.
1097.
1098.
1099.
}
1100.
1101.
1102.
1103.
1104.
1105.
1106.
1107.
return
1108.
streak; } *
1109.
매칭을
1110.
검사하는
1111.
함수는
1112.
만들었으니,
1113.
이제
1114.
게임
1115.
오브젝트를
1116.
제거하는
1117.
함수인
1118.
RemoveObject
1119.
함수를
1120.
만들어
1121.
보겠음. void
1122.
GameLayer::RemoveObject(int
1123.
x,
1124.
int
1125.
y) {
1126.
1127.
1128.
1129.
int
1130.
currentType
1131.
=
1132.
m_pBoard[x][y]-GetType();
1133.
1134.
1135.
1136.
int
1137.
temp;
1138.
1139.
1140.
1141.
1142.
1143.
1144.
1145.
std::vectorGameObject*
1146.
removedObjects;
1147.
1148.
1149.
1150.
1151.
1152.
1153.
1154.
GameObject*
1155.
pGameObject
1156.
=
1157.
m_pBoard[x][y];
1158.
1159.
1160.
1161.
removedObjects.push_back(pGameObject);
1162.
1163.
1164.
1165.
1166.
1167.
1168.
1169.
if
1170.
(StreakHorz(x,
1171.
y)
1172.
1173.
2)
1174.
{
1175.
1176.
1177.
1178.
1179.
1180.
1181.
1182.
temp
1183.
=
1184.
x;
1185.
1186.
1187.
1188.
1189.
1190.
1191.
1192.
while
1193.
(CheckType(currentType,
1194.
temp-1,
1195.
y))
1196.
{
1197.
1198.
1199.
1200.
1201.
1202.
1203.
1204.
1205.
1206.
1207.
1208.
pGameObject
1209.
=
1210.
m_pBoard[temp-1][y];
1211.
1212.
1213.
1214.
1215.
1216.
1217.
1218.
1219.
1220.
1221.
1222.
removedObjects.push_back(pGameObject);
1223.
1224.
1225.
1226.
1227.
1228.
1229.
1230.
1231.
1232.
1233.
1234.
--temp;
1235.
1236.
1237.
1238.
1239.
1240.
1241.
1242.
}
1243.
1244.
1245.
1246.
1247.
1248.
1249.
1250.
1251.
1252.
1253.
1254.
1255.
1256.
1257.
1258.
temp
1259.
=
1260.
x;
1261.
1262.
1263.
1264.
1265.
1266.
1267.
1268.
1269.
1270.
1271.
1272.
1273.
1274.
1275.
1276.
while
1277.
(CheckType(currentType,
1278.
temp+1,
1279.
y))
1280.
{
1281.
1282.
1283.
1284.
1285.
1286.
1287.
1288.
1289.
1290.
1291.
1292.
pGameObject
1293.
=
1294.
m_pBoard[temp+1][y];
1295.
1296.
1297.
1298.
1299.
1300.
1301.
1302.
1303.
1304.
1305.
1306.
removedObjects.push_back(pGameObject);
1307.
1308.
1309.
1310.
1311.
1312.
1313.
1314.
1315.
1316.
1317.
1318.
++temp;
1319.
1320.
1321.
1322.
1323.
1324.
1325.
1326.
}
1327.
1328.
1329.
1330.
}
1331.
1332.
1333.
1334.
1335.
1336.
1337.
1338.
if
1339.
(StreakVert(x,
1340.
y)
1341.
1342.
2)
1343.
{
1344.
1345.
1346.
1347.
1348.
1349.
1350.
1351.
temp
1352.
=
1353.
y;
1354.
1355.
1356.
1357.
1358.
1359.
1360.
1361.
while
1362.
(CheckType(currentType,
1363.
x,
1364.
temp-1))
1365.
{
1366.
1367.
1368.
1369.
1370.
1371.
1372.
1373.
1374.
1375.
1376.
1377.
pGameObject
1378.
=
1379.
m_pBoard[x][temp-1];
1380.
1381.
1382.
1383.
1384.
1385.
1386.
1387.
1388.
1389.
1390.
1391.
removedObjects.push_back(pGameObject);
1392.
1393.
1394.
1395.
1396.
1397.
1398.
1399.
1400.
1401.
1402.
1403.
--temp;
1404.
1405.
1406.
1407.
1408.
1409.
1410.
1411.
}
1412.
1413.
1414.
1415.
Télécharger maintenant