Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gosu/gosu.cr
Shard for the Gosu game library
https://github.com/gosu/gosu.cr
crystal-lang game-development game-engine gosu
Last synced: 12 days ago
JSON representation
Shard for the Gosu game library
- Host: GitHub
- URL: https://github.com/gosu/gosu.cr
- Owner: gosu
- License: mit
- Created: 2019-09-13T22:50:55.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-06T16:16:10.000Z (about 1 year ago)
- Last Synced: 2024-10-25T01:24:30.646Z (21 days ago)
- Topics: crystal-lang, game-development, game-engine, gosu
- Language: Crystal
- Homepage:
- Size: 3.31 MB
- Stars: 32
- Watchers: 8
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Actions Status](https://github.com/gosu/gosu.cr/workflows/Crystal%20CI/badge.svg?branch=master)](https://github.com/gosu/gosu.cr/actions)
# gosu.cr
Shard for using Gosu with Crystal_Under development:_ implementation is incomplete.
## Status
Implemented
* [x] Gosu
* [x] Window
* [x] TextInput
* [x] Font
* [X] Song
* [X] Sample
* [X] Channel
* [X] Image
* [X] GLTexInfo
* [ ] Color (in-progress)
* [ ] Numeric helper functions e.g. `90.degrees_to_radians`## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
gosu:
github: gosu/gosu.cr
```2. Run `shards install`
## Usage
```crystal
require "gosu"class Window < Gosu::Window
def initialize
super(512, 512)
end
endWindow.new.show
```Where possible gosu.cr imitates the [Ruby gem](https://rubydoc.info/gems/gosu).
## Development
### Unix
1. Install [gosu](https://github.com/gosu/gosu) as a system library, [see wiki](https://github.com/gosu/gosu/wiki/Getting-Started-on-Linux#compiling-gosu-for-c).
(Note: may need to edit `gosu/cmake/build/cmake_install.cmake` to change `set(CMAKE_INSTALL_PREFIX "/usr/local")` to `set(CMAKE_INSTALL_PREFIX "/usr")`)
2. Run your project: `crystal run --link-flags -lgosu-ffi YOU_PROGRAM.cr`### Windows
1. Build [gosu](https://github.com/gosu/gosu) using Visual Studio or MSBuild (GosuFFI project)
2. Copy `Gosu.lib` and `gosu-ffi.lib` into the /lib directory of your crystal-lang install
3. Copy `SDL2.dll` and `gosu-ffi.dll` into your project directory
4. Run your project: `crystal run YOUR_PROGRAM.cr`## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Contributors
- [Cyberarm](https://github.com/cyberarm) - creator and maintainer