vendredi 11 décembre 2020

[DirectX12] Match 3 on my Game Engine

 I made a Match 3 game with my game engine with Direct X12

Gameplay

Like the a lot of game like Candy Crush, the idea is to match 3 identicals candy vertically or horizontally. To make it, player have to pick 2 adjacent candy to swap them. When this occur , the candys are destroy and all the candy above fall, and news candy are create if need

Special candy can be create if more than 3 candy are destroy

- If it'is 4 candys vertically , a new candy is create which will  destroy all the line on the location of the candy
- If it'is 4 candy horizontally, a new candy is create which will destroy all the column on the location of the candy
- If it's 5 or more than , a special candy is create. If the player match with a candy near the special candy. All the candy same that the candy match are destroy

Multi threading

The gameplay algorithm is not very difficult. But I think the matching algorithm can be parralized 

Instead of iterate on each slot of the grid. I use a thread pool, when on each threads I send each lines of the grid.


Joker bonus

Start Grid

Vertical bonus candy


dimanche 6 décembre 2020

[DirectX12] Collision Function

 Collision is essential for any game engine. Most entity have basic shapes (Triangle, Sphere, Quad).

Their is a lot of kind of intersection here is the result on my game Engine


Line Line Collision

Line Line Collision (False)

Quad Quad Collision

Quad Quad Collision

Point Collision (False)

Point Collision

Point in Sphere

Point not in Sphere

Ray Sphere Collision

Ray Sphere Collision (False)

Ray Triangle Collision

Ray Triangle not Collision

Sphere Sphere Collision

Sphere Quad No collision

Bounding Sphere
Sphere Quad Collision