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
127027a8
Unverified
Commit
127027a8
authored
Oct 29, 2016
by
PLN (Algolia)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Game: Speed accelerates with time
parent
1e39ec4c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
GameController.cs
Assets/Scripts/GameController.cs
+4
-1
UIController.cs
Assets/Scripts/UIController.cs
+2
-1
No files found.
Assets/Scripts/GameController.cs
View file @
127027a8
...
...
@@ -8,6 +8,7 @@ namespace Assets.Scripts
public
class
GameController
:
MonoBehaviour
{
public
static
int
PoolSize
=
256
;
public
static
float
Speed
=
4f
;
public
GameObject
Wall
;
public
GameObject
BG
;
...
...
@@ -27,7 +28,9 @@ namespace Assets.Scripts
void
Update
()
{
Camera
.
main
.
transform
.
Translate
(
new
Vector3
(
4f
*
Time
.
deltaTime
,
0
,
0
));
if
(
Speed
<
16f
)
Speed
+=
0.0025f
;
Camera
.
main
.
transform
.
Translate
(
new
Vector3
(
Speed
*
Time
.
deltaTime
,
0
,
0
));
var
rightBorder
=
Camera
.
main
.
ScreenToWorldPoint
(
new
Vector3
(
Screen
.
width
,
Screen
.
height
,
0
)).
x
;
var
leftBorder
=
Camera
.
main
.
ScreenToWorldPoint
(
new
Vector3
(
0
,
0
,
0
)).
x
;
...
...
Assets/Scripts/UIController.cs
View file @
127027a8
...
...
@@ -31,7 +31,8 @@ public class UIController : MonoBehaviour
{
Distance
.
text
=
(
int
.
Parse
(
Distance
.
text
)
+
1
).
ToString
();
_player
.
Score
+=
1
;
_player
.
Score
+=
Mathf
.
RoundToInt
(
1f
*
(
GameController
.
Speed
/
4f
));
Score
.
text
=
_player
.
Score
.
ToString
();
NbVials
.
text
=
_player
.
NbVials
.
ToString
();
...
...
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