-
Notifications
You must be signed in to change notification settings - Fork 9
Story Display using Initial Screen
This Wiki page provides an overview of the InitialScreen
and InitialScreenDisplay
classes in the game project. These classes are responsible for managing the initial screen, loading assets, and creating the user interface for the game's introduction sequence.
The InitialScreen
class is responsible for managing the initial screen of the game. It handles asset loading, UI creation, and rendering.
-
logger
: An instance of the SLF4J Logger for logging messages. -
introScreenAssets
: An array of file paths to image textures required for this screen. -
game
: The main game instance. -
renderer
: The renderer responsible for rendering the screen.
The InitialScreenDisplay
class is a user interface component responsible for displaying the initial story sequence.
-
game
: The main game instance. -
font
: BitmapFont for text rendering. -
textAnimationDuration
: Duration of the text animation. -
spaceSpeed
: Speed of the planet's movement. -
planetToTextPadding
: Padding between the planet and the text. -
background
: Image for the starfield background. -
planet
: Image for the animated planet. -
rootTable
: Table for UI layout. -
tweenManager
: TweenManager for animations. -
storyLabel
: Label for displaying the story text.
One of the key features of the InitialScreenDisplay
class is the text animation that introduces the game's story. This animation is achieved using the TweenEngine library, which provides a powerful way to create smooth and controlled animations. Here's how the text animation works:
-
setupTextAnimation()
: This method configures and starts the text animation using the TweenEngine library. Here's a breakdown of how it works:-
Tween Registration: The class
LabelAccessor
is registered as a TweenAccessor for theLabel
class. This allows the TweenEngine to animate properties ofLabel
instances, such as alpha (transparency). -
Initial Alpha: The initial alpha value of the
storyLabel
(the Label displaying the story text) is set to 0, making it fully transparent. -
Tween Configuration: The
Tween.to
method is used to configure the animation. It targets thestoryLabel
to gradually change its alpha value to 1 (fully opaque) over a duration oftextAnimationDuration
seconds. The animation easing function is set to Quint.OUT for a smooth exit animation. -
Start Animation: The animation is started using the
tweenManager
.
-
- LibGDX: The core framework for developing cross-platform games.
- We drew inspiration from Studio 1 to enhance our storytelling approach, particularly captivated by their captivating text and image animations. Subsequently, we meticulously overhauled our code, adopting the Universal Tween Engine to gain finer control over our animations. This empowered us to introduce elegant fade-in text animations and extend the duration of our image animations, creating a distinct and engaging visual narrative. It's important to note that our inspiration was solely in crafting a vision for our animation's potential aesthetics, and we did not draw any inspiration from the code, libraries, or Gradle libraries used by Studio 1.
-
Yash Mittal @YashMitttal
-
Aniket Gupta @aniketgupta17
-
Neil Barigye @neil-nb
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files