Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
igem-quantifly
Overview
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
PLN
igem-quantifly
Commits
246d439f
Commit
246d439f
authored
Oct 29, 2016
by
Raphael
Browse files
Options
Browse Files
Download
Plain Diff
Fixed
parents
17e881dd
3671c4b2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
8 deletions
+19
-8
Main.unity
Assets/Scenes/Main.unity
+0
-0
Scores.unity
Assets/Scenes/Scores.unity
+0
-0
GameController.cs
Assets/Scripts/GameController.cs
+6
-3
GameOver.cs
Assets/Scripts/GameOver.cs
+5
-1
HighScores.cs
Assets/Scripts/HighScores.cs
+3
-0
Menu.cs
Assets/Scripts/Menu.cs
+3
-1
UIController.cs
Assets/Scripts/UIController.cs
+2
-3
No files found.
Assets/Scenes/Main.unity
View file @
246d439f
No preview for this file type
Assets/Scenes/Scores.unity
View file @
246d439f
No preview for this file type
Assets/Scripts/GameController.cs
View file @
246d439f
...
...
@@ -7,8 +7,9 @@ namespace Assets.Scripts
{
public
class
GameController
:
MonoBehaviour
{
public
static
int
PoolSize
=
256
;
public
static
float
Speed
=
4f
;
public
static
int
PoolSize
=
256
;
public
static
float
InitialSpeed
=
4f
;
public
static
float
Speed
=
InitialSpeed
;
public
GameObject
Wall
;
public
GameObject
BG
;
...
...
@@ -23,7 +24,9 @@ namespace Assets.Scripts
{
size
=
BG
.
GetComponent
<
SpriteRenderer
>().
sprite
.
bounds
.
size
;
tra
=
BG
.
GetComponent
<
Transform
>();
Screen
.
orientation
=
ScreenOrientation
.
LandscapeLeft
;
Screen
.
autorotateToLandscapeRight
=
true
;
Screen
.
autorotateToLandscapeLeft
=
true
;
Screen
.
orientation
=
ScreenOrientation
.
AutoRotation
;
}
void
Update
()
...
...
Assets/Scripts/GameOver.cs
View file @
246d439f
...
...
@@ -19,7 +19,10 @@ public class GameOver : MonoBehaviour
public
Button
buttonPlay
;
void
Start
()
{
{
Screen
.
autorotateToLandscapeRight
=
true
;
Screen
.
autorotateToLandscapeLeft
=
true
;
Screen
.
orientation
=
ScreenOrientation
.
AutoRotation
;
}
void
Update
()
...
...
@@ -34,6 +37,7 @@ public class GameOver : MonoBehaviour
public
void
OnButtonPlayClicked
()
{
GameController
.
Speed
=
GameController
.
InitialSpeed
;
SceneManager
.
LoadScene
(
"Main"
);
}
...
...
Assets/Scripts/HighScores.cs
View file @
246d439f
...
...
@@ -16,6 +16,9 @@ public class HighScores : MonoBehaviour {
// Use this for initialization
void
Start
()
{
Screen
.
autorotateToLandscapeRight
=
true
;
Screen
.
autorotateToLandscapeLeft
=
true
;
Screen
.
orientation
=
ScreenOrientation
.
AutoRotation
;
ScoreText
.
text
=
""
;
Server
=
gameObject
.
GetComponent
(
typeof
(
Server
))
as
Server
;
}
...
...
Assets/Scripts/Menu.cs
View file @
246d439f
...
...
@@ -7,7 +7,9 @@ public class Menu : MonoBehaviour {
// Use this for initialization
void
Start
()
{
Screen
.
autorotateToLandscapeRight
=
true
;
Screen
.
autorotateToLandscapeLeft
=
true
;
Screen
.
orientation
=
ScreenOrientation
.
AutoRotation
;
}
// Update is called once per frame
...
...
Assets/Scripts/UIController.cs
View file @
246d439f
...
...
@@ -23,7 +23,7 @@ public class UIController : MonoBehaviour
void
Start
()
{
_player
=
GameObject
.
FindWithTag
(
"Player"
).
GetComponent
<
Player
>();
HighScore
.
enabled
=
false
;
HighScore
.
text
=
" "
;
// Keep position of elements, even when not displaying this one
_oldHs
=
PlayerPrefs
.
GetInt
(
"highscore"
);
}
...
...
@@ -45,7 +45,7 @@ public class UIController : MonoBehaviour
private
void
HandleScore
()
{
if
(
_oldHs
<
_player
.
Score
)
HighScore
.
enabled
=
true
;
HighScore
.
text
=
"New high score!"
;
}
private
void
HandlePowerUps
()
...
...
@@ -55,6 +55,5 @@ public class UIController : MonoBehaviour
private
void
DisplayBattery
()
{
Battery
.
sprite
=
BatteryImages
[
_player
.
Battery
/
8
];
Progression
.
sprite
=
ProgressionSprites
[
_player
.
Progression
/
5
];
}
}
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