Upgrade to Pro — share decks privately, control downloads, hide ads and more …

My First Maker Project: Print Your Own Adventure Game

My First Maker Project: Print Your Own Adventure Game

By Vicky Twomey-Lee (@whykay/@eventgeek and founder of @PyLadiesDub)
PyLadies Dublin, Tue May 19 2020

Meetup page: https://www.meetup.com/PyLadiesDublin/events/dclgvlybchbzb/
Video of the project in action: https://flic.kr/p/2iNDPVF

PyLadies Dublin

May 19, 2020
Tweet

More Decks by PyLadies Dublin

Other Decks in Technology

Transcript

  1. Vicky Twomey-Lee
    My First Maker Project: Print
    Your Own Adventure Game
    PyLadies Dublin, Tue May 19 2020

    View full-size slide

  2. • Coder

    • Involved w/ Irish Tech Community

    • Advocates Diversity in Tech

    • Maker Advocate
    Who?
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  3. My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  4. @CodingGrace @PyLadiesDub @GlobalGameCraft
    @WWCodeDublin @DublinMaker
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  5. What…?
    Adventure Games
    https://www.flickr.com/photos/derekbruff/6373811675

    View full-size slide

  6. Search & Play

    “The Hitchhiker's Guide to the
    Galaxy Game 30th Anniversary”
    http://adarkroom.doublespeakgames.com/
    Try: A Dark Room

    (iOS/Android)
    Adventure games to check out - free!
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  7. What…?
    Raspberry Pi
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  8. What…?
    CircuitPython
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  9. What…?
    MicroPython
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  10. What…?
    CircuitPython
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  11. What…?
    Adafruit Industries
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  12. My Maker Project
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  13. *note: not extensive
    • Raspberry Pi with latest Circuit
    Python

    • Adafruit mini-thermal printer

    • Arcade buttons x3

    • Laptop with Python 3

    • Mu Editor

    • VNC Viewer
    Project Ingredients
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  14. What…?
    pi-top
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  15. Inspiration
    “Der Choosatron”
    Berlin Game Science Center
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  16. My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  17. • Case for thermal printer

    • Stand for the arcade buttons
    3D Printing
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  18. Printing an image
    with the thermal printer
    https://gph.is/g/ZPWWyjV
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  19. Printing an image
    Solution: Switched
    CircuitPython library
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  20. Switched to pi-top [4]
    Where’s the printer?
    https://gph.is/g/ZPWWyjV
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  21. My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  22. Spreadsheet -> JSON
    • Looked at Twine

    • Chose Spreadsheets export to
    CSV

    • Python convert CSV to JSON
    Sample data
    https://gph.is/2d8XnGR
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  23. Spreadsheet
    Sample
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  24. CSV to JSON
    Code

    View full-size slide

  25. Main code
    Setting up electronic-y
    bits & get game data
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  26. Main code
    Game class
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  27. Main code
    Playing the game

    View full-size slide

  28. my thoughts after the project
    • More refactoring

    • Improvements like case covering
    and make it look as one unit

    • Switch to Raspberry Pi 3 or even
    a Raspberry Pi Zero

    • Realise I found it hard writing
    stories, plot generators online
    are helpful for random data
    So…
    https://gph.is/1OhAIXM
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  29. Quick video of project
    My First Maker Project: Print Your Own Adventure Game | PyLadies Dublin | Vicky Twomey-Lee

    View full-size slide

  30. Video of project in action: https://flic.kr/p/2iNDPVF

    View full-size slide

  31. pexels.com/photo/big-red-heart-on-dark-background-6371/
    Thank You!
    @whykay | @eventgeekie
    My First Maker Project: Print Your Own Adventure Game
    PyLadies Dublin, Tue May 19, 2020
    https://github.com/whykay/text-based-game-thermal-printer

    View full-size slide

  32. UP NEXT
    How Python changed my life in 9 months - True Story
    by Débora Cornetta O'Brien

    View full-size slide