https://github.com/skycoin/cx-game
Game Prototype
https://github.com/skycoin/cx-game
Last synced: 4 months ago
JSON representation
Game Prototype
- Host: GitHub
- URL: https://github.com/skycoin/cx-game
- Owner: skycoin
- Created: 2021-03-19T11:27:54.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-06-30T20:38:03.000Z (almost 4 years ago)
- Last Synced: 2024-06-19T01:50:36.304Z (almost 2 years ago)
- Language: Go
- Size: 24.9 MB
- Stars: 7
- Watchers: 8
- Forks: 15
- Open Issues: 51
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cx-game
Game Prototype
---
CX game is a new 2D console game.
## Table of Contents
* [Installation](#installation)
* [Compiling on Linux](#compiling-on-linux)
* [Compiling on MacOS](#compiling-on-macos)
* [Compiling on Windows](#compiling-on-windows)
* [Resources and libraries](#libraries-used)
---
## Installation
cx-game requires Golang version of `1.13+`
## Compiling on Linux
Install dependencies with
```
sudo apt update
sudo apt install -y glade xvfb libxinerama-dev libxcursor-dev libxrandr-dev libgl1-mesa-dev libxi-dev libperl-dev libcairo2-dev libpango1.0-dev libglib2.0-dev libopenal-dev libxxf86vm-dev libasound2-dev make
```
### Install Go
* Go to [Go Downloads](https://golang.org/dl/) and download from the featured downloads for linux, something like `go1.16.2.linux-amd64.tar.gz`
* Extract the archive and install, you may require root or sudo \
For example: \
```rm -rf /usr/local/go && tar -C /usr/local -xzf go1.16.2.linux-amd64.tar.gz```
* Add /usr/local/go/bin to the PATH environment variable. \
Or just use this for a quick check \
```export PATH=$PATH:/usr/local/go/bin```
* Verify that you've installed Go by opening a command prompt and typing the following command: `go version`\
\
Following [this](https://golang.org/doc/install) for more.
#### Install `git` using apt
```bash
sudo apt update
sudo apt install git
```
You can use any other code editor, for installing sublime run these commands:
#### Install `sublime` using apt
```bash
sudo apt update
sudo apt install sublime-text
```
### Usage
Run the program.
```bash
git clone https://github.com/skycoin/cx-game.git
cd cx-game
go mod download
go run main.go
```
A window should appear, with a cat use `a`, `s`, `d`, `w` to move the cat around.\
\
Open source code in editor
```!bash
cd cx-game
subl ./
```
## Compiling on MacOS
### Install Go
* Go to [Go Downloads][golang] and download from the featured downloads for Apple macOS, something like `go1.16.2.darwin-amd64.pkg`
* Open the package file you downloaded and follow the prompts to install Go.
* Verify that you've installed Go by opening a command prompt and typing the following command: `go version`\
Following [this](https://golang.org/doc/install) for more.
#### Install `git` with brew
```!bash
brew install git
```
#### Install `sublime` with brew
```!bash
brew install --cask sublime-text
```
### Usage
Run the program.
```bash
git clone https://github.com/skycoin/cx-game.git
cd cx-game
go mod download
go run main.go
```
A window should appear, with a cat use `a`, `s`, `d`, `w` to move the cat around.\
\
Open source code in editor
```!bash
cd cx-game
subl ./
```
## Compiling on Windows
### Install Go
* Go to [Go Downloads][golang] and download from the featured downloads for Microsoft Windows, something like `go1.16.2.windows-amd64.msi`
* Open the package file you downloaded and follow the prompts to install Go.
* Verify that you've installed Go by opening a command prompt and typing the following command: `go version`\
Following [this](https://golang.org/doc/install) for more.
#### Install `git` from executable
* Download git from [git-scm.com][git-scm]
* Open the executable and follow the prompt to install git.
#### Install `sublime` from executable
* Go to sublime [downloads page][sublimetext]
* Download the executable for windows
* Open the executable and follow the prompts to install sublime.
#### Install `MinGW`
* Download MinGW installer from [here][mingw_online]
* Open the executable and follow the instructions.
* Select **Architecture = x86_64** as show in the picture. 
* Now go to the installed directory and run **mingw-w64.bat** to add mingw to PATH.
#### Install `OpenAL`
* Download and extract zip archive from [openal.org][openal.org]
* Run the installer
### Usage
Opening terminal
1. Click the Start menu.
2. In the menu's search box, type cmd, then press the Enter key.
3. In the Command Prompt window that appears, type the following command:
Run the program from terminal
```bash
git clone https://github.com/skycoin/cx-game.git
cd cx-game
go mod download
go run main.go
```
A window should appear, with a cat use `a`, `s`, `d`, `w` to move the cat around.\
\
Open source code in editor
* Open sublime text editor
* Drag and drop cx-game folder into sublime text editor
---
## Libraries Used
- [glfw](https://github.com/go-gl/glfw/)
- [gl](https://github.com/go-gl/gl/)
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
[golang]:https://golang.org/dl/
[git-scm]:https://git-scm.com/download/win
[sublimetext]:https://www.sublimetext.com/3
[mingw_online]:https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe
[openal.org]:https://openal.org/downloads/