Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asteroids
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hexboard-games
asteroids
Commits
820e9d70
Commit
820e9d70
authored
9 years ago
by
Joseph Walton-Rivers
Browse files
Options
Downloads
Patches
Plain Diff
comments on how actions work
parent
49a03b8f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/asteroids/Action.java
+12
-0
12 additions, 0 deletions
src/asteroids/Action.java
with
12 additions
and
0 deletions
src/asteroids/Action.java
+
12
−
0
View file @
820e9d70
...
@@ -13,12 +13,24 @@ public class Action {
...
@@ -13,12 +13,24 @@ public class Action {
public
Action
()
{}
public
Action
()
{}
/**
* Create a new action to be executed by the controller
*
* @param thrust 1 is full thrust, 0 is nothing
* @param turn 1 is clockwise, -1 is anticlockwise, 0 is don't turn
* @param shoot true is fire, false is don't fire
*/
public
Action
(
double
thrust
,
double
turn
,
boolean
shoot
)
{
public
Action
(
double
thrust
,
double
turn
,
boolean
shoot
)
{
this
.
thrust
=
thrust
;
this
.
thrust
=
thrust
;
this
.
turn
=
turn
;
this
.
turn
=
turn
;
this
.
shoot
=
shoot
;
this
.
shoot
=
shoot
;
}
}
/**
* Create an action which is a copy of an existing action
*
* @param a the action to clone
*/
public
Action
(
Action
a
)
{
public
Action
(
Action
a
)
{
thrust
=
a
.
thrust
;
thrust
=
a
.
thrust
;
turn
=
a
.
turn
;
turn
=
a
.
turn
;
...
...
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