Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MilderJoghurt
FrozenNumbers
Commits
ba926490
Commit
ba926490
authored
Jan 07, 2016
by
Fjen Undso
Browse files
use new background. but doesnt load
parent
67e09c44
Changes
6
Hide whitespace changes
Inline
Side-by-side
android/assets/backgrounds/background.jpg
View replaced file @
67e09c44
View file @
ba926490
220 KB
|
W:
|
H:
225 KB
|
W:
|
H:
2-up
Swipe
Onion skin
core/src/org/milderjoghurt/frozennumbers/FrozenNumbersGame.java
View file @
ba926490
...
...
@@ -66,19 +66,20 @@ public class FrozenNumbersGame extends ApplicationAdapter {
size3Params
.
fontParameters
.
size
=
40
;
assets
.
load
(
"size40.ttf"
,
BitmapFont
.
class
,
size3Params
);
assets
.
load
(
"backgrounds/background.jpg"
,
Texture
.
class
);
// menu
assets
.
load
(
"backgrounds/main-screen.png"
,
Texture
.
class
);
assets
.
load
(
"sprites/btn_help.png"
,
Texture
.
class
);
assets
.
load
(
"sprites/btn_ready_active.png"
,
Texture
.
class
);
assets
.
load
(
"sprites/btn_ready_inactive.png"
,
Texture
.
class
);
// tutorial
assets
.
load
(
"
background
s/tutorial
-screen
.png"
,
Texture
.
class
);
assets
.
load
(
"
sprite
s/tutorial.png"
,
Texture
.
class
);
assets
.
load
(
"sprites/btn_back.png"
,
Texture
.
class
);
// game
assets
.
load
(
"
background
s/game-
screen
.png"
,
Texture
.
class
);
assets
.
load
(
"
sprite
s/game-
border
.png"
,
Texture
.
class
);
assets
.
load
(
"sprites/bubble.png"
,
Texture
.
class
);
assets
.
load
(
"sprites/btn_next.png"
,
Texture
.
class
);
// sounds
assets
.
load
(
"snd/hit.mp3"
,
Sound
.
class
);
...
...
core/src/org/milderjoghurt/frozennumbers/screens/GameOverScreen.java
View file @
ba926490
...
...
@@ -39,7 +39,7 @@ public class GameOverScreen implements Screen {
m_Screens
=
FrozenNumbersGame
.
m_Screens
;
//generating backround
bg
=
new
Sprite
(
FrozenNumbersGame
.
assets
.
get
(
"backgrounds/
main-screen.pn
g"
,
Texture
.
class
));
bg
=
new
Sprite
(
FrozenNumbersGame
.
assets
.
get
(
"backgrounds/
background.jp
g"
,
Texture
.
class
));
float
scaleX
=
wWidth
/
bg
.
getWidth
();
float
scaleY
=
wHeight
/
bg
.
getHeight
();
bg
.
setScale
(
scaleX
,
scaleY
);
...
...
core/src/org/milderjoghurt/frozennumbers/screens/GameScreen.java
View file @
ba926490
...
...
@@ -72,8 +72,10 @@ public class GameScreen implements Screen {
m_Bounds
=
new
Rectangle
(
0
,
bubblradius
,
(
float
)
wWidth
,
(
float
)
wHeight
-
bubblradius
);
bg
=
new
Sprite
(
FrozenNumbersGame
.
assets
.
get
(
"backgrounds/game-screen.png"
,
Texture
.
class
));
bg
.
setSize
(
wWidth
,
wHeight
);
bg
=
new
Sprite
(
FrozenNumbersGame
.
assets
.
get
(
"backgrounds/background.jpg"
,
Texture
.
class
));
float
scaleX
=
wWidth
/
bg
.
getWidth
();
float
scaleY
=
wHeight
/
bg
.
getHeight
();
bg
.
setScale
(
scaleX
,
scaleY
);
bg
.
setCenter
(
wWidth
/
2.0f
,
wHeight
/
2.0f
);
hexbulder
.
setGridHeight
(
15
);
...
...
@@ -87,9 +89,8 @@ public class GameScreen implements Screen {
mapoffset
=
new
Vector2
(
0
,
(
wHeight
/
2.0f
)
-
(
float
)
test
.
getCenterY
());
bound
=
wHeight
/
2
f
;
//float) map.getByGridCoordinate(0, 6 ).getCenterY();
p1
.
sPos
=
new
Vector2
(
new
Vector2
(
wWidth
/
2.0f
,
bubblradius
+
5
));
p2
.
sPos
=
new
Vector2
(
new
Vector2
(
wWidth
/
2.0f
,
wHeight
-
(
bubblradius
+
5
)));
p1
.
sPos
=
new
Vector2
(
wWidth
/
2.0f
,
100
*
scaleY
);
p2
.
sPos
=
new
Vector2
(
wWidth
/
2.0f
,
wHeight
-
100
*
scaleY
);
}
@Override
...
...
@@ -108,9 +109,9 @@ public class GameScreen implements Screen {
private
void
playerlogic
(
Player
p
,
boolean
lower
)
{
if
(
p
.
active
==
null
)
{
p
.
active
=
new
Bubble
(
p
.
sPos
.
cpy
()
.
add
(-
100
,
0
)
);
p
.
active
=
new
Bubble
(
p
.
sPos
.
cpy
());
p
.
active
.
setSize
(
bubblradius
*
2
,
bubblradius
*
2
);
p
.
active
.
set
Pos
(
p
.
sPos
.
cpy
()
);
p
.
active
.
set
Center
(
p
.
sPos
.
x
,
p
.
sPos
.
y
);
System
.
out
.
println
(
p
.
active
.
getPos
());
}
...
...
@@ -305,7 +306,6 @@ public class GameScreen implements Screen {
}
private
void
drawTextCentered
(
String
text
,
float
x
,
float
y
,
Color
c
)
{
Actor
rotaater
;
Label
myLabel
=
new
Label
(
text
,
new
Label
.
LabelStyle
(
FrozenNumbersGame
.
assets
.
get
(
"size40.ttf"
,
BitmapFont
.
class
),
c
));
Label
myLabel2
=
new
Label
(
text
,
new
Label
.
LabelStyle
(
FrozenNumbersGame
.
assets
.
get
(
"size40.ttf"
,
BitmapFont
.
class
),
c
));
...
...
core/src/org/milderjoghurt/frozennumbers/screens/MainMenuScreen.java
View file @
ba926490
...
...
@@ -7,8 +7,11 @@ import com.badlogic.gdx.graphics.Color;
import
com.badlogic.gdx.graphics.GL20
;
import
com.badlogic.gdx.graphics.Texture
;
import
com.badlogic.gdx.graphics.g2d.Batch
;
import
com.badlogic.gdx.graphics.g2d.BitmapFont
;
import
com.badlogic.gdx.graphics.g2d.Sprite
;
import
com.badlogic.gdx.math.Vector2
;
import
com.badlogic.gdx.scenes.scene2d.ui.Label
;
import
com.badlogic.gdx.scenes.scene2d.ui.Table
;
import
org.milderjoghurt.frozennumbers.FrozenNumbersGame
;
...
...
@@ -30,7 +33,7 @@ public class MainMenuScreen implements Screen {
wHeight
=
FrozenNumbersGame
.
viewport
.
getWorldHeight
();
//generating backround
bg
=
new
Sprite
(
FrozenNumbersGame
.
assets
.
get
(
"backgrounds/
main-screen.pn
g"
,
Texture
.
class
));
bg
=
new
Sprite
(
FrozenNumbersGame
.
assets
.
get
(
"backgrounds/
background.jp
g"
,
Texture
.
class
));
float
scaleX
=
wWidth
/
bg
.
getWidth
();
float
scaleY
=
wHeight
/
bg
.
getHeight
();
bg
.
setScale
(
scaleX
,
scaleY
);
...
...
@@ -49,11 +52,11 @@ public class MainMenuScreen implements Screen {
//generating QuestionmarkButtons
p1_quest
=
new
Sprite
(
FrozenNumbersGame
.
assets
.
get
(
"sprites/btn_help.png"
,
Texture
.
class
));
p1_quest
.
setScale
(
scaleX
,
scaleY
);
p1_quest
.
setCenter
(
wWidth
/
2.0f
,
wHeight
/
4.0f
-
p1_quest
.
getHeight
());
p1_quest
.
setCenter
(
wWidth
/
2.0f
,
wHeight
/
4.0f
-
p1_quest
.
getHeight
()
*
scaleY
);
p2_quest
=
new
Sprite
(
FrozenNumbersGame
.
assets
.
get
(
"sprites/btn_help.png"
,
Texture
.
class
));
p2_quest
.
setScale
(
scaleX
,
scaleY
);
p2_quest
.
setCenter
(
wWidth
/
2.0f
,
wHeight
/
4.0f
*
3.0f
+
p2_quest
.
getHeight
());
p2_quest
.
setCenter
(
wWidth
/
2.0f
,
wHeight
/
4.0f
*
3.0f
+
p2_quest
.
getHeight
()
*
scaleY
);
p2_quest
.
rotate
(
180
);
p1_isready
=
false
;
...
...
@@ -113,6 +116,15 @@ public class MainMenuScreen implements Screen {
p1_quest
.
draw
(
batch
);
p2_quest
.
draw
(
batch
);
Label
p2TextLabel
=
new
Label
(
"Frozen Numbers"
,
new
Label
.
LabelStyle
(
FrozenNumbersGame
.
assets
.
get
(
"size40.ttf"
,
BitmapFont
.
class
),
Color
.
WHITE
));
Table
container
=
new
Table
();
container
.
setTransform
(
true
);
container
.
add
(
p2TextLabel
);
container
.
setRotation
(
180
);
container
.
setPosition
((
float
)
(
wWidth
/
2.0
),
(
float
)
(
wHeight
/
2.0
+
60
));
container
.
draw
(
batch
,
1
);
batch
.
end
();
//Starting game if ready
...
...
core/src/org/milderjoghurt/frozennumbers/screens/TutorialScreen.java
View file @
ba926490
...
...
@@ -28,7 +28,7 @@ public class TutorialScreen implements Screen {
wHeight
=
FrozenNumbersGame
.
viewport
.
getWorldHeight
();
//generating backround
bg
=
new
Sprite
(
FrozenNumbersGame
.
assets
.
get
(
"backgrounds/
tutorial-screen.pn
g"
,
Texture
.
class
));
bg
=
new
Sprite
(
FrozenNumbersGame
.
assets
.
get
(
"backgrounds/
background.jp
g"
,
Texture
.
class
));
float
scaleX
=
wWidth
/
bg
.
getWidth
();
float
scaleY
=
wHeight
/
bg
.
getHeight
();
bg
.
setScale
(
scaleX
,
scaleY
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment