Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
vishnukap-project-1
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vishnudutt Kappagantula
vishnukap-project-1
Commits
3b6522d9
Commit
3b6522d9
authored
3 years ago
by
roguecomp
Browse files
Options
Downloads
Patches
Plain Diff
added Bird.class with its own attributes
parent
8d3395e2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Bird.java
+30
-0
30 additions, 0 deletions
src/Bird.java
with
30 additions
and
0 deletions
src/Bird.java
0 → 100644
+
30
−
0
View file @
3b6522d9
import
bagel.Image
;
public
class
Bird
{
/* positive means moving up, negative means moving down */
public
double
velocity
;
private
static
int
frameCounterSinceStart
=
0
;
public
Image
birdWingUp
=
new
Image
(
"res/birdWingUp.png"
);
public
Image
birdWingDown
=
new
Image
(
"res/birdWingDown.png"
);
public
final
double
acceleration
=
0.4
;
public
final
double
terminalVelocity
=
10
;
public
final
double
x
=
200
;
public
double
y
=
350
;
public
void
Bird
()
{
}
public
void
Render
()
{
if
(
this
.
frameCounterSinceStart
%
10
==
0
)
{
this
.
birdWingUp
.
draw
(
this
.
x
,
this
.
y
);
/* repeat every 10 frames */
}
else
{
this
.
birdWingDown
.
draw
(
this
.
x
,
this
.
y
);
}
this
.
frameCounterSinceStart
++;
}
}
\ 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