{"id":18325025,"url":"https://github.com/maxdeviant/peacock","last_synced_at":"2025-04-06T00:31:08.757Z","repository":{"id":57653969,"uuid":"169908041","full_name":"maxdeviant/peacock","owner":"maxdeviant","description":"A game engine for making beautiful games","archived":false,"fork":false,"pushed_at":"2021-04-04T15:45:12.000Z","size":319,"stargazers_count":59,"open_issues_count":2,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-21T13:53:23.785Z","etag":null,"topics":["game-development","game-engine","gamedev","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/peacock","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxdeviant.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-09T20:02:59.000Z","updated_at":"2025-02-08T10:54:19.000Z","dependencies_parsed_at":"2022-08-26T10:31:36.603Z","dependency_job_id":null,"html_url":"https://github.com/maxdeviant/peacock","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdeviant%2Fpeacock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdeviant%2Fpeacock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdeviant%2Fpeacock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdeviant%2Fpeacock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxdeviant","download_url":"https://codeload.github.com/maxdeviant/peacock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419597,"owners_count":20936009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game-development","game-engine","gamedev","rust"],"created_at":"2024-11-05T18:36:33.761Z","updated_at":"2025-04-06T00:31:07.072Z","avatar_url":"https://github.com/maxdeviant.png","language":"Rust","readme":"# Peacock\n\n[![Crates.io](https://img.shields.io/crates/v/peacock.svg)](https://crates.io/crates/peacock)\n[![Docs.rs](https://docs.rs/peacock/badge.svg)](https://docs.rs/peacock/)\n[![Crates.io](https://img.shields.io/crates/l/peacock.svg)](https://github.com/maxdeviant/peacock/blob/master/LICENSE)\n[![Travis](https://img.shields.io/travis/maxdeviant/peacock/master.svg?style=flat)](https://travis-ci.org/maxdeviant/peacock)\n\nPeacock is a game engine for making beautiful games.\n\n#### 🚧 UNDER CONSTRUCTION 🚧\n\nPeacock is still very much a work-in-progress. You're welcome to use it and report any issues you find, but I make no promises about stability or supporting your specific use cases until we hit `1.0.0`.\n\n## Installation\n\nTo install Peacock, add the following to your `Cargo.toml`:\n\n```toml\n[dependencies]\npeacock = \"0.0.1\"\n```\n\nIf you're like me and enjoy living on the bleeding edge, you can use a `git` dependency:\n\n```toml\n[dependencies]\npeacock = { git = \"https://github.com/maxdeviant/peacock\" }\n```\n\n\u003e Since we're still in the early days, I would suggest opting for the `git` dependency.\n\n### Dependencies\n\nPeacock is built on top of [SDL2](https://www.libsdl.org/download-2.0.php), so you will need to install the SDL2 libraries for your platform.\n\n#### Nix/NixOS\n\n```sh\nnix-shell\n```\n\n#### Debian/Ubuntu\n\nIf you're running a Debian or Ubuntu-based Linux distribution you can (most likely) do the following:\n\n```sh\nsudo apt install libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev\n```\n\n### macOS\n\n```sh\nbrew install sdl2 sdl2_image sdl2_ttf\n```\n\nFor other platforms check out the [`rust-sdl2`](https://github.com/Rust-SDL2/rust-sdl2) docs.\n\n## Usage\n\n```rust\nuse peacock::graphics::{self, Color};\nuse peacock::{Context, ContextBuilder, Result, State};\n\nstruct GameState;\n\nimpl State for GameState {\n    fn update(\u0026mut self, ctx: \u0026mut Context) -\u003e Result\u003c()\u003e {\n        Ok(())\n    }\n\n    fn draw(\u0026mut self, ctx: \u0026mut Context, dt: f64) -\u003e Result\u003c()\u003e {\n        Ok(())\n    }\n}\n\nfn main() -\u003e Result\u003c()\u003e {\n    ContextBuilder::new(\"Hello, world!\", 800, 600)\n        .build()?\n        .run(\u0026mut GameState)\n}\n```\n\n### Examples\n\nCheck out the [`examples`](./examples) directory for more in-depth examples.\n\n## Motivation\n\n![xkcd: Standards](https://imgs.xkcd.com/comics/standards.png)\n\n\u003e Fig 1: The state of Rust game engines.\n\nWith the abundance of 2D game engines for Rust it does seem a little silly that I would add yet another one into the mix, so I'll do my best to explain my motivations for writing Peacock.\n\nUp until recently I was using [`ggez`](http://ggez.rs) for my games, but it got to the point where it was pretty frustrating to work with. The `0.4.0` branch had a lot of shortcomings, bugs, and APIs that were on the chopping block. This led me to switch to the `devel` branch, which cleaned up some stuff, but in turn had issues of its own. Now, in light of [The State of GGEZ 2019](https://wiki.alopex.li/TheStateOfGGEZ2019), I figured it would be a good time to search for greener pastures.\n\n[Tetra](https://tetra.seventeencups.net/) was the next engine to catch my eye, and at a glance it makes a lot of the same decisions I would for an engine. But having just come off `ggez` I found it hard to sell myself on an even more immature engine. Even the thought of getting in at the ground-floor and contributing to Tetra didn't quite appeal to me either.\n\nThis got me thinking about what it is that I really want in a Rust game engine. After some thought, I think what it really comes down to is control. I want to be able to build games the way I want to without worrying about hitching my cart to an engine that goes down a direction that doesn't align with my goals.\n\n## Goals\n\n- Safety\n  - We're using Rust, so we want things to be safe\n  - Some of our libraries make this difficult:\n    - SDL2's C bindings are unsafe\n    - Peacock doesn't directly depend on it (yet), but in userland `specs` likes to panic a lot\n- \"Batteries Included\"\n  - Peacock should have everything in it that allows you to get games off the ground fast\n  - This may mean including things that aren't generic enough for _every_ game (e.g., input, pathfinding, etc.)\n    - We may be able to investigate making things modular here, but we don't want to overdo it and turn into [Piston](https://www.piston.rs/)\n- Consistent APIs\n\n### Non-Goals\n\nThings that I don't care about at this juncture:\n\n- Targeting web and mobile devices\n- 3D support\n\n## Prior Art\n\nHere are some of the engines that have served as inspiration for Peacock:\n\n- [ggez](http://ggez.rs)\n- [Tetra](https://tetra.seventeencups.net/)\n- [luxe](https://luxeengine.com/)\n- [MonoGame](http://www.monogame.net/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxdeviant%2Fpeacock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxdeviant%2Fpeacock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxdeviant%2Fpeacock/lists"}