sunjay / turtle

Create Animated Drawings in Rust
http://turtle.rs
Mozilla Public License 2.0
559 stars 54 forks source link

Example: Hangman in Rust and turtle-rs #227

Closed enaut closed 3 years ago

enaut commented 3 years ago

Python turtle can do something like:

x = turtle.textinput("title", "promt")

With python I created with students guessing games and a hangman in turtle. I'm working with younger students, things like fractals etc. are not as interesting as for university students they usually want to create a simple game or similar. A screenshot from my python version of the game is (students do a lot better in actually designing the graphics :smile: ): galgenmännle

You can see the full (german) tutorial here: (https://pythonanleitung.github.io/050-galgen/010-hangman.html)

It would be even better to have something similar to #60 . As the separate dialogue always confuses the students.

Another feature needed would be to be able to write text. (see: #22 )

I'm thinking about moving my course to rust. Do you plan to add this feature - would you object to a pull request?

sunjay commented 3 years ago

Great idea! These are definitely features I want too. :)

As you noted, there are existing issues for each, so could you leave comments in each of those with these details? That way all the discussion will stay together.

The input prompt can potentially be something we do on the way to #60 so your example and screenshot are especially great details for the comments of that issue. We can close this issue once that's done.

The main blocker here is that Rust just doesn't have any really mature GUI or 2D drawing libraries yet (people are working on it!). Making something like an input dialog is pretty easy with Python because they have Tkinter and other frameworks.

We are probably going to switch away from the pathfinder 2D drawing library we're using now because of all the issues we've had (#183). That means it could become harder to draw text depending on what we switch to. I definitely appreciate your offer to contribute, but all of this means that there is unfortunately no easy path to either of these features at this time.

Your tutorial looks great and if you're okay with terminal input for now I'd definitely love to get you to contribute an example to the examples directory.

Hopefully that explains the situation we're in! Sorry it's not better than it is! I'm confident that it will improve soon. We're just not there yet. :)

enaut commented 3 years ago

Thank you for your comments! I'll do the hangman in rust!

As for the engine could bevy be a repacement? They have good cross platform support and have some basic UI functionality. At a quick glance it should be totally possible to create the UI you envisioned with existing features.

sunjay commented 3 years ago

Bevy does indeed look promising. I don't think ECS is a good fit for this library but we could potentially use their drawing or UI crates if it's possible for those to run independently from the rest of the engine. Bevy is still in its infancy though, so we probably don't want to start using it just yet.

Like I said, all of the functionality we need is actively being developed in other crates right now. It's just sadly not ready at this time. :(

Hopefully we'll get there soon! Thanks for working on the hangman example!

We can keep discussing, but I'm going to close this issue out now since I don't believe there are currently any actions to take. :)