Tower of Hanoi-type mini-game?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Quester
Newbie
Posts: 20
Joined: Wed Jul 08, 2015 12:54 pm
Completed: Inspector Magnusson: Murder on the Titanic, Emily Archer and the Curse of Tutankhamen, The Mysterious Case of Dr. Jekyll and Mr. Hyde, 1912 Titanic Mystery
Projects: Sorority Sister Sleuths, TimeSlip, The Siren of Seattle, Adventure: Antarctica!
Organization: Quester Entertainment
Location: USA
Contact:

Tower of Hanoi-type mini-game?

#1 Post by Quester »

Has anyone seen a posting of Ren'py code for the classic Tower of Hanoi game (see attached screenshot) that could be incorporated into a VN? If so, could please you send me a link?
Attachments
ToH screenshot.png

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Tower of Hanoi-type mini-game?

#2 Post by xela »

Never but this is easy to do, look for drag/drop and Solids.
Like what we're doing? Support us at:
Image

Cazrook
Newbie
Posts: 1
Joined: Mon Dec 28, 2015 3:00 am
Contact:

Re: Tower of Hanoi-type mini-game?

#3 Post by Cazrook »

I am new at this, and had been looking for some sort of minigame-like thing to practice Ren'Py programming. So I have flagrantly stolen your idea and implemented a Towers of Hanoi game/screen thing.

I'm sure the experts will find a lot of things I've done in it to be horrifying, but in the mean time, I will post it here in case you are still looking for something like it. hanoi.rpy is the game, script.rpy is just an example of how to call it. (Basically: use "call hanoi_game_start()" and pass the number of blocks to use.)

(Also, if any benevolent experts feel like pointing out one or two of the more horrifying things I've done so that I can avoid them in the future, it would be appreciated. Especially, if there's a way to avoid all the fiddly position calculation that seems necessary because Drags have to go in DragGroups instead of layout containers?)
Attachments
script.rpy
Hanoi demo script
(1.61 KiB) Downloaded 259 times
hanoi.rpy
Hanoi game file
(16.54 KiB) Downloaded 289 times

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Tower of Hanoi-type mini-game?

#4 Post by xela »

Looks solid, for someone "new at this", you get 11/10 for coding :)
Like what we're doing? Support us at:
Image

User avatar
Alex
Lemma-Class Veteran
Posts: 3090
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Tower of Hanoi-type mini-game?

#5 Post by Alex »

Could you post the script in a coockbook section?...))

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]