Continued adventures with the oneLoneCoder pixelGameEngine (youtube).
With the current game challenge, time has started to arc over and on the surface, I'm not looking all that great. Under the hood though, things are playing well with each other. I have most all of my render system in place, most update behaviors ready and still have some performance headroom, although I've dipped under standard monitor speed (60hz) sometime last week in test runs. So, two weeks. That's what I get to finish game play, leaving something for cleanup and GC blog/project setup. The original plan is still good and taken from concept to reality. We're here. Got balls, they go boom, they dig a hole and do a pretty splash on their way out the door. Perfect.
This last week a terrain smoothing feature was added. After a carve operation and the damage the particle system does as well, leaves pointy/jagged peaks. The smoothing provides landslide behavior and drops stray leftover pixels into the pile. As soon as I realized that, I saw a water implementation peeking it's head out of the sand. So again, here we are. The new yellow object is the puncture pin. Balls and pin against character and his pipes. If balls get the pin down to the pipe, we start flooding for effect game over. That's where my idea went. Did I mention, "not ...all that great"
Working on that mechanic for the next day or two. (I'll be back) (back) What I appreciate in this video is what you get just from std::rand and mod for polarity from the screen vertical position, plus a higher resolution chaos threshold to act or not. But watching std::rand() cycle through is not a bad thing at all in my opinion. Especially for fire and forget.
The initial stab at it was nice. Tomorrow, another particle system type as the spawner. As of now, I set an int in my world array to the water ID and update the array like so. Pretty easy and nice addition...now we're making progress.
if (terrain.isStable == true) // not used? always fires at 100 pixel row chunks
{
static int tty = terrain.nMapHeight - 1; // search row cursor location (y axis marker)
for (int n = 0; n < 200; n++) // update count rows of pixels
{
tty--; // advance on start for the iteration of the row
for (int x = 0; x < terrain.nMapWidth; x++)
{ // scan the single row this frame
int index = (tty * terrain.nMapWidth) + x; // this location data index
int indexDown = index + terrain.nMapWidth; // the pixel below
if (terrain.map[index] != 0)
{ // we're a pixel. is someone not below me?
if (terrain.map[indexDown] == 0)
{ // fall - swap down one pixel
terrain.map[indexDown] = terrain.map[index];
terrain.map[index] = 0;
} // no, is someone down and left?
if (terrain.map[index] == 1)
{ // dirt slide
float rnd = (float)std::rand() / (float)RAND_MAX;
bool bChaos = rnd > 0.95 ? true : false; // determine chaos for horizon movement
if (terrain.map[indexDown - 1] != 1 && bChaos == true)
{ // settle left - swap (down/left) one pixel
terrain.map[indexDown - 1] = 1;
terrain.map[index] = 0;
} // no, is someone down and right?
else if (terrain.map[indexDown + 1] != 1 && bChaos == true)
{ // settle right - swap (down/right) one pixel
terrain.map[indexDown + 1] = 1;
terrain.map[index] = 0;
}
}
if (terrain.map[index] == 2) //
{ // water slide // just right here (behavior)
int sign; //
tty % 2 == 0 ? sign = -1 : sign = 1;
if (terrain.map[index+sign] == 0)
{ // flow left - swap (left) one pixel
terrain.map[index+sign] = 2;
terrain.map[index] = 0;
}
}
}
}
if (tty == 0) // top row tested. reset to bottom to restart scan.
tty = terrain.nMapHeight - 1;
}
}
Reaching another week, with one remaining and some fluff. How we doing? pffttt....oh boy. yes and no. In a way, like that. I'm missing on a new and isolated collision check but the plan is improving. I have a loose event and restart working fine. Making progress on the the win aspect being one trigger away. The idea is to get at least one red ball over to the other side of the scrolling play area where a collector of sort awaits.. My level advance logic already works. The power up is in, I just havn't had the want to add in the cheezy AABB test or worse just length proximity trigger. Or imagined what I'm going to be powering up yet.
This weeks visual and the few issues I'm going after right now.
Picking up speed..is there enough for a safe landing? we'll see.
Second video added showing improved game play and the win case. An ace fell out of my sleeve when testing goal placement for the level progression. An interesting twist, to have to un-bury your target first...from here on out I'm telling the story different. But the block to steer and not take damage is a bonus. pffttt...everything from a step back has been bonus with the bogus plan I had
And lastly now, character involvement. In order to satisfy the scrolling aspect, the camera follows. In order to pretend like he has purpose, a shield has been granted to sink those explosive balls deep. This will close this entry. I now have power ups and an ester egg to go. I plan on tool tips (game play tips) in some small capacity and on the menu screen some clues on how this thing is played. Thanks for hanging out.
Once you get to the level of pixels, I get the impression all kinds of cool stuff becomes available that has been a lot harder since everything became triangles-triangles-triangles with 3d cards. Maybe you can do it with compute shaders I dunno. Water would be awesome, but we are getting low on time now!