๐ŸŽฎ Devlog #7: Velocity Puck's 3D Character Selection, Fixed UI Arrows & Interactive Preview!


Welcome back, air hockey fans! This update brings some serious style and polish to Velocity Puck. With 3D character previews, smoother menu navigation, and interface fixes, your journey from title screen to puck smash has never looked better.

๐ŸŽญ 1. Character Selection Screen: Polished and Separated

The character selection process is now a dedicated full-screen interface that appears when you click Single Player from the main menu.

โœ… Includes:

  • Stylized header (โ€œChoose Your Characterโ€)

  • Navigation arrows

  • Dynamic character name display

  • A 3D model preview rendered via Three.js!

The player no longer picks from buttons—this is a proper carousel system where players cycle through characters and view their models before launching the game.

๐Ÿงฑ 2. 3D โ€œChoose Your Characterโ€ Preview with Three.js


This is the biggest UX enhancement: your character choice is visualized in 3D before you even press play.

๐Ÿงฐ Setup:

  • A separate Three.js scene, camera, and renderer are initialized inside the #characterPreviewContainer.

  • Canvas: #characterPreviewCanvas

  • The current character model is dynamically loaded or cloned based on the playerโ€™s selection.

  • Background color and lighting match the gameโ€™s tone (0x0B0B2A with a soft glow).

๐Ÿ”„ Character Switching Logic:

js
const characters = [   
  { id: 'classic', name: 'Classic', color: '#e74c3c' },   
  { id: 'robot', name: 'Robot', color: '#3498db' },   
  { id: 'ninja', name: 'Ninja', color: '#2c3e50' },   
  { id: 'alien', name: 'Alien', color: '#2ecc71' } 
];  
function updateCharacterPreview() {   
  // Clear current model from preview scene   
  // Load or clone the correct 3D model   
  // Rotate and display it with animation loop 
} 

๐Ÿ’ก Render Logic:

  • A separate animation loop (requestAnimationFrame) runs only for the preview.

  • Characters rotate slowly in place, giving a stylish showroom effect.

๐Ÿ” 3. Fixed Arrow Navigation Buttons - Part 1

