Sunday, August 16, 2015

Spawning Spikes in Walls and Making Sure They Aren't Hiding

In order for the spikes to spawn properly in walls, there needed to be something to store data for each block. Sure, the grid stored the StaticMeshActors, but they themselves had no extra portion for info, nor a map structure. What to do? A struct did the job nicely, and only needed to hold data on whether the spot was a ground piece and if it was a start/end piece. Once the spikes were up and running, I was rather confused, though; they were being pushed into locations where they definitely would just jut out into another block and become utterly useless. Reading into the grid structure I made for the maze, it turns out that the x coordinate actually was responsible for height and the y for width. Peculiar, but the multi-dimensional array had that constraint.

Afterwards, I needed to adjust the camera boom (arm to hold camera)'s relative rotation to the ball. The arm was set so that it would not change rotation as the ball rotated, but for some odd reason changing the relative rotation did not change a thing. After deleting the pawn from the editor, the game magically puts in its own pawn according to the GameMode, so I did not need to worry past that point as long as I set the location of the pawn in code at the beginning of gameplay.

I also setup a couple of sound effects using the PlaySoundAtLocation method from UGameplayStatics (the class responsible for all those convenient blueprint methods nobody could ever find in C++ code). Since I was not looking for anything particularly complex, I ditched the attenuation settings initialization and decided to do a quick distance check for the spike extension sounds.

And now, a very terrifying maze:



What's up next? A HUD for properly getting the time of the maze. One has to have something to work toward to make this gauntlet worthwhile.

No comments:

Post a Comment