o
odin.langpkg.dev
packages / library / pong

pong

78abb13library

No description provided.

MIT · updated 1 year ago

pong

Pong game made with Odin.

Prerequisites

Make sure you have the following installed:

  • Odin
  • (Optional) Python 3 for running the build script (3.10+ preferred)

You're now ready to write code!

Building

While you can always use the Odin compiler to compile or run your program, you can also use the build script build.py.

Since this is script is written in Python, you will need to have Python3 installed on your machine to run it.

Refer to the self-documentation of the script for more info about what you can do with it:

Windows

> py build.py -h

Linux, MacOS

$ ./build.py -h

Note on Virtual Environments

While it's a good practice to use virtual environments when working with Python, this script currently doesn't have any dependencies so it's fine to use it without one.

Having said that, if you extend the script and add some external dependencies via Pip and the like, I strongly recommend that you create a requirements.txt file to put your dependencies, and then create and use a virtual environment.

Using Pip

requirements.txt

requests==2.32.3

Windows - Command Prompt

> python -m venv .venv
> .\.venv\Scripts\Activate
> pip install -r requirements.txt

Windows - Powershell Terminal

> python -m venv .venv
> & .\.venv\Scripts\Activate.ps1
> pip install -r requirements.txt

Linux, MacOS

$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt

Using uv

It's the year 2025, so do yourself a favor and just go ahead and install uv

Once installed, the commands above will be as easy as follows:

Windows

> uv init
> uv venv
> uv add requests
> uv run build.py -h

Linux, MacOS

$ uv init
$ uv venv
$ uv add requests
$ uv run build.py -h

License

MIT