I kind of knew I would fail this challenge but wanted to start a new prototype and see where it would go.
My idea was a simple roguelike, as you play and level up a random island that you start on grows in size and spawns new items and resources.
I created a simple chunk manager which only held one chunk; am array of tiles. Each tile has a texture(s) and also a box2D collision box. I decided to use box2D to manage the collisions rather than roll my own.
Made a start adding random items to the map (trees) and notifying the objects of collisions via box2D collision listeners:
Given I was only spending an hour or two each evening working on this I made some progress and made sure the code was clean and efficient, only actually managed 3/4 days out of the seven but am happy with what I got done and will work on this along side other prototypes.
I enjoyed starting a project from scratch and learning more about box2D collisions, there are some great tutorials available at http://www.iforce2d.net/b2dtut/collision-filtering, worth checking out. There is no harm in starting something you know you will fail from the start given you learn by doing so.
Only managed a few more hours dev but sticking with this. I have been using Box2D with LibGDX to manage collisions but previously only used the library for lights so spent some time learning about the collision listener and filtering.
Added tree’s to the game, for each land tile placed there is a 10% chance a tree is spawned in. As the trees are a resource I will need to ensure a map has a minimum number of these. The game has one array of entities which are sorted by the entity Y value.
– Trees have a Box2D hit box (green) for collisions and also a sensor (blue box). Had to handle transferring the collision from the box2D object to its parent entity which is not a box2D object.
Currently implementing actions on entities, so you can cut down a tree, build a house or weapon etc. Will then add in some enemies and have the island grow in size as you level up. Wont finish this is the time limit so may have to check the rules and do another 7 days!
Day 1 – Setup LibGDX project with camera, chunk manager and generated a randomly sized square island. Tile types are GRASS, WATER and CLIFF.
Day 2 – No progress
Day 3 – Generate Box2D shapes for each tile if it is not passable, started writing the code to produce a code for each tile to describe if the surrounding tiles are passable (will use this to add use more of the tileset later).
Added a hero which has a hitbox for collision and a sensor which can pass through blocks.
I will try to spend more time on this tomorrow but see how my daughter sleeps first, she is only 6 months old.