Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bagel-template
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
Eleanor McMurtry
bagel-template
Commits
31c3d3ec
Commit
31c3d3ec
authored
Aug 13, 2020
by
Eleanor McMurtry
Browse files
Options
Downloads
Patches
Plain Diff
bagel test
parent
df4f6ef1
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
pom.xml
+36
-0
36 additions, 0 deletions
pom.xml
res/bagel.png
+0
-0
0 additions, 0 deletions
res/bagel.png
res/smiley.png
+0
-0
0 additions, 0 deletions
res/smiley.png
src/BagelTest.java
+55
-0
55 additions, 0 deletions
src/BagelTest.java
with
93 additions
and
0 deletions
.gitignore
0 → 100644
+
2
−
0
View file @
31c3d3ec
/.idea
/target
This diff is collapsed.
Click to expand it.
pom.xml
0 → 100644
+
36
−
0
View file @
31c3d3ec
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
au.edu.unimelb.cis
</groupId>
<artifactId>
bagel
</artifactId>
<version>
0.1-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<build>
<plugins>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
11
</source>
<target>
11
</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.source>
11
</maven.compiler.source>
<maven.compiler.target>
11
</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>
io.github.eleanor-em
</groupId>
<artifactId>
bagel
</artifactId>
<version>
1.9.2
</version>
</dependency>
</dependencies>
</project>
This diff is collapsed.
Click to expand it.
res/bagel.png
0 → 100644
+
0
−
0
View file @
31c3d3ec
659 KiB
This diff is collapsed.
Click to expand it.
res/smiley.png
0 → 100644
+
0
−
0
View file @
31c3d3ec
5.95 KiB
This diff is collapsed.
Click to expand it.
src/BagelTest.java
0 → 100644
+
55
−
0
View file @
31c3d3ec
import
bagel.*
;
/**
* An example Bagel game.
*
* @author Eleanor McMurtry
*/
public
class
BagelTest
extends
AbstractGame
{
private
Image
smiley
;
private
Image
bagel
;
private
float
x
=
100
;
private
float
y
=
100
;
public
BagelTest
()
{
super
(
800
,
600
,
"Hello World"
);
bagel
=
new
Image
(
"res/bagel.png"
);
smiley
=
new
Image
(
"res/smiley.png"
);
}
/**
* The entry point for the program.
*/
public
static
void
main
(
String
[]
args
)
{
BagelTest
game
=
new
BagelTest
();
game
.
run
();
}
/**
* Performs a state update. This simple example shows an image that can be controlled with the arrow keys, and
* allows the game to exit when the escape key is pressed.
*/
@Override
public
void
update
(
Input
input
)
{
float
speed
=
0.5f
;
if
(
input
.
isDown
(
Keys
.
LEFT
))
{
x
-=
speed
;
}
if
(
input
.
isDown
(
Keys
.
RIGHT
))
{
x
+=
speed
;
}
if
(
input
.
isDown
(
Keys
.
UP
))
{
y
-=
speed
;
}
if
(
input
.
isDown
(
Keys
.
DOWN
))
{
y
+=
speed
;
}
if
(
input
.
wasPressed
(
Keys
.
ESCAPE
))
{
Window
.
close
();
}
bagel
.
draw
(
Window
.
getWidth
()
/
2
,
Window
.
getHeight
()
/
2
);
smiley
.
draw
(
x
,
y
);
}
}
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