Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Astro
rust-card10
Commits
0c091d97
Commit
0c091d97
authored
Oct 06, 2019
by
Astro
⚙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rkanoid: invert accel sensor direction
this one got reversed in recent c-firmware revisions.
parent
0988fe2e
Pipeline
#4146
passed with stage
in 9 minutes and 54 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
rkanoid/src/main.rs
rkanoid/src/main.rs
+2
-2
No files found.
rkanoid/src/main.rs
View file @
0c091d97
...
...
@@ -212,9 +212,9 @@ fn game(level: u16, mut score: u32) -> GameResult {
paddle
+=
PADDLE_SPEED
;
}
if
accel_x
<
0
{
paddle
=
paddle
.saturating_sub
(
-
accel_x
as
u32
)
;
paddle
+
=
-
accel_x
as
u32
;
}
else
if
accel_x
>
0
{
paddle
+
=
accel_x
as
u32
;
paddle
=
paddle
.saturating_sub
(
accel_x
as
u32
)
;
}
paddle
=
paddle
.max
(
paddle_size
)
...
...
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