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
Merge requests
!13
Resolve "GameWare"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "GameWare"
25-gameware
into
dev
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Turid Cecilie Dahl
requested to merge
25-gameware
into
dev
5 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
Closes
#25 (closed)
Edited
5 years ago
by
Turid Cecilie Dahl
0
0
Merge request reports
Compare
dev
dev (base)
and
latest version
latest version
07a79591
1 commit,
5 years ago
1 file
+
29
−
9
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
frontend/core/src/com/gameware/game/GameWare.java
+
29
−
9
Options
@@ -3,31 +3,51 @@ package com.gameware.game;
@@ -3,31 +3,51 @@ package com.gameware.game;
import
com.badlogic.gdx.ApplicationAdapter
;
import
com.badlogic.gdx.ApplicationAdapter
;
import
com.badlogic.gdx.Gdx
;
import
com.badlogic.gdx.Gdx
;
import
com.badlogic.gdx.graphics.GL20
;
import
com.badlogic.gdx.graphics.GL20
;
import
com.badlogic.gdx.graphics.Texture
;
import
com.badlogic.gdx.graphics.g2d.SpriteBatch
;
import
com.badlogic.gdx.graphics.g2d.SpriteBatch
;
import
com.gameware.game.states.GameStateManager
;
public
class
GameWare
extends
ApplicationAdapter
{
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
@Override
public
void
create
()
{
public
void
create
()
{
gsm
=
new
GameStateManager
();
batch
=
new
SpriteBatch
();
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
@Override
public
void
render
()
{
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
);
Gdx
.
gl
.
glClear
(
GL20
.
GL_COLOR_BUFFER_BIT
);
batch
.
begin
();
gsm
.
update
(
Gdx
.
graphics
.
getDeltaTime
());
batch
.
draw
(
img
,
0
,
0
);
gsm
.
render
(
batch
);
batch
.
end
();
}
}
@Override
@Override
public
void
dispose
()
{
public
void
dispose
()
{
batch
.
dispose
();
batch
.
dispose
();
img
.
dispose
();
// music
.dispose();
}
}
}
}
Loading