Space Bricks — An Arkanoid tribute with two rendering engines in PowerBuilder 25

Ramón San Félix Ramón
CODE AUTHOR
Posts: 44
 1 week 1 day ago #647 by Ramón San Félix Ramón
Ramón San Félix Ramón created the code: Space Bricks — An Arkanoid tribute with two rendering engines in PowerBuilder 25

 Hi everyone!

 After sharing my link-al-snake, I wanted to take the concept further and explore a more demanding challenge: real-time
 physics in PowerBuilder. The result is Space Bricks, a tribute to the classic Arkanoid with a twist — it ships with two
 completely different rendering engines that you can switch between from a launcher menu.

Two ways to play the same game

Native PB — Pure PowerBuilder. The entire playfield is a single DataWindow with one detail band of 1870 PBU. Bricks,
paddle, and ball are DW objects created with Modify() at startup. The ball moves in PBU coordinates and collision
detection uses AABB overlap — the same algorithm used in commercial game engines.

HTML5 — The complete game as a JavaScript string loaded via NavigateToString() into a WebBrowser control. Canvas 2D
rendering at 60 FPS with delta-time physics. Same game, silky smooth.

A launcher window (w_main) presents both options using a WebBrowser with RegisterEvent — click a card in the HTML and it
opens the corresponding PB window. A nice example of JS↔PB communication.

What's interesting technically

- Single-band DataWindow trick: instead of one row per game row (like in Snake), the entire 21×34 grid lives in a single
char(800) column in a single row. One giant detail band = one coordinate space. The ball oval moves freely with
Modify("ball.x='…' ball.y='…'") — no row switching, no visibility toggling.
- AABB collision with minimum-overlap bounce: when the ball hits a brick, the code calculates the penetration depth on all
 four sides. The smallest overlap determines the bounce axis. Same algorithm in both PB and JS versions — you can compare
them side by side.
- RegisterEvent for the launcher: the main menu is an HTML page inside a WebBrowser. JavaScript calls
window.webBrowser.ue_nativo() to trigger a PB user event that opens the native game window. Clean JS→PB communication
without hacks.
- The honest comparison: the native version runs at ~25 FPS with occasional DW repaint artifacts. The HTML version runs at
60 FPS pixel-perfect. Both are playable, but putting them side by side is a fascinating look at what each technology does
best.

The project is a single PBL with 4 objects (application, launcher, native game + DW, HTML game). No database, no external
files. Open the .pbsln, build, and play.  Built with Claude Code following my ideas and direction.

Hope you enjoy it. Would love to hear if anyone pushes the DataWindow-as-canvas idea even further!

To be aware of what I publish you can follow my blog in Spanish:
rsrsystem.blogspot.com

Follow for more PowerBuilder tips, tricks, and modern integrations! 

This message has an attachment file.
Please log in or register to see it.

Please Log in or Create an account to join the conversation.