Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Bricked
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robert Goldmann
Bricked
Commits
4f6e59cd
Commit
4f6e59cd
authored
Nov 30, 2016
by
Robert Goldmann
Browse files
Options
Downloads
Patches
Plain Diff
fixed
#34
parent
166298c3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/de/bricked/game/Game.java
+4
-4
4 additions, 4 deletions
src/de/bricked/game/Game.java
with
4 additions
and
4 deletions
src/de/bricked/game/Game.java
+
4
−
4
View file @
4f6e59cd
...
...
@@ -424,11 +424,11 @@ public class Game
public
Point2D
getNewSpeedDirection
(
Point2D
oldDirection
,
double
speed
)
{
double
influenceX
=
0.5
;
double
oldSpeed
=
Math
.
sqrt
(
oldDirection
.
getX
()
*
oldDirection
.
getX
()+
oldDirection
.
getY
()
*
oldDirection
.
getY
());
double
newXSpeed
=
speed
*
influenceX
;
double
newYSpeed
=
Math
.
sqrt
(
speed
*
speed
-
newXSpeed
*
newX
Speed
)
;
double
newXSpeed
=
oldDirection
.
getX
()
*
speed
/
oldSpeed
;
double
newYSpeed
=
oldDirection
.
getY
()
*
speed
/
old
Speed
;
return
new
Point2D
(
-
newXSpeed
,
-
newYSpeed
);
return
new
Point2D
(
newXSpeed
,
newYSpeed
);
}
}
\ No newline at end of file
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