Hi Streamlit Community! ![]()
I’ve been pushing the boundaries of what’s possible with Streamlit by building a game, and I just rolled out a major update!
While Streamlit is known for data dashboards, I wanted to explore its potential for real-time interactivity. In this version, I’ve focused on expanding input methods and level design.
What’s New:
Full Controller Support: You can now play using a gamepad! Implementing this was a fun challenge in handling external inputs within the Streamlit lifecycle.
Dynamic “Moving Floor” Gimmicks: Added new stage elements like moving platforms. This adds a layer of timing and spatial logic that you don’t usually see in standard web apps.
Technical Highlights:
-
Hardware Input System: I implemented a custom input handler within the JavaScript layer using the Web Gamepad API (
navigator.getGamepads()). This allows for zero-latency switching between keyboard and physical controllers by normalizing stick thresholds and button states directly in the browser. -
Client-Side Physics: To bypass Streamlit’s typical rerun latency, the game engine and physics (including the new moving platforms) run entirely in the frontend. This ensures a smooth 60fps experience that feels more like a native game than a web dashboard.
-
State Management: Leveraging
st.components.v1.htmlto bridge this high-speed JS engine into the Streamlit layout while keeping the overall app structure clean and reactive.
App URL: [https://hyper-cow-jump.streamlit.app/\]
GitHub: [https://github.com/sevasu77/hyper-cow-jump\]

Check out the “Moving Floor” in action and let me know what you think! ![]()
![]()