Tanuki Game

Tanuki Game

Screenshot of the Tanuki Gameplay

Author(s): Danial Daneshfar

Role: Developer

Date: 2022-09

Tools: JavaScript, JQuery, HTML, CSS

Challenge: Getting Tanuki to go around the screen without going completely off the viewport.

Solution: Got two variables to capture the screen's width and height when the function is called, and based my Math.random function with the results of the screen size in mind.


This was the first JavaScript game that I made. Although it is very simple, I will always hold this game dearly because I have learned a lot of core JavaScript concepts thanks to it. The original idea was based off of duck hunt, a game where you have to click on a flying duck, but modified it to include a timer as well as removed the murder aspects of it. There are 3 difficulties which determine how fast Tanuki the dog moves, how many points you need to win, and also how much time you have left.


I developed this game as my first real JavaScript project. I had a lot of fun building this project, and I plan to remake it with the skills I have gained since I originally made it back in July of 2022. For the development process, I tried to make use of most of the JavaScript skills I’ve learned as opposed to making the bare minimum game.

For the time I wrote it, there are a couple lines of code that I’m impressed to have known, such as the set time out to show and hide the bubbles when you click on Tanuki.

I remember the hardest part when making this was finding out what the user’s screen was to make sure Tanuki doesn’t create a horizontal scroll bar from going completely off screen.


I did not focus too much on styling, as it was mostly a game to test out JavaScript features, but that being said I drew out Tanuki based on the memory of a dog drawing I saw on Instagram. The images, such as the background, and the music I took from royalty free websites such as pixabay and unsplash. The modal, buttons and UI of the game I styled myself with CSS.