I am positive you bear in mind taking part in the traditional sport of Snake. This straightforward but addictive sport required you to maneuver an ever-growing snake whereas consuming pixels and avoiding collisions with the exterior partitions and the snake’s personal tail. Now, think about taking that nostalgic gameplay and putting it within the great world of cartography – welcome to Map Snake!
Map Snake takes the cherished arcade expertise and enhances it by integrating the gameplay with the interactive maps of main international cities. Now, you will need to information your snake by means of a metropolis panorama, acquire markers, and keep away from your individual tail. This recent tackle a traditional sport combines the much-loved gameplay of Snake with the distinctive geography and tradition of cities world wide. Get able to slither your approach by means of an thrilling mix of nostalgia and cartography with Map Snake!
I coded Map Snake this morning for the #30DayMapChallenge. Using the highly effective MapLibre library, the sport animates a linestring on high of OpenFreeMap map tiles. The animated linestring is managed by keyboard occasion listeners that observe the participant’s instructions. The sport features a easy collision detection system to find out when the snake interacts with its personal tail and makes use of localStorage to maintain observe of a participant’s highest rating. Every time a brand new sport begins, the map shifts to a random location chosen from an array of seven international cities.
In the intervening time, the sport may be very easy, however I’ve a number of concepts for enhancing the gameplay. For now, I’ve only one sport tip: in case your snake strikes out of the present map view, don’t panic! Simply carry out a blind U-turn, and your snake ought to quickly slither again into view.