Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fubark/ray-cyber
https://github.com/fubark/ray-cyber
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/fubark/ray-cyber
- Owner: fubark
- License: mit
- Created: 2023-02-12T19:31:04.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-08-28T12:13:59.000Z (3 months ago)
- Last Synced: 2024-08-28T13:39:24.044Z (3 months ago)
- Language: C
- Size: 8.33 MB
- Stars: 22
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ray-cyber
Complete [raylib 5.0](https://github.com/raysan5/raylib) bindings for [Cyber](https://cyberscript.dev)!
Bindings auto-generated from [cbindgen.cy](https://github.com/fubark/cyber/blob/master/src/tools/cbindgen.cy).Start using by importing the URL from your script.
# Requirements.
* [Cyber v0.4-dev](https://github.com/fubark/cyber/releases/tag/latest)# Instructions.
1. [Install Cyber](https://github.com/fubark/cyber#install)
2. Create a new cyber script `game.cy`:
```text
use rl 'https://github.com/fubark/ray-cyber'rl.InitWindow(800, 600, 'Hello')
rl.SetTargetFPS(60)-- Main game loop
while !rl.WindowShouldClose():
-- Do game update...
rl.BeginDrawing()
rl.ClearBackground(rl.RAYWHITE)
rl.DrawText('Congrats! You created your first window!', 190, 200, 20, rl.LIGHTGRAY)
rl.EndDrawing()rl.CloseWindow()
```
3. Run the game!
```sh
cyber game.cy
```# More examples.
```sh
git clone https://github.com/fubark/ray-cyber
cd ray-cyber
```
## Snake
```sh
cyber examples/snake.cy
```
![snake](./images/classic_snake.png)## Asteroids
cyber examples/asteroids.cyhttps://user-images.githubusercontent.com/94020660/219881427-1244fd8d-29da-4a72-87bb-fcef46de650a.mp4
## Clash
cyber examples/clash.cyhttps://user-images.githubusercontent.com/94020660/219976051-ea658da6-e46b-4bbf-b191-f73151efa309.mp4
# Troubleshooting.
Cyber caches the Raylib dependencies into `~/.cyber`. After an upgrade to Cyber or Raylib, repull the dependencies with `-r`:
```sh
cyber -r game.cy
```