-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into SaveManagerAttempt3
- Loading branch information
Showing
11 changed files
with
418 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Title: Wings Of Liberty | ||
By: EvgenyBardyuzha | ||
Website: https://pixabay.com/ | ||
|
||
Music was listed under Royalty Free |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
-= Developers =- | ||
|
||
-= Assessment 2 =- | ||
-= Team 29 "Shard Software" =- | ||
James Burnell | ||
Hector Woods | ||
Ben Faulkner | ||
|
||
-= Assessment 1 =- | ||
-= Team 28 "Mario" =- | ||
Annabeth Singleton | ||
Joseph Frankland | ||
Leif Kemp | ||
Hugo Kwok | ||
Saj Hoque | ||
Lucy Li | ||
|
||
|
||
-= Website =- | ||
www.mario.shardsoftware.tk | ||
|
||
Jensen Bradshaw | ||
James Burnell | ||
|
||
|
||
-= Audio =- | ||
|
||
Powerup SoundFX by 15.ai | ||
Based on characters from "TF2" | ||
|
||
Credits Music - "Wings Of Liberty" | ||
By EvgenyBardyuzha | ||
pixabay.com | ||
|
||
|
||
|
||
-= Graphics =- | ||
Original Assets By | ||
|
||
Annabeth Singleton | ||
Leif Kemp | ||
James Burnell | ||
|
||
|
||
-= Shard Software Logo =- | ||
|
||
James Burnell | ||
|
||
|
||
-= Software Used =- | ||
|
||
libGDX - Java Game Engine | ||
Blender - Shard Software Logo | ||
Eclipse & IntelliJ - Code Development | ||
Audacity - Audio Development | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Produced For The University of York | ||
As Part of Engineering 1 | ||
|
||
|
||
|
||
|
||
|
||
|
149 changes: 149 additions & 0 deletions
149
core/src/main/java/io/github/annabeths/GameScreens/CreditScreen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
package io.github.annabeths.GameScreens; | ||
|
||
import com.badlogic.gdx.Gdx; | ||
import com.badlogic.gdx.Input.Keys; | ||
import com.badlogic.gdx.Screen; | ||
import com.badlogic.gdx.audio.Music; | ||
import com.badlogic.gdx.graphics.Color; | ||
import com.badlogic.gdx.math.MathUtils; | ||
import com.badlogic.gdx.scenes.scene2d.Stage; | ||
import com.badlogic.gdx.scenes.scene2d.ui.Image; | ||
import com.badlogic.gdx.scenes.scene2d.ui.Label; | ||
import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle; | ||
import com.badlogic.gdx.utils.Align; | ||
import com.badlogic.gdx.utils.ScreenUtils; | ||
import com.badlogic.gdx.utils.viewport.FillViewport; | ||
|
||
import io.github.annabeths.GeneralControl.ResourceManager; | ||
import io.github.annabeths.GeneralControl.eng1game; | ||
|
||
/** | ||
* A screen to display credits for the game | ||
* | ||
* @since Assessment 2 | ||
* @author James Burnell | ||
*/ | ||
public class CreditScreen implements Screen { | ||
|
||
private eng1game game; | ||
private String creditText; | ||
/** How fast the credits scroll in px/sec */ | ||
private float scrollSpeed = 100; | ||
|
||
public Stage stage; | ||
public LabelStyle lblStyle; | ||
public Label label; | ||
public Image shardLogo; | ||
public Image marioLogo; | ||
|
||
public Music music; | ||
/** How long the music will fade out in seconds */ | ||
public static final float MUSIC_FADE_TIME = 4f; | ||
|
||
public CreditScreen(eng1game game) { | ||
this.game = game; | ||
|
||
creditText = Gdx.files.internal("ui/credits.txt").readString(); | ||
|
||
lblStyle = new LabelStyle(); | ||
lblStyle.font = ResourceManager.debugFont; | ||
lblStyle.fontColor = Color.WHITE; | ||
|
||
music = Gdx.audio.newMusic(Gdx.files.internal("audio/music/credits.mp3")); | ||
|
||
label = new Label(creditText, lblStyle); | ||
label.setAlignment(Align.center); | ||
label.setFontScale(1f); | ||
label.setHeight(label.getPrefHeight()); | ||
label.setPosition(0, -label.getPrefHeight() - 100); | ||
|
||
shardLogo = new Image(ResourceManager.getTexture("mario/shard-software-logo4.png")); | ||
shardLogo.setScale(0.5f); | ||
|
||
marioLogo = new Image(ResourceManager.getTexture("mario/full.png")); | ||
} | ||
|
||
@Override | ||
public void show() { | ||
stage = new Stage(new FillViewport(1280, 720)); | ||
|
||
label.setWidth(stage.getWidth()); | ||
stage.addActor(label); | ||
|
||
shardLogo.setPosition((stage.getWidth() - shardLogo.getWidth() * 0.5f) / 2, | ||
label.getY() - shardLogo.getHeight() * 0.5f); | ||
stage.addActor(shardLogo); | ||
|
||
marioLogo.setPosition((stage.getWidth() - marioLogo.getWidth()) / 2, | ||
shardLogo.getY() - marioLogo.getHeight()); | ||
stage.addActor(marioLogo); | ||
|
||
music.play(); | ||
} | ||
|
||
@Override | ||
public void render(float delta) { | ||
ScreenUtils.clear(Color.BLACK); | ||
|
||
// skip credits | ||
if (Gdx.input.isKeyJustPressed(Keys.ESCAPE)) { | ||
returnToMenu(); | ||
} | ||
|
||
// scroll text and images up | ||
float scrollAmount = scrollSpeed * delta; | ||
label.moveBy(0, scrollAmount); | ||
shardLogo.moveBy(0, scrollAmount); | ||
marioLogo.moveBy(0, scrollAmount); | ||
|
||
// go to the menu if the credits are over | ||
if (marioLogo.getY(Align.bottom) > stage.getHeight()) { | ||
returnToMenu(); | ||
} | ||
|
||
music.setVolume(MathUtils.clamp(timeLeft() / MUSIC_FADE_TIME, 0, 1)); | ||
|
||
stage.draw(); | ||
} | ||
|
||
public void returnToMenu() { | ||
game.gotoScreen(Screens.menuScreen); | ||
music.stop(); | ||
music.dispose(); | ||
} | ||
|
||
/** | ||
* How long is left in the credits before they end | ||
* | ||
* @return the time left in seconds | ||
*/ | ||
public float timeLeft() { | ||
return (stage.getHeight() - marioLogo.getY(Align.bottom)) / scrollSpeed; | ||
} | ||
|
||
@Override | ||
public void resize(int width, int height) { | ||
stage.getViewport().update(width, height, true); | ||
} | ||
|
||
@Override | ||
public void pause() { | ||
|
||
} | ||
|
||
@Override | ||
public void resume() { | ||
|
||
} | ||
|
||
@Override | ||
public void hide() { | ||
|
||
} | ||
|
||
@Override | ||
public void dispose() { | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.