Post

Visualizzazione dei post con l'etichetta destroy

Explosion effect - Camera shaking

Immagine
Every explosion has a shockwave effect, and this is usually shown in videogames with camera shaking . Unreal Engine has a built-in class that provides this kind of effect, so all we need to do is adding a new Blueprint class, and search for "Camera shake". I'll call it MyCameraShake . In the Blueprint editor we can change the parameters of the shake effect. What we need are the following: I set the duration to 0.4, so that it ends shaking just before the end of the visual explosion effect we created here . Now, in the usual EnemyBP editor, we can chain this effect to the ones already playing when we have a collision: The node to activate is "Play World Camera Shake", and we can assign it the class MyCameraShake . The location where the shake effect starts doesn't really matter, we can use the enemy location as we did for the particle system. The other 2 parameters to set are minimum radius: if the camera is placed within that radi...

Enemy swarm inside a TArray

Immagine
We don't want to stop to a single enemy, do we? It wouldn't be a great challenge... so we're going to create a list of enemies, so we can manage them even when there are more than one simultaneously on the map. First of all, I want a way to spawn them randomly on the borders of the map; for this purpose, I'm going to create a line of hidden hexagons all around the map, something like this: where the white tiles are the classic ones, and the gray ones will not be rendered, and will simply be used as starting "spawn coordinates" for the enemies. At the moment, I'll do this by assigning them the value "2" in the tiles[][] array during the map creation, but later I'm going to save them in a map file, once we manage the loading of the maps from File System. Next, I need a list of all active enemies in the map. The structucture I'm going to use is a TArray, that is a dynamic list of any object. This means we don't have ...