Skip to content

rmottanet/snake-game-lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Snake Game 2D (Lua)

Welcome to Snake Game 2D in Lua! This is a classic arcade-style game where you control a snake, guiding it to eat food and grow while avoiding collisions with walls and its own tail. This project utilizes Lua and the LÖVE 2D framework for game development.


Requirements

To compile and run Snake Game 2D in Lua, you need the following:

  • Lua 5.x: LÖVE 2D is built on Lua, so a compatible Lua environment is inherently part of the LÖVE 2D installation.
  • LÖVE 2D: A free, open-source 2D game framework that handles graphics, audio, input, and other game development necessities.

Dependencies

Snake Game 2D for Lua depends on the following:

  • The LÖVE 2D framework (no external Lua libraries are explicitly required beyond what LÖVE provides).

Usage

To run Snake Game 2D in Lua, follow these steps:

  1. Install LÖVE 2D: Download and install LÖVE 2D from its official website: https://love2d.org/

    • For Windows, drag the project folder onto love.exe.
    • For macOS, drag the project folder onto the LÖVE application icon.
    • For Linux, navigate to the project's root directory in your terminal and run:
      love .
      If you're using an AppImage, ensure it's executable and specify its path followed by the project folder's path:
      ./love-11.5-x86_64.AppImage ./
      (Replace ./love-11.5-x86_64.AppImage with the actual path to your LÖVE AppImage if it's not in the current directory, and ./ with the path to the main.lua's containing folder if it's not in the current directory).
  2. Run the Game:

    • Navigate to the project's root directory (where main.lua is located).
    • Execute the game using your LÖVE 2D installation as described above.

Enjoy playing Snake Game 2D!


Other Versions

This Snake Game 2D project is part of a series of implementations in different programming languages. Explore other versions:

  • C++ Version: Find the original C++ implementation using SFML here.
  • Python Version: Explore the Python implementation using Pygame here.
  • JavaScript Version: Play the web-browser version here, with its source code available here.

Old School Gaming Hub

Snake Game 2D is part of the Old School Gaming Hub organization on GitHub. Old School Gaming Hub is dedicated to developing 2D games in various programming languages, providing nostalgic gaming experiences for enthusiasts and developers alike. Explore more projects and games from Old School Gaming Hub.


Thank you for choosing Snake Game 2D! If you have any questions, issues, or suggestions, please don't hesitate to reach out. Happy gaming! 🐍🎮



Static Badge Static Badge Static Badge Static Badge

About

Snake Game 2D: Classic arcade fun! Control the snake, eat, grow, and avoid collisions. Lua LÖVE implementation.

Topics

Resources

License

Stars

Watchers

Forks

Languages