2D Spaceship Game is a classic game since Gameboy's came out, but even it's an old type of game, many people still play it until now. This game gives you objective to survive an attack against obstacle or NPC. this genre needs a collision detection, an algorithm that allows you to detect collision between 2 collidable objects, the method uses quadtree, a method that allows certain area divided by itself in order to focusing collision detection, this method works if there is 2 collidable objects in the same place at the same time. So if there's no object or just 1 object in certain area, the collision detection algorithm won't work, this method is more optimal than just use the collision detection and implement it straight to the game (bruteforce) because the collision detection it's not focused in certain area and the algorithm will detect in all areas. That means the quadtree use less resource and the frame per second will increase, After being tested for couple times, the Quadtree Algorithm able to bust the FPS up, the average FPS for Bruteforce is 70.06 FPS, and the average FPS for Quadtree Collision Detection is 268.1 FPS
Copyrights © 2019