Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
ohj1ht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pmikaiko
ohj1ht
Commits
6e168764
Commit
6e168764
authored
1 month ago
by
Kaikosuo Paavo
Browse files
Options
Downloads
Patches
Plain Diff
Nyt ei voi myöskään tuplakaasuttaa tai -jarruttaa
parent
9b8d1f0d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
peli/Peli/Peli/Peli.cs
+15
-7
15 additions, 7 deletions
peli/Peli/Peli/Peli.cs
with
15 additions
and
7 deletions
peli/Peli/Peli/Peli.cs
+
15
−
7
View file @
6e168764
...
@@ -538,18 +538,26 @@ namespace Peli
...
@@ -538,18 +538,26 @@ namespace Peli
// Ohjauksen logiikka
// Ohjauksen logiikka
private
void
W
()
//Eteen liikkuminen
private
void
W
()
//Eteen liikkuminen
{
{
auto
.
TopSpeed
=
5500
;
//Huippunopeus eteenpäin
if
((
Keyboard
.
IsKeyDown
(
Key
.
W
)
&&
Keyboard
.
IsKeyDown
(
Key
.
Up
)
==
false
)
||
auto
.
Acceleration
=
700
;
//Kiihtyvyys eteenpäin
(
Keyboard
.
IsKeyDown
(
Key
.
W
)
==
false
&&
Keyboard
.
IsKeyDown
(
Key
.
Up
)))
auto
.
Accelerate
();
//Kiihdyttää autoa
if
(
timerStarted
==
false
)
{
{
timerStarted
=
true
;
auto
.
TopSpeed
=
5500
;
//Huippunopeus eteenpäin
LuoAikalaskuri
();
auto
.
Acceleration
=
700
;
//Kiihtyvyys eteenpäin
auto
.
Accelerate
();
//Kiihdyttää autoa
if
(
timerStarted
==
false
)
{
timerStarted
=
true
;
LuoAikalaskuri
();
}
}
}
}
}
private
void
S
()
//Jarrutus
private
void
S
()
//Jarrutus
{
{
auto
.
Brake
();
//Jarruttaa
if
((
Keyboard
.
IsKeyDown
(
Key
.
S
)
&&
Keyboard
.
IsKeyDown
(
Key
.
Down
)
==
false
)
||
(
Keyboard
.
IsKeyDown
(
Key
.
S
)
==
false
&&
Keyboard
.
IsKeyDown
(
Key
.
Down
)))
{
auto
.
Brake
();
//Jarruttaa
}
}
}
private
void
D
()
//D-näppäin
private
void
D
()
//D-näppäin
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment