The power key helps when there is a raid, although it seems that one has to be careful with them because they aren't given as a gift.
danirod
Creator of
Recent community posts
Corridors and random terrain generation
Just a quick entry because it's getting late and I still have to get up early one day more (holidays are coming).
I managed to randomly generate corridors today. These are the corridors the player is able to walk through to find resources, supplies and enemies in his own spacecraft. It is not the only room in the spacecraft so there will be more randomly generated scenarios (the planets, for instance).
I made the corridors today: (https://twitter.com/danirod93/status/6790679133331...). I will add tomorrow the remaining room generation to have a complete corridor.
Replay: https://www.livecoding.tv/video/libgdxjam-day-3-4/ and https://www.livecoding.tv/video/libgdxjam-day-3-5/ and https://www.livecoding.tv/video/libgdxjam-day-3-6/
I still have to do my timelapse with my work this weekend. However I'm fighting ffmpeg to generate the video. Stay tuned, I really want to make some timelapses based on my work in this jam.
Cool things about OrthographicCamera
My last post for today is dedicated to the OrthographicCamera. Why would I dedicate a post to a class? Well, it turns out that you can make clever things with this class if you know how.
OrthographicCamera 101: Using cameras you can control the viewport of your game. Things like zoom, panning and such can be easily handled using cameras. You use cameras when you create a SpriteBatch (even if you don't, libGDX creates a camera for you). You use cameras when you create Scene2D stages (even if you don't, libGDX creates a SpriteBatch for you).
One of the methods, `setToOrtho`, let's you define the viewport of your screen. Then, the viewport is scaled to fit inside the screen. So, as an example, if you make your viewport 320x240 and your screen is 1280x720, the viewport is scaled to fit in the screen unless you change that.
This introduces something funny. In SpriteBatch, the units used by the draw() method aren't screen units, they are viewport units. This means, that if your viewport is 30x20 and you do
batch.draw(texture, 29, 19, 1, 1)
You'll get your texture on the upper right corner of the screen, even if your screen is 1280x720, because the batch is using viewport units.
How does this fit into a tiled map? Usually all of your tiles have the same width and the same height (sometimes even width == height).
If you set your viewport size to your screen size divided by your tile size, you can make your viewport units to be tiles!!!
So, for example, say that I want to fit 30x20 tiles on my window. I could do:
camera.setToOrtho(false, 30, 20)
Do you want to draw a texture over the tile 3x4? Just do:
batch.draw(texture, 3, 4)
Of course, if your viewport aspect ratio is not the same as your screen aspect ratio, you will get a very bad looking game, but if you play nicely with that, you will get great results.
I have tried to work in the past with tile systems and I always dealed with multiplying pixels per tiles because I didn't know this cool trick. Now that I know... phew! what a waste of time I have just avoided, don't you think?
Roguelikes, players and our friend Ashley
Replay: https://www.livecoding.tv/video/libgdxjam-day-2-5/ and https://www.livecoding.tv/video/libgdxjam-day-2-6/
After working on maps, I worked on the player and how the user would control it.
I feel that this game is slowly evolving into some roguelike-style game. Take a look at my previous tweet earlier today: https://twitter.com/danirod93/status/6786681809450...
Let's talk about what do I expect to do with this. Remember that the player will have to slightly explore some planets. Not explore a complete planet, but there is a small map for every planet, with the antenna tower, resources and that. The player might as well just walk through the spaceship to find food or other resources or to kill any enemy trying to invade the vehicle. This is where the roguelike concepts like life, turn attacks and that could come good.
Now, if you read my previous post, you can see that I already have an OrthographicCamera setted up because of the Tiled Map rendering. How do I render the player?
I'm using Ashley. Although I knew about ECS engines before, I never worked with any ECS engine and it is the first time that I love with an engine like this. And I have to admit, that I'm in love with the Ashley library.
It is super easy to start once you read the docs. Just create a few components with the data, create a few systems, iterate through every entity implementing a given component in the systems, and you are done.
I find this a good alternative to Scene2D. Scene2D is also easy to set up and it gives you a lot of code already written so you don't have to deal with that, but it has the problem that most of the Actors end up having a lot of unrelated code inside of it. Using components, you can split your code into reusable small classes and then apply components only to the entities that makes sense.
Tiled Maps
Replay: https://www.livecoding.tv/video/libgdxjam-day-2/ - https://www.livecoding.tv/video/libgdxjam-day-2-4/
One of the things I worked today on was maps. I started with the spacecraft map, specifically the cabin, since what I wanted to accomplish today, more than an actual map, was a test on what I could do with what libGDX offers to me.
There is an interesting API in libGDX for handling tiled maps: TiledMap, TiledMapLayer, and that. There is even a loader for loading TMX files from Tiled. I made a map using Tiled and then I could load it using the loader and it worked. The camera acted funny when scaling the window but for most of it, it works.
So, for example, I can have a class generating a TiledMap and then make use of an OrthographicCamera and an OrthogonalTiledMapRender to render my map. Of course, the TiledMap must load the textures by itself (the TMX loader would read them from the file), but that is not hard to deal with.
I'm using that system because I prefer to use an already existing API (even if it's hard to use manually) rather than having to create my own tile rendering system on top of libGDX. I suspect my API would be less optimal than what TiledMap is already, and I would waste time doing something that already exists.
In my next blog post I'll talk about what I added next: the player movement, which makes use of Ashley, a library that I wanted to use for this game.
Planets, everywhere
Replay: https://www.livecoding.tv/video/libgdxjam-day-1-2/ (part 1) and https://www.livecoding.tv/video/libgdxjam-day-1-4/ (part 2). Also, see the tree: https://github.com/danirod/libgdxjam01/tree/458d87...
I started working on some art for one of the scenes of the game, which are the space scenes where the space should be visible as a background image. Here you have me designing a few planets. And here is the final result plus some stars as a background too.
At the moment they were generated by me, but would be cool if I could procedurally generate more planets to make things even more random. I imagine every game being different to any previous one so that the experience is always new. This things are pretty common today, don't look me like that! ;_;. I'll invest some time on playing with Perlin Noise, to make smooth textures for the planets.
I would continue for today, but I need a rest. Let's see tomorrow.
Brainstorming is officially over.
I have been prototyping earlier this morning some game concepts I had on my mind: https://www.livecoding.tv/video/libgdxjam-day-1/, to attract inspiration (not so much luck). After a walk outside (we have some really pretty landscapes where I live), I have reconsidered my ideas and have finally decided the following plan.
First of all, a technical note. The game is not mobile-first. Mobile-second maybe, if I figure out that later. But I'm going to assume that my player has a keyboard and a mouse. This makes things easier because now I don't have to deal with fatty fingers, screen resolution, readability of texts and more importantly user input.
This theme choosing is getting longer than what I expected (jeez, I'm so newbie on jams), so let's get to the point. I've recycled my previous ideas: black holes, going back to Earth, mazes--WAIT, didn't you say yesterday that mazes make no sense in space? Indeed, but let's talk about planets too.
My idea: the player is lost in space and seriously wants to go home. The Earth has send a rescue team on his way. Remember, the year is 2148, and space exploration is a thing. You get out of your house, pick your car and go shopping to Mars or to work at Jupiter. Our player is lost 3000 light years away from Earth. He must survive while the rescue team comes.
His tasks:
- Don't die.
- Protect his spacecraft from enemies. Enemies might be aliens or space bandits (of course there are!).
- Keep the radio link up. This is very very important. There are a few radio repeaters on planets around him keeping a radio link that lets he talk to the Earth. If the radio link is lost, he won't be rescued. There are a few repeaters. Just make sure that the radio strength is over x% (not chosen yet) and everything will be OK.
- Of course, to fix these radio links you must go to these planets. You land on the planet, do your business, go back to space.
These planets should have more things, I know, to take advantage of them. Some random ideas:
- Food and other survival resources. Grab food or you will starve.
- Spacecraft fuel? It has to be somewhere. Your spacecraft doesn't have infinite energy. (Just like in 2015, electricity companies wouldn't allow it :P).
I still have the door open to more ideas, but this is it.
It's 3:40PM, I have lost the count of how many times I have had the word "space" in my mind. I haven't even have lunch yet. Let me eat something, and I'll be ready to rock.
Welcome to danirod's devlog
Jam Theme: Life in Space
Official channels:
- GitHub Page: https://github.com/danirod/libgdxjam01
- My LiveCoding page (I'm streaming my development): http://www.livecoding.tv/danirod
- My Twitter for announcements: http://twitter.com/danirod93
- This devlog: (you know the link)
Brainstorming (Day 0)
Streaming reupload: https://www.livecoding.tv/video/libgdxjam-day-0-4/
I had a quick brainstorm yesterday followed by a longer brainstorm this morning on what I expect to create. Yesterday the idea about black holes looked funny. However, a cup of coffee has gave me better ideas.
What about... the year is... somewhen in the future. 2149 or a year like that. You are a lost traveller in space and your objective is to be back on earth. There are bad people out there and you must be back safe and on time. You have a limited timespan (something about 7-14-30? in-game days).
I still have to think some mechanics on that. I'll keep you updated.
Hi everyone. My name is Dani and I'm a 22 year old developer from Spain. Already been using libGDX for a while and this year I have published my first game on the Play Store using libGDX.
This is my first time in a jam. I cannot stay coding an entire weekend because I have obligations and sometimes even a life, but having a few weeks is great. I'll participate alone and my tools will be GIMP, Inkscape, Audacity, bfxr. Probably Box2D and Tiled too. I still have these few days to think whether going with Kotlin or stick with Java...
Good luck everyone and let's have fun!