Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Progark gruppe 3
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Ingebrigt Ørstad
Progark gruppe 3
Commits
5db396f5
Commit
5db396f5
authored
5 years ago
by
Haakon Gunleiksrud
Browse files
Options
Downloads
Plain Diff
Merge branch '25-gameware' into 'dev'
Resolve "GameWare" Closes
#25
See merge request
!13
parents
6ed9c87f
07a79591
No related branches found
No related tags found
1 merge request
!13
Resolve "GameWare"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/core/src/com/gameware/game/GameWare.java
+29
-9
29 additions, 9 deletions
frontend/core/src/com/gameware/game/GameWare.java
with
29 additions
and
9 deletions
frontend/core/src/com/gameware/game/GameWare.java
+
29
−
9
View file @
5db396f5
...
...
@@ -3,31 +3,51 @@ package com.gameware.game;
import
com.badlogic.gdx.ApplicationAdapter
;
import
com.badlogic.gdx.Gdx
;
import
com.badlogic.gdx.graphics.GL20
;
import
com.badlogic.gdx.graphics.Texture
;
import
com.badlogic.gdx.graphics.g2d.SpriteBatch
;
import
com.gameware.game.states.GameStateManager
;
public
class
GameWare
extends
ApplicationAdapter
{
SpriteBatch
batch
;
Texture
img
;
public
static
final
int
WIDTH
=
480
;
public
static
final
int
HEIGHT
=
800
;
public
static
final
String
TITLE
=
"WackyWare!"
;
private
GameStateManager
gsm
;
private
SpriteBatch
batch
;
// private Music music;
private
static
GameWare
instance
=
null
;
//Singleton (lazy initialization)
public
static
GameWare
getInstance
(){
if
(
instance
==
null
){
instance
=
new
GameWare
();
}
return
instance
;
}
@Override
public
void
create
()
{
gsm
=
new
GameStateManager
();
batch
=
new
SpriteBatch
();
img
=
new
Texture
(
"badlogic.jpg"
);
//music = Gdx.audio.newMusic(Gdx.files.internal(("music.mp3")));
//music.setLooping(true);
//music.setVolume(0.1f);
//music.play();
//gsm.push(LoginState.getInstance(gsm));
}
@Override
public
void
render
()
{
Gdx
.
gl
.
glClearColor
(
1
,
0
,
0
,
1
);
Gdx
.
gl
.
glClearColor
(
0
,
0
,
0
,
1
);
Gdx
.
gl
.
glClear
(
GL20
.
GL_COLOR_BUFFER_BIT
);
batch
.
begin
();
batch
.
draw
(
img
,
0
,
0
);
batch
.
end
();
gsm
.
update
(
Gdx
.
graphics
.
getDeltaTime
());
gsm
.
render
(
batch
);
}
@Override
public
void
dispose
()
{
batch
.
dispose
();
img
.
dispose
();
// music
.dispose();
}
}
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