A Finnish Fable

A Finnish Fable

What is A Finnish Fable?

A Finnish Fable is a cheery platformer set in Iron Age Finland. Run, jump, and arrow-climb through levels while avoiding squirrels and moose(meese?). Enjoy cloudberries to replenish your health and listen to Finnish folk songs in the background.

Scene 2d

Wes ZonePosted by Wes Mon, October 17, 2016 05:21PM
LibGDX has a scene 2d class which is really nice to work with. The way it works is that you create a stage for every scene that you have. A scene could be your main menu screen or your death screen or any level. Then you would create actors to put in the stage. An actor does not have to be a character, it could be something so simple as a tile or an arrow or even the background.

Usually what I do is I have each Actor be it's own class. Inside that class I would extend the Actor class and override the act and draw function. You can think of the act function like the update function in Android. This is where you would update what needs to be updated for the actor to work correctly. For example, an arrow needs to keep moving once it has been shot so in the act class you update the position of the arrow per frame. The draw function is pretty simple in the fact that all you do is draw your actor.

Once you made all your actors for the scene, you would add the actors to the stage and then in your main function you can call stage.act() and stage.draw() in order to get the game moving and make it look seamless. The fact that LibGDX provides this makes writing the game so much easier.

That's Scene2d for you. Next time i will dive into my BaseCharacter and BaseEnenmy classes to give you guys an idea on how I write my characters. It will be more like a game programming 101 post.

Make something great,
Wes





  • Comments(0)//aff.mitomon.com/#post8