CrappyBall-cx is a clone to a popular game called FlappyBird and it is a simple 2D game written in cx. cx is a programming language developed by Skycoin Team. Please note that I am not a developer for the Skycoin team but I do hold Skycoin through my own purchases. The game was developed as my interest to learn the CX language as well as to promote social awareness to Skycoin and their projects. Please note that most codes are based on examples developed and written by amherag.
This new version of CrappyBall-cx is my attempt to understand how to load sprites and render texture animation. Please note that current sprite images are all done, made and sourced from Kilobolt. I didn't make the Sprite images and is simply using it for the time being until I can make something better.
As a small tribute to Kittycash project, I have added Pusheen the Cat as an alternative of the zombie bird sprite. All credit of the sprite goes to ChinZaPep, I am once again using it for educational purposes only. If you wish to play as zombie bird, just uncomment out the lines to load the bird sprites and draw bird.
CrappyBall-cx requires CX version 0.5.11 to run. In order to play it currently, you would need to install the necessary dependencies from https://github.com/skycoin/cx which includes Go, OpenGL and GLFW. Instructions below are from https://github.com/skycoin/cx for Debian-based Linux system. If you have CX installed, you could just skip these process and go straight to cloning the directory and running the game.
- Install Go (Version greater than 1.8 and 1.10)
- Configure $GOPATH environment variable
sudo apt-get install libxi-dev
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libxrandr-dev
sudo apt-get install libxcursor-dev
sudo apt-get install libxinerama-dev
sudo apt-get install libglfw3-dev
As per https://github.com/skycoin/cx, you need to have the latest version of curl
and git
installed. The below script checks if you have all the necessary Golang packages and tries to install them for you. It would then install CX for you.
sh <(curl -s https://raw.githubusercontent.com/skycoin/cx/master/cx.sh)
Once installation is completed, you should test your installation by running cx $GOPATH/src/github.com/skycoin/cx/tests
.
After all dependencies are installed and CX runs correctly. Clone the following depository by running:
git clone https://github.com/atang152/crappyBall-cx.git
Navigate to cloned directory:
cd crappyBall-cx/
Type in the following command when you are in the crappyBall-cx folder.
cx main.cx
or
cx *.cx
Press "SPACE" or "UP" key to make the bird or cat go up.
Alot of things. The current codebase is utter crap and needs to be completely refractored. Sphagetti code everywhere. I am still in the process of learning the cx language... e.g
- Refractor game into a more Entity-Component-System architecture
- Figure out how to use VAO/VBO for rendering instead of using OpenGL primitives
- Figure out how to build game into binary