lattice-core-card-game alternatives and similar shards
Based on the "Examples and funny stuff" category.
Alternatively, view lattice-core-card-game alternatives based on common mentions on social networks and blogs.
-
crystal-benchmarks-game
The Computer Language Benchmarks Game -
kemal-chat
Build realtime applications with Kemal and WebSocket -
kemal-react-chat
Build Realtime Web applications with Kemal and React -
crystalworld
realworld.io back-end API implementation -
fast_sleep
Blazing fast (funny) implementation of sleep for Crystal -
kemal-ws-react-pg-todo-app
Realtime Todo application developed with Kemal, Websockets, React, ES2015 and PostgreSQL -
kemal-vue-chat
Build Realtime Web applications with Kemal and Vue.js -
kemal-react-pg-chat
Chat application developed with Kemal, React, ES2015 and PostgreSQL -
kemal_elm_chat
Simple chat server written with Kemal and Elm -
docker-kemal
An example Dockerized Crystal Kemal project -
jihantoro.sd
Crystal & Kemal version of Serdar Dogruyol blog -
kemal-ws-todo-app
Realtime Todo application developed with Kemal and Websockets -
kemal-pg-sample
Sample app to demonstrate kemal + postgresql usage -
kemal-mysql-blog
Blog written with Crystal, Kemal and MySQL -
kemal-heroku-example
This repository shows, how you can publish your open source apps which powered kemal framework publish as heroku app in seconds -
crystal-mysql-crud-example
Crystal MySQL CRUD example -
chuck-norris-holy-quotes
Chuck Norris holy quotes -
kemal-ws-pg-todo-app
Realtime Todo application developed with Kemal, Websockets, jQuery, ES2015 and PostgreSQL -
jihantoro-cr-mysql
Crystal MySQL from scratch sample app -
crystal-website
Creating dynamic websites with Crystal and Kemal
Get performance insights in less than 4 minutes
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of lattice-core-card-game or a related project?
README
card_game
This is a demo app for lattice-core which is a framework for crystal I'm working on that is still very much in the proof-of-concept stage. The intent is to really show how powerful a WebSocket-first framework can be. Kemal serves as an excellent base, and crystal's ruby-like syntax with native speed brings everything together.
If you haven't spent some time investigation crystal, please take a look. It is an amazing language with an excellent library.
Installation
git clone [email protected]:jasonl99/card_game.git
cd card_game
shards install
crystal src/card_game.cr
Usage
Open a browser and go to localhost:3000/cardgame/abc
where abc
becomes a new game at that address.
Use Chrome, Firefox, Safari, or whatever browser you'd like at the same url to show more than one session accessing a game. Imagine each browser is a different user in a different location. Once a game is created, it stays in server memory (garbage collection is in progress on lattice-core.)
For demonstration purposes, each session is given a random username (so you'll have two different names if you have Chrome and Firefox both accessing the same game, which is cool, because it really shows how communication occurs between all game users).
The upper right corner also illustrates some of the power that lattice-core can provide. It's a statistical summary of how many card games are running across the server, and how many of those games have no subscribers (ultimately the target for garbage collection).
Walk Through
These screenshots are bit outdated. I will update them soon
First things first. This demo emulates a card game. Imagine if you were playing poker online against a few other people. Each of you is shown a deck. But there's one hand, which all players see and interact with. If the deck runs out, a new deck is shuffled.
That said, here's an opening page.
[hand](./screenshots/cg1.png)
This is pretty straightforward. In fact, here's the for the game, the hand, and the first card, including some data- attributes that will be discussed in detail later...
<h1>Hi Jason</h1>
<div data-item="cardgame-94243174726304">
<div id="hand">
<span class="card-holder">
<img class="card" src="/images/king_of_hearts.png" data-item="cardgame-94243174726304-card-0" data-track="click">
</span>
... more card holder spans
</div>
</div>
Nothing fancy. There's under 100 lines of javascript code, and no external libraries like jQuery, lodash, underscore, etc (not that you wouldn't ulimately use those; it's just that they are not needed for this framework).
There in an in-game chat that allows player communcation, and it also shows when a player draws a card. Simple stuff.
So we have the stage set: We have a "game" that can have many players, each of who interact with a set of playing cards. Suppose I want to change the second card, which I do by clicking the card itself:
[hand](./screenshots/cg2.png)
In the above example, I'm hovering over the six of hearts. Now I click:
[hand](./screenshots/cg3.png)
With one click, the image has changed, the number of cards remaining has decreased from 47 to 46, and a new chat message has been entered that shows I picked the 9 of Diamonds.
Ok, sure, that's interesting. There could be some ugly javascript doing some smoke-and-mirrors that make things look interesting. But how is this different?
Let's try something a little more impressive, and add an animated gif while we're at it.
We're going to have Chrome on the left, Firefox on the right, both going to the same game named
game1
.
In this example, a GameObserver object has been added to the game. This observer receives events directly from WebObjects that it's listening to. In the case, we do nothing more than display those events.
Notice that each click on a card updates the card for both players, across different browsers, and it does it about as close to real time as you can get. Notice, too, that the chat window updates with the card drawn by each user, and the Cards Remaining In Deck update as well. In this example, I've also created a tracking event on typing in the chat form: every time I type, and event goes to the server and out to each client. Distributed events!
[animation](./screenshots/demo.gif)
Contributors
- Jason Landry creator, maintainer