Skip to content

Commit 951efb7

Browse files
Small changes
1 parent 674c125 commit 951efb7

5 files changed

Lines changed: 42 additions & 7 deletions

File tree

-1.93 MB
Loading
-3.76 KB
Loading

kapotopia/core/src/gdx/kapotopia/Animations/EvilTomAnimation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public EvilTomAnimation(Animation.PlayMode playMode) {
1515
Array<TextureAtlas.AtlasRegion> r = atlas.findRegions("tom");
1616
TextureAtlas.AtlasRegion[] array = r.toArray();
1717

18-
setAnimation(new AnimationBuilder(0.05f).withPlayMode(playMode)
18+
setAnimation(new AnimationBuilder(0.03f).withPlayMode(playMode)
1919
.addFrames(array).build());
2020
}
2121
}

kapotopia/core/src/gdx/kapotopia/Screens/mockupG1.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ public mockupG1(final Kapotopia game) {
192192
*/
193193
// Camera
194194
this.camera = new OrthographicCamera(game.viewport.getWorldWidth(), game.viewport.getWorldHeight());
195-
this.camera.position.set(0, 0,0); // I dont understand why, but this works. If someone knows plz explain me. F.D.
196-
this.camera.update();
197195
game.viewport.setCamera(camera);
198196
// Making Animations
199197
batch = new SpriteBatch();
@@ -224,12 +222,11 @@ public void render(float delta) {
224222
camera.update();
225223
batch.setProjectionMatrix(camera.combined);
226224

227-
stateTime += delta;
228-
229225
stage.act(Gdx.graphics.getDeltaTime());
230226
stage.draw();
231227

232228
if (getCurrentSeqIndex() == 0 || getCurrentSeqIndex() == 1) {
229+
stateTime += delta;
233230
batch.begin();
234231
final TextureRegion m = mireilleBlink.getKeyFrame(stateTime, true);
235232
batch.draw(m, camera.viewportWidth / 4f, 0,0,0,

kapotopia/core/src/gdx/kapotopia/Screens/mockupG3.java

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22

33
import com.badlogic.gdx.Gdx;
44
import com.badlogic.gdx.graphics.GL20;
5+
import com.badlogic.gdx.graphics.OrthographicCamera;
6+
import com.badlogic.gdx.graphics.g2d.Animation;
7+
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
8+
import com.badlogic.gdx.graphics.g2d.TextureRegion;
59
import com.badlogic.gdx.scenes.scene2d.Stage;
610
import com.badlogic.gdx.scenes.scene2d.ui.Image;
711
import com.badlogic.gdx.scenes.scene2d.ui.Label;
12+
import com.sun.org.apache.bcel.internal.generic.FALOAD;
813

14+
import gdx.kapotopia.Animations.EvilTomAnimation;
915
import gdx.kapotopia.Fonts.UseFont;
1016
import gdx.kapotopia.GameConfig;
1117
import gdx.kapotopia.Helpers.Align;
@@ -20,6 +26,14 @@
2026

2127
public class mockupG3 extends CinematicScreen {
2228

29+
private final float scalling_factor = 0.6f;
30+
31+
private OrthographicCamera camera;
32+
private SpriteBatch batch;
33+
34+
private Animation<TextureRegion> evilTom;
35+
private float stateTime;
36+
2337
public mockupG3(final Kapotopia game) {
2438
super(game, new Stage(game.viewport), "mockupG3");
2539

@@ -75,7 +89,6 @@ public mockupG3(final Kapotopia game) {
7589
}
7690
};
7791

78-
final float scalling_factor = 0.6f;
7992
// Backgrounds
8093
final Image house = ImageHelper.getBackground(game.viewport, "game3/intro/Monde2Ecran1.png");
8194
final Image inside = ImageHelper.getBackground(game.viewport, "game3/intro/Monde2Ecran2.png");
@@ -132,7 +145,7 @@ public mockupG3(final Kapotopia game) {
132145
},
133146
{
134147
inside,
135-
tom,
148+
//tom,
136149
bubbleRight
137150
},
138151
{
@@ -142,6 +155,17 @@ public mockupG3(final Kapotopia game) {
142155
}
143156
};
144157

158+
/* EXTRAS */
159+
// Camera
160+
this.camera = new OrthographicCamera(game.viewport.getWorldWidth(), game.viewport.getWorldHeight());
161+
game.viewport.setCamera(camera);
162+
// Making Animations
163+
batch = new SpriteBatch();
164+
evilTom = new EvilTomAnimation(Animation.PlayMode.NORMAL).getAnimation();
165+
stateTime = 0f;
166+
167+
/* ENDING */
168+
145169
this.applyBundle(new ParameterBundleBuilder(ScreenType.GAME3)
146170
.withImages(images).withLabels(labels).withFinishBtn(false).withNextBtnStyle(UseFont.CLASSIC_BOLD_NORMAL_WHITE));
147171
}
@@ -156,7 +180,21 @@ public void render(float delta) {
156180
Gdx.gl.glClearColor(0, 0, 0, 1);
157181
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
158182

183+
camera.update();
184+
batch.setProjectionMatrix(camera.combined);
185+
186+
187+
159188
stage.act(Gdx.graphics.getDeltaTime());
160189
stage.draw();
190+
191+
if (getCurrentSeqIndex() == 4) {
192+
stateTime += delta;
193+
batch.begin();
194+
final TextureRegion t = evilTom.getKeyFrame(stateTime, false);
195+
batch.draw(t, camera.viewportWidth * 0.075f, camera.viewportHeight * 0.04f,
196+
0, 0, t.getRegionWidth(), t.getRegionHeight(), scalling_factor, scalling_factor, 0);
197+
batch.end();
198+
}
161199
}
162200
}

0 commit comments

Comments
 (0)