Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
tetra-tower
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Oenos
tetra-tower
Commits
3fe6b8da
Commit
3fe6b8da
authored
Jan 31, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
이제 테트리미노의 조작에는 골드가 필요함
parent
890fb3b1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
5 deletions
+22
-5
MapManager.cs
Assets/Scripts/TetrisMap/MapManager.cs
+20
-3
LifeStoneManager.cs
...Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
+2
-2
No files found.
Assets/Scripts/TetrisMap/MapManager.cs
View file @
3fe6b8da
...
...
@@ -9,6 +9,7 @@ public class MapManager : MonoBehaviour {
* variables
* */
TetriminoSpawner
tetriminoSpawner
;
LifeStoneManager
lifeStoneManager
;
public
GameObject
player
;
/// <summary>
/// Grid showing tiles.
...
...
@@ -126,6 +127,10 @@ public class MapManager : MonoBehaviour {
/// </summary>
public
static
int
currentStage
;
/// <summary>
/// Gold need to control tetrimino.
/// </summary>
public
int
tetriminoCost
=
1
;
/// <summary>
/// Fog of the rooms.
/// </summary>
public
GameObject
fog
;
...
...
@@ -699,8 +704,7 @@ public class MapManager : MonoBehaviour {
/// <param name="te">Tetrimino you want to move.</param>
public
void
TetriminoControl
(
Tetrimino
te
)
{
if
((
Input
.
GetKeyDown
(
KeyCode
.
Space
)
&&
GameManager
.
gameState
==
GameState
.
Tetris
)
||
tetriminoWaitedTime
>
timeToFallTetrimino
)
if
(
tetriminoWaitedTime
>
timeToFallTetrimino
)
{
isTetriminoFalling
=
true
;
TetriminoMapCoordDown
(
currentTetrimino
);
...
...
@@ -708,9 +712,21 @@ public class MapManager : MonoBehaviour {
if
(
GameManager
.
gameState
==
GameState
.
Tetris
)
{
if
(
Input
.
GetButtonDown
(
"Vertical"
))
{
TetriminoRotate
(
currentTetrimino
,
(
int
)
Input
.
GetAxisRaw
(
"Vertical"
));
else
if
(
Input
.
GetButtonDown
(
"Horizontal"
))
}
else
if
(
Input
.
GetButtonDown
(
"Horizontal"
)
&&
lifeStoneManager
.
CountType
(
LifeStoneType
.
Gold
)
>
0
)
{
MoveTetriminoHorizontal
(
currentTetrimino
,
new
Vector3
((
int
)
Input
.
GetAxisRaw
(
"Horizontal"
),
0
,
0
));
lifeStoneManager
.
ChangeToNormal
(
LifeStoneType
.
Gold
,
tetriminoCost
);
}
else
if
(
Input
.
GetKeyDown
(
KeyCode
.
Space
)
&&
lifeStoneManager
.
CountType
(
LifeStoneType
.
Gold
)
>
0
)
{
isTetriminoFalling
=
true
;
TetriminoMapCoordDown
(
currentTetrimino
);
lifeStoneManager
.
ChangeToNormal
(
LifeStoneType
.
Gold
,
tetriminoCost
);
}
}
}
/// <summary>
...
...
@@ -1044,6 +1060,7 @@ public class MapManager : MonoBehaviour {
roomsSpritesDistributed[4].Add(roomsSprite5[(int)spriteType]);*/
}
tetriminoSpawner
=
GameObject
.
Find
(
"TetriminoSpawner"
).
GetComponent
<
TetriminoSpawner
>();
lifeStoneManager
=
GameObject
.
Find
(
"LifeStoneUI"
).
GetComponent
<
LifeStoneManager
>();
currentStage
=
0
;
}
...
...
Assets/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
View file @
3fe6b8da
...
...
@@ -325,8 +325,8 @@ public class LifeStoneManager : MonoBehaviour {
public
int
CountType
(
LifeStoneType
type
)
{
int
count
=
0
;
for
(
int
j
=
0
;
j
<
3
;
j
++)
for
(
int
i
=
0
;
i
<
lifeStoneRowNum
;
i
++)
for
(
int
i
=
0
;
i
<
3
;
i
++)
for
(
int
j
=
0
;
j
<
lifeStoneRowNum
;
j
++)
if
(
lifeStoneArray
[
j
,
i
]
==
(
int
)
type
)
count
++;
return
count
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment