Pure Fun with PureScript
summary
Live coding of a PureScript single‑page game implements the Elm architecture with the Pux framework, rendering game objects as CSS‑styled divs and using a simple physics step that adds velocity to position. Controls use W/S to add thrust (+0.2 per frame) to the dog ship, four staggered obstacles spawn offscreen at x≈512 and move left with x‑velocities from about -0.8 to -0.1, collision sets a gameOver flag and applies downward velocity for a falling animation. Hot reload via webpack and a pure functional state update loop complete the setup.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:15cosmonaut dogs
- 9:40programming
- 20:30dogs
- 26:30Obstacles
- 29:40New Obstacle
- 33:30Adding Obstacles
- 35:55Collision Detection
- 38:05Game Over Logic
- 39:57Game Over State
- 43:45Conclusion
related talks
43mThe Pure Functional Web
28mPureScript & Pux -- a safer, more expressive way to React
45mPureScript (Maybe This Time We Get JavaScript Right)
49mPurescript (Maybe this time we get Javascript right)
45mFunctional Reactive Programming in Elm
47mFunctional Programming on the Web
44mMy adventure with Elm
01h 49mPurely Functional Web Apps using React and PureScript
