• Register

An Island survival sandbox game. Build up your resources, build your shelter, fish and hunt for food and just stay alive. Early development, missions/achievements/story to come later.

Image RSS Feed Latest Screens
New Adventurer! New menu system being developed Fish Spawner on full power
Blog RSS Feed Report abuse Latest News: LibGDX Cut Scene Prototype

0 comments by carelesslabs on May 19th, 2014

Currently working on a game for Wing Wing Shoot Bag using Java with LibGDX. While trying to learn Pixel/Game art I produced a few animated GIFS, one of which would be perfect for the main screen. This concept will be developed further and used within Endure.

Being a little lazy I thought of loading in the individual images and looping through them rather than create one large image and cut it up programmatically for an animation. This worked, I had created a sort of slide player.

After pressing start within the game menu I wanted the current frame to pause and fade out, then the intro of the game would play. The intro follows the movie to which the game is based, several images would fade in, hold then fade out.

Fading in and out
First off I needed to find a way to fade an image in or out, there is a library available to do this: Code.google.com

I followed the guide and setup a Sprite Accessor class: Class source

Slide Manager
Next I created a slide manager class, this would hold an array of slides which could have some simple attributes:

  • sprite;              // The image
  • fade_duration  // Time to fade in or out
  • hold_duration  // Time to hold slide on screen after fade in
  • total_duration  // time for fade in, hold and fade out
  • gap_duration   // time between slides

Classes: Slide Class - Slide Manager

Creating and using the Slide manager
Basically you initiate the new class then add to the array of images with some settings. During the render loop you tell the class to update and it will play your images in order; fading them in and out.

// Declare a new var
SlideManager slide_manager;

// Slides
slide_manager = new SlideManager();

// Add slides that fade in for 4 seconds, holds for 1 seconds
// After fade out leaves a gap of 1 seconds before next slide

slide_manager.add_slide(new Slide("intro/screens/russian.png", 4, 1, 1));
slide_manager.add_slide(new Slide("intro/screens/spy.png", 4, 1, 1));

// Add a slide with an overlay animation
// Passes animation width, speed and position
slide_manager.add_slide(new Slide("bck.png", 2, 0, 1, "frames.png", 70, 0.1f, 45, 25));

I started playing about with a few variations of slides, would probably move the extras such as animations into an array and create a new animation class to pass with the slide.

This is a render loop for the intro screen, when the slides are done it just loads the next screen:

public void render(float delta) {
Gdx.gl.glClearColor(0, 0, 0, 0);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
slide_manager.tick(delta);

// DRAW
batch.begin();
if (!slide_manager.finished){
slide_manager.draw(batch);
}
batch.end();

if (slide_manager.finished){
game.setScreen(game.level_one);
}
}

This is a very quick prototype which only allows simple fading in and out and overlaying of one animation. It requires a library to be imported even though setting the colour(Alpha) of a sprite over time is very simple I could go on to use many more of the libs features.

This class will allows me to quickly create simple comic book style cuts scenes between levels while prototyping.

Media RSS Feed Latest Video
Post comment Comments
carelesslabs
carelesslabs Aug 25 2014, 6:34pm says:

Good news, we are back working on the game. Its going to be multiplayer and have similar aspects to some other popular Zombie survival games.

+1 vote     reply to comment
FahriAuditore
FahriAuditore Feb 26 2014, 12:51am says:

Looking up for this!! And hope there is a co-op or multiplayer LAN :D

+2 votes     reply to comment
carelesslabs
carelesslabs Aug 27 2014, 2:42pm replied:

Just started again on this, working on multi-player version. I think it has to be multi player to make it more interesting. As @Jourdan_Cameron said, its a blank canvas right now.

Time to make some decisions and really get back into the project.

+1 vote     reply to comment
carelesslabs
carelesslabs Apr 2 2014, 5:15am replied:

Thanks for checking it out, have lots of plans for this, as I just commented below I have another project to run with for a while but this is the game is most want to complete. @carelesslabs on twitter if your interested.

+1 vote     reply to comment
TKAzA
TKAzA Jan 6 2014, 8:28am says:

Loving the simple tile art, looking forward to seeing the crafting system inplace, tracking.

+3 votes     reply to comment
carelesslabs
carelesslabs Apr 2 2014, 5:13am replied:

Thanks, I would like to get a demo out soon, as a one man team and two projects open at the moment I am a bit delayed with this one. Have big plans for it though

+1 vote     reply to comment
carelesslabs
carelesslabs Jan 7 2014, 8:20am replied:

Thanks, the crafting system is in place right now, but there is only one recipe. It follows MC style crafting but I would like to expand on it later. I will add a few basic items and put an article up on crafting soon and look forward to feedback on it.

+1 vote     reply to comment
Leanardoe
Leanardoe Jan 6 2014, 12:31am says:

What is this game programmed in?

+1 vote     reply to comment
carelesslabs
carelesslabs Jan 6 2014, 6:55am replied:

Java using LibGDX & Box2D Lights

+2 votes     reply to comment
Guest
Guest Dec 24 2013, 7:53am says:

This comment is currently awaiting admin approval, join now to view.

Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

Icon
Endure
Platforms
Windows, Mac, Linux
Developed By
carelesslabs
Engine
libGDX
Contact
Send Message
Release Date
TBD
Game Watch
Track this game
Share
Style
Genre
Adventure
Theme
Fantasy
Players
Single Player
Project
Indie
Boxshot
Boxshot
Embed Buttons

Promote Endure on your homepage or blog by selecting a button and using the HTML code provided (more).

Endure
Endure
Statistics
Rank
1,281 of 18,789
Last Update
3 months ago
Watchers
23 members
News
5