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

Refactor Snake Game for Automatic Movement and Food Consumption #3

Closed
wants to merge 2 commits into from

Conversation

FreshMess
Copy link
Contributor

Hello,

I've made enhancements to the snake game to automate movement and food consumption. The original game was developed with Dev-C++, and I've refactored the code in main.cpp to ensure the snake moves autonomously and eats random foods effectively.

Changes Made:

  • Implemented automatic movement for the snake.
  • Enhanced food generation and consumption logic.
  • Updated console output handling for cross-platform compatibility.

This refactoring aims to improve the gameplay experience and functionality of the snake game. I've tested the changes locally to ensure they work as intended.

Please review and merge these changes into the main repository. Thank you!

Fixes: #1

- Replaced platform-specific header <windows.h> with cross-platform alternatives.
- Updated console output functions to be compatible with Linux terminal.
- Introduced sleep_ms function using std::this_thread::sleep_for for cross-platform delay.
- Adjusted build configuration to use system default compiler (g++).

This refactor ensures the snake game now runs on both Windows and Linux environments without platform-specific dependencies.

Fixes: #1 - fix auto snake game
Refactor snake game to be cross-platform compatible
@FreshMess FreshMess closed this Jun 30, 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.

fix auto snake game
1 participant