# 'Shipgame' built with Lamdera

**URL:** <https://discourse.elm-lang.org/t/shipgame-built-with-lamdera/8503>\
**Category:** Show and Tell\
**Created:** [July 12, 2022, 8:01pm UTC](https://discourse.elm-lang.org/t/shipgame-built-with-lamdera/8503 "2022-07-12T20:01:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tristanp](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/tristanp/32/2685_2.png) [@tristanp](https://discourse.elm-lang.org/u/tristanp)\
**Post date:** [July 12, 2022, 8:01pm UTC](https://discourse.elm-lang.org/t/shipgame-built-with-lamdera/8503/1 "2022-07-12T20:01:25Z")

</div>

Hello folks,

Here’s a game I’ve been building with Elm and [Lamdera](https://lamdera.com/). I call it Shipgame but it’s really an implementation of [Ship, Captain, Crew](https://en.wikipedia.org/wiki/Ship,_captain,_and_crew), a simple dice gambling game. Don’t expect any deep strategy or fancy graphics but I found it some fun to play with friends!

To get started visit [https://shipgame.lamdera.app/](https://shipgame.lamdera.app/), click Create Game, then Start Game (optional: invite friends using the join code). Your goal is to roll into the most valuable ship you can. To make a **complete ship** you need your Captain, First Mate, and Quartermaster (i.e. roll a **6** , **5** , and **4**  **in that order** ), with the sum of the **two remaining dice** (your crew) being the overall score of the ship. A ship without its Captain, First Mate, or Quartermaster is **Incomplete** and worth 0. But I’m really most excited for yall to read and if you’re in the mood critique my Elm/Lamdera patterns.

[Demo](https://shipgame.lamdera.app/) Note it works on full-width and mobile-width browsers.  
[Github code](https://github.com/tristanpendergrass/shipgame)

 ![Screenshot by Dropbox Capture](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/2X/6/6d50459487424f282442bb6ec84f1c75cd5a263e.png)

I created this game mainly as an exercise for myself to cover some areas I hadn’t done in a side project before:

- Writing game logic, isolated from the UI and networking. Mostly encapsulated in [ShipGame.elm](https://github.com/tristanpendergrass/shipgame/blob/master/src/ShipGame.elm) and [Dice.elm](https://github.com/tristanpendergrass/shipgame/blob/master/src/Dice.elm)
- Writing netcode that accommodates players joining a lobby using a randomly generated join code, seeing each other, and automatically reconnecting if they close the tab then reopen it. Mostly encapsulated in [Backend.elm](https://github.com/tristanpendergrass/shipgame/blob/master/src/Backend.elm) and [Lobby.elm](https://github.com/tristanpendergrass/shipgame/blob/master/src/Lobby.elm).
- Using Tailwind and Daisy UI with proper theming (e.g. not hardcoding any colors). Check out the Theme button in the top right to see it in action.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [July 22, 2022, 8:01pm UTC](https://discourse.elm-lang.org/t/shipgame-built-with-lamdera/8503/2 "2022-07-22T20:01:31Z")

</div>

Closed on July 22, 2022, 8:01pm UTC

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