The left (#prevCharacter) and right (#nextCharacter) arrow buttons now:

  • Correctly cycle through character options

  • Wrap around if you go past the beginning or end

  • Update:

    • The name label (#characterName)

    • The visual 3D preview

โœ… Working Fix (Based on Our Previous Chat):

js
document.getElementById('prevCharacter').addEventListener('click', () => {   
  selectedCharacterIndex = (selectedCharacterIndex - 1 + characters.length) % characters.length;   
  updateCharacterPreview(); 
});  
document.getElementById('nextCharacter').addEventListener('click', () => {   
  selectedCharacterIndex = (selectedCharacterIndex + 1) % characters.length;   
  updateCharacterPreview(); 
}); 

This wraparound logic avoids index errors and enables smooth browsing through your full character lineup.

๐Ÿž 4. Fixing Arrow Rendering Bugs -  Part 2

The arrow characters (โ—€, โ–ถ) werenโ€™t displaying correctly on some systems, and instead were rendering as corrupted symbols like:


This usually happens due to a character encoding mismatch (commonly UTF-8 errors). Hereโ€™s how we fixed it:

โœ… Fix: Use Unicode Escape Sequences or HTML Entities

Instead of directly typing arrow characters in HTML, we now use HTML entities, which are more consistent across devices and browsers.

Old HTML (caused issues):

html
<button class="nav-arrow">โ—€</button> 
<button class="nav-arrow">โ–ถ</button> 

Updated HTML (cross-browser safe):

html
<button class="nav-arrow" id="prevCharacter">◀</button> <!-- โ—€ --> 
<button class="nav-arrow" id="nextCharacter">▶</button> <!-- โ–ถ --> 
  • โ†’ โ—€ (Left Arrow)

  • โ†’ โ–ถ (Right Arrow)

๐Ÿ”„ Alternate Fixes (Optional)

If you want more control over style or iconography:

  • Use Font Awesome:
    <i class="fas fa-arrow-left"></i>

  • Or embed an inline SVG for more flexibility and animation options.


๐ŸŒŒ 5. Background Embedded in Title Screen

The animated background from your website has now been embedded directly into the title screen via an <iframe>:

html
<iframe src="<a href="https://www.steelcyclonestudios.com/games/velocitypuck/background.html">https://www.steelcyclonestudios.com/games/velocitypuck/background.html</a>" ...></iframe>

โœ… Provides:

  • A seamless, animated atmosphere right at the title

  • Brand consistency from your web presence

  • No performance cost to the main game loop

This iframe sits behind all UI layers with a z-index: -1 and stretches full-screen to blend perfectly.

๐Ÿ’ธ 6. GameMonetize SDK Integration

To help support Velocity Puck's development and future updates, weโ€™ve now integrated the GameMonetize.com SDK to enable monetization and ad support directly within the game.

๐Ÿ”ง SDK Features Implemented:

  • Ad display triggers for:

    • Restarting the game

    • Returning to main menu

    • Ending the match

  • Pause/resume support via SDK events

  • Graceful fallback if the ad fails

๐Ÿง  Code Implementation (from index.html):

js
window.SDK_OPTIONS = {   
  gameId: "jll9bmbb1qxr1uux1t1khn56z4xpvibs",   
  onEvent: function (a) {     
    switch (a.name) {       
      case "SDK_GAME_PAUSE": isPaused = true; break;       
      case "SDK_GAME_START": isPaused = false; break;       
      case "SDK_READY": break;       
      case "SDK_ERROR": console.warn("SDK Error:", a); break;     
    }   
  } 
}; 

The SDK script is loaded externally:

html
<script type="text/javascript" src="<a href="<a href="https://api.gamemonetize.com/sdk.js">https://api.gamemonetize.com/sdk.js</a>"><a href="https://api.gamemonetize.com/sdk.js</a>">https://api.gamemonetize.com/sdk.js</a></a>"></script> 

And custom ad triggers are placed before key actions:

js
function showAd(callback) {   
  if (typeof sdk !== "undefined" && sdk.showBanner) {     
    sdk.showBanner().then(() => callback?.()).catch(() => callback?.());   
  } else {      
    callback?.();   
  } 
} 

๐Ÿ’ก Why This Matters:

  • Helps fund future content like multiplayer and new characters.

  • Keeps the game free for players while rewarding session engagement.

  • Doesnโ€™t interrupt gameplay flow (ads are shown at key transition points).

๐Ÿง  How It All Works Together (index.html Overview)

Your index.html now:

  • Organizes screen transitions: #titleScreen, #mainMenuScreen, #characterSelectionScreen, etc.

  • Uses Three.js to power both:

    • Main game rendering

    • Character preview rendering (separate scene/canvas)

  • Embeds stylized CSS animations for screen glow, button hover states, and transitions

  • Leverages JS modular logic to control:

    • Menu visibility

    • Character data

    • Live updates to models and previews

  • Has separate canvases for:

    • Main game rendering

    • Character preview rendering

    • End-of-game model display

โœ… Summary of New Features:

  • ๐ŸŽญ Dedicated Character Selection Screen

  • ๐Ÿ” Fixed arrow navigation buttons

  • ๐Ÿงโ€โ™‚๏ธ Real-time 3D model preview for each character

  • ๐ŸŒŒ Animated HTML background for Title Screen

  • ๐Ÿ’ซ Stylish carousel effect & updated character logic

๐Ÿ’ก Ideas for What's Next:

  • Local storage: Save your chosen character

  • Unlockable skins or alt outfits

  • Background music support with toggle

  • Refined character animations and idle poses

Thanks again for supporting Velocity Puck! ๐Ÿ’ Your feedback is shaping this into a truly unique web game experience. Drop a comment, hit play, and pick your fighter in 3D style!

— Jordon McClain
Steel Cyclone Studios ๐Ÿ’ฅ

Leave a comment

Log in with itch.io to leave a comment.