Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Astro
rust-card10
Commits
0c091d97
Commit
0c091d97
authored
Oct 06, 2019
by
Astro
⚙
Browse files
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
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
Supports
Markdown
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