SShortSingh.
Back to feed

Codename One Tutorial Shows How to Build a Blackjack Card Game Using Game Builder

0
·2 views

A new tutorial from the DEV Community walks developers through building a blackjack card game called Duke Jack using the Codename One open-source framework. The guide uses Game Builder's board mode, which arranges game elements on a flat grid of cells rather than a scrolling world, making it a natural fit for a card table layout. Developers place card actors on a Pieces layer with rank, suit, and faceUp properties, while a separate tile layer handles the static felt surface. The tutorial covers core blackjack mechanics including hit, stand, the dealer's hole card, and win/lose logic, all driven by a companion class that reads card data and applies game rules. Card visuals are drawn manually using Codename One's standard Graphics API, with no built-in card-rendering engine involved.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer Rebuilds 1991 DOS Maze Algorithm in the Browser After 35 Years

A software developer has revived a maze-generation program originally written in Turbo Pascal on a DOS machine in 1991, porting it to the browser using TypeScript. The algorithm was not intentionally designed as a maze generator — it emerged from experiments with recursive tree-drawing routines, where branches arranged at 45-degree angles naturally produced cycle-free paths. The developer notes that the approach is functionally equivalent to randomized depth-first search, a technique that gained wider recognition through Jamis Buck's 2011 blog series on maze algorithms, roughly two decades after the original code was written. No invention claim is made; rather, the author describes independently arriving at the same method through visual and geometric thinking rather than formal algorithm study. Notable design choices from the original code — including a precomputed permutation table and using pixel color as the sole occupancy map — have been preserved in the modern rewrite.

0
ProgrammingDEV Community ·

Entire Launches Distributed Git Mirror Network Built for AI Agent Workloads

A startup called Entire has released a preview of a distributed Git network designed to handle the high-frequency clone and push operations generated by large fleets of AI coding agents. The system places regional mirrors in the US, EU, and Australia in front of an existing GitHub repository, absorbing read and write traffic without touching the origin or its existing CI and access controls. Initial benchmarks on a single repository recorded roughly 570,000 shallow clones per hour, 586 pushes per second, and a mixed clone-plus-push throughput of around 470 operations per second at 50–60 ms median latency. The product is currently available under a waitlist, and Entire has said it plans to open-source the underlying Git backend in the coming months. Future milestones include native repository hosting and a fully decentralized network to support enterprises with data residency and regulatory requirements.

0
ProgrammingDEV Community ·

How to Build a Real-Time Dashboard Using FastAPI, WebSockets, and Postgres

Traditional polling-based dashboards send repeated server requests every few seconds, wasting CPU, bandwidth, and delivering stale data to users. WebSockets offer a more efficient alternative by letting the server push updates to clients instantly over a single persistent connection. Using FastAPI's native WebSocket support alongside PostgreSQL's built-in LISTEN/NOTIFY feature and the asyncpg library, developers can build a lightweight real-time dashboard with minimal infrastructure. For single-instance deployments, this setup requires no external message brokers and is straightforward to maintain. When scaling horizontally across multiple backend pods, adding Redis pub/sub ensures all instances receive and broadcast every database event to their connected clients.

0
ProgrammingHacker News ·

Babies Show Natural Movement and Sound Responses to Music in First Year

A study published in eLife Sciences examined how infants respond to music during their first year of life. Researchers tracked both auditory reactions and spontaneous physical movements in babies as they listened to musical stimuli. The findings shed light on the early developmental relationship between music perception and motor responses in newborns and young infants. The research contributes to understanding how musical sensitivity and rhythmic movement emerge naturally in humans from birth.