i'm working on an horizontal side scroller game where the player shouldn't touch the walls while it automatically proceed.
(not actual content, this is from an old game)
The player must also catch some objects while proceeding into the maze.
I need to pass to the vertex shader 8 key vertices coordinates, and it will take care to interpolate the position for all the remaining vertices.
in pseudo-code the generator should be
update(elapsed_time) {
space = velocity * elapsed_time;
for(i=0; i<8; i++){
verts[i] -=space;
}
if(verts[0]<0) { //out of screen
shifLeft(verts);
verts[7] = generate_new_vert();
}
total_space +=space; //passed to the fragment shader to correctly repeat the tiled texture
// the actual code will be a bit different since the X coordinate of the vertices in the array must match the ones of the vertices in the gpu in order to be able in the shader to use the correct value for the correct vertex, but it's just a matter of a few subtractions and checks
}
What is not clear to me is how should i write the (random) generation of the maze.
What i mean is:
- should i generate what path the player should follow, and create the maze according to it so that the player is almost forced to follow it?
- or should i just generate the maze with some random parameters(min-max distance between the maze and the obstacles, max player changing direction velocity,...)?
- not to force a single route
- guarantee that, whatever route s/he takes, s/he will be able to always proceed (obviously the "correct" way will be easier that the "wrong" way, but the "wrong" one will give more reward)
(i initially started this project as an occasion to learn openGL and shaders, so i didn't really thought too much into the design of the game, but now that i'm working on it i would like to make at least an interesting game to show to some friends, and maybe a basis for a bigger game
Edited by Makers_F, 14 October 2012 - 06:12 AM.






