Skip to content

Conversation

@Abebes01
Copy link
Contributor

@Abebes01 Abebes01 commented May 24, 2025

This PR implements a complete Twine game player system that allows users to play uploaded Twine games directly within the site using an iframe interface, similar to our embedded games functionality. Previously, Twine games only opened in new tabs which provided an inconsistent user experience - this update creates a dedicated player with proper controls and navigation. What is added in this PR specifically is:

Created dedicated Twine game template twine_game.html with iframe rendering, game header info, and control buttons
Added play_twine_game view function with proper validation, error handling, and debug information
Added new URL route /games//play-twine/ for accessing the Twine player interface
Updated game detail template to conditionally show "Play Story" buttons for Twine games with book icons
Added fullscreen support, new tab option, and responsive design that matches existing UI
Added future-ready message listening for potential progress tracking integration

To easily test this PR:
First, run the command python manage.py test_user_uploads to create sample Twine games. Then, visit any Twine game detail page (URLs provided by the command output) and click the "Play Story" button to see the new iframe player interface. Test the fullscreen mode and new tab options to verify all controls work properly.
The files changed in this PR are mainly the new twine_game.html template, views.py for the new play_twine_game function, urls.py for the new route, and game_detail.html for the conditional play button logic. The implementation provides a consistent gaming experience across all game types while maintaining the unique storytelling feel appropriate for interactive fiction.

Please note that the tests do not include embedded games for now, since those have not been merged into dev yet.

Abebes01 added 2 commits May 23, 2025 23:39
Previous implimentation of user game upload hardcoded various variables and did not account for new additions such as embedded games. Revamped that functionality, and added a command file to test this.
Also added button to navigate to this page on game_details.html page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

3 participants