Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Week of Awesome III, Part 2: Progress

Week of Awesome III, Part 2: Progress

__Toz__
Inside the blizzard · · 1 min read
2,064 3
A lot has happened since the last post on my journal. Here is a screenshot that shows the start of the first level.
mGLWjeQ.png

It already looks kinda decent. The objects look terribly out of place though, since no lighting is done yet. One interesting thing to note is that none of these objects, except the player, have texture coordinates. All the texture coordinates are calculated in the vertex shaders and are based on the vertex position and normals.

The collision for the level is also loaded in a bit unusual way. What I do is this: In Blender I go to the forward facing view (numpad 1) and trace a line of vertices over all the objects that the player should collide with. This way the line of vertices can be imported and converted into a Box2D edge body.

I also got the main game mechanic working, when the player now dies they respawn an leave behind a pile of bones that can be used to cross over spikes and to get to higher ground. I've already got some ideas about how to create fun puzzles with this.

Lastly I want to show the level format. During competitions like this, it's important to keep things a simple as possible. That's why the level format I use is just a JSON file referring to the assets the level uses and the location of some other objects in the level.

[spoiler]{ "startPosition": [-30.0, 2.0], "collision": "level0_collision.obj", "objects": [ { "mesh": "level0_floor.obj", "material": "trail" }, { "mesh": "level0_rocks.obj", "material": "rock" }, { "mesh": "level0_trees.obj", "material": "tree" }, { "mesh": "level0_gravestones.obj", "material": "graveStone" } ], "spikes": [ [-8.0, 0.0], [-6.0, 0.0], [-4.0, 0.0] ], "sprites": [ { "position": [-26.4, -0.2, -0.5], "size": [2.8, 2.8], "texture": 3 } ]}
[/spoiler]

Discussion

Loading comments...