Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced Mobile Compatibility and controls. Solved issue #6 #20

Closed
wants to merge 1 commit into from

Conversation

AshwinGajbhiye
Copy link

#6 -->
This is resolved by using HTML,CSS AND JAVASCRIPT

In the body tag i have added four buttons to control the snake
Screenshot 2024-03-15 120356

After that in css file i have decorated the buttons and have set their position in the bottom left corner for easy access
image

And I have added the javascript which is playing the main role . In which first I have created four constants for each of the four buttons . After that i have added the addEventListner function for each of the buttons which after being clicked calls back to the
inputDir function which sets the direction of the snake on the basis of the button clicked and the value of x and y respectively.
image

the final image of the game is given below:--
image

@ANKITy102
Copy link
Contributor

ANKITy102 commented Mar 15, 2024

@AshwinGajbhiye, show button in mobile view rather than in desktop view.

@ANKITy102 ANKITy102 closed this Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants