Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
colourful-love
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eko Simanjuntak
colourful-love
Commits
ae9d7fe6
Commit
ae9d7fe6
authored
Dec 15, 2017
by
Eko Simanjuntak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add finish point
parent
bb833c67
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
22 additions
and
20 deletions
+22
-20
.suo
.vs/Colorful Love/v15/.suo
+0
-0
storage.ide
.vs/Colorful Love/v15/sqlite3/storage.ide
+0
-0
Level 1.unity
Assets/Scenes/Level 1.unity
+0
-0
BackgroundChanger.cs
Assets/Scripts/BackgroundChanger.cs
+7
-14
PhysicObject.cs
Assets/Scripts/PhysicObject.cs
+0
-6
PlayerController.cs
Assets/Scripts/PlayerController.cs
+8
-0
SceneLoader.cs
Assets/Scripts/SceneLoader.cs
+5
-0
GraphicsSettings.asset
ProjectSettings/GraphicsSettings.asset
+1
-0
TagManager.asset
ProjectSettings/TagManager.asset
+1
-0
No files found.
.vs/Colorful Love/v15/.suo
View file @
ae9d7fe6
No preview for this file type
.vs/Colorful Love/v15/sqlite3/storage.ide
View file @
ae9d7fe6
No preview for this file type
Assets/Scenes/Level 1.unity
View file @
ae9d7fe6
This diff is collapsed.
Click to expand it.
Assets/Scripts/BackgroundChanger.cs
View file @
ae9d7fe6
...
...
@@ -19,11 +19,7 @@ public class BackgroundChanger : MonoBehaviour {
private
void
CollectBackgrounds
()
{
foreach
(
string
color
in
colors
)
{
background
=
GameObject
.
FindWithTag
(
color
+
"Background"
);
backgroundGroup
.
Add
(
background
);
}
background
=
GameObject
.
FindWithTag
(
"Background"
);
}
private
void
CollectObstacles
()
...
...
@@ -51,15 +47,12 @@ public class BackgroundChanger : MonoBehaviour {
public
void
UpdateBackgroud
(
string
tagColor
)
{
foreach
(
GameObject
background
in
backgroundGroup
)
if
(
tagColor
==
"Green"
)
{
if
(
background
.
tag
==
tagColor
+
"Background"
)
{
background
.
SetActive
(
true
);
}
else
{
background
.
SetActive
(
false
);
}
background
.
GetComponent
<
SpriteRenderer
>().
color
=
new
Color32
(
46
,
204
,
113
,
255
);
}
else
if
(
tagColor
==
"Blue"
)
{
background
.
GetComponent
<
SpriteRenderer
>().
color
=
new
Color32
(
65
,
131
,
215
,
255
);
}
UpdateObstacle
(
tagColor
);
...
...
@@ -69,7 +62,7 @@ public class BackgroundChanger : MonoBehaviour {
{
foreach
(
GameObject
obstacle
in
obstacleGroup
)
{
if
(
obstacle
.
tag
==
tagColor
+
"Obstacle"
)
if
(
obstacle
.
tag
==
tagColor
+
"Obstacle"
)
{
obstacle
.
SetActive
(
false
);
}
else
...
...
Assets/Scripts/PhysicObject.cs
View file @
ae9d7fe6
...
...
@@ -28,7 +28,6 @@ public class PhysicsObject : MonoBehaviour
{
targetVelocity
=
Vector2
.
zero
;
ComputeVelocity
();
Shoot
();
}
protected
virtual
void
ComputeVelocity
()
...
...
@@ -36,11 +35,6 @@ public class PhysicsObject : MonoBehaviour
}
protected
virtual
void
Shoot
()
{
}
private
void
FixedUpdate
()
{
Vector2
move
;
...
...
Assets/Scripts/PlayerController.cs
View file @
ae9d7fe6
...
...
@@ -41,4 +41,12 @@ public class PlayerController : PhysicsObject
targetVelocity
=
move
*
maxSpeed
;
}
private
void
OnTriggerEnter2D
(
Collider2D
collision
)
{
if
(
collision
.
gameObject
.
CompareTag
(
"Finish"
))
{
SceneLoader
.
LoadLevelScene
();
}
}
}
Assets/Scripts/SceneLoader.cs
View file @
ae9d7fe6
...
...
@@ -10,6 +10,11 @@ public class SceneLoader : MonoBehaviour {
SceneManager
.
LoadScene
(
sceneName
);
}
public
static
void
LoadLevelScene
()
{
SceneManager
.
LoadScene
(
"Level Selection"
);
}
public
void
QuitGame
()
{
Application
.
Quit
();
...
...
ProjectSettings/GraphicsSettings.asset
View file @
ae9d7fe6
...
...
@@ -35,6 +35,7 @@ GraphicsSettings:
-
{
fileID
:
15106
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
10753
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
10770
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
-
{
fileID
:
16000
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_PreloadedShaders
:
[]
m_SpritesDefaultMaterial
:
{
fileID
:
10754
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
...
...
ProjectSettings/TagManager.asset
View file @
ae9d7fe6
...
...
@@ -8,6 +8,7 @@ TagManager:
-
GreenBackground
-
BlueObstacle
-
GreenObstacle
-
Background
layers
:
-
Default
-
TransparentFX
...
...
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