Coder Social home page Coder Social logo

k2m5t2 / threlter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grischaerbe/threlter

0.0 0.0 0.0 91.79 MB

Race in your browser

Home Page: https://threltemania.xyz

JavaScript 1.12% TypeScript 14.65% CSS 0.31% HTML 0.72% Dockerfile 0.07% Svelte 83.13%

threlter's Introduction

OG

Threltemania is a racing game that defies physics.

Motivation

It is a bit of a tradition to celebrate new versions of Threlte with a small game that not only is superb promotional material, but also is used to test every aspect of all moving parts of the Threlte ecosystem.

Threlte 6 is a special release. Threlte is transitioning towards a clear separation of concerns: @threlte/core as a way to declaratively use Three.js and other packages such as @threlte/extras with useful abstractions and @threlte/rapier to easily integrate the exceptional Rapier physics engine.

The next version is called "Threlte v6" and what better way is there to celebrate that than with a V6? โ€“ I'll see myself out.

Features

  • ๐Ÿ‘‘ Campaign: Official tracks to race against the clock and win medals.
  • ๐Ÿ‘ค User Tracks: Race on tracks built by other players.
  • ๐Ÿ› ๏ธ Track Editor: Build and share your own tracks and compete against your friends.

"Technical" Features

  • Options allow for a customized game experience
  • Keyboard navigation to navigate the whole game via keyboard
  • Game UI implemented in Svelte
  • Game mechanics implemented in Threlte v6

Technical Outline

Threltemania holds many different interesting aspects, technically challenging topics and goodies. Here's a rough outline:

  • Raycast Vehicle Controller: As opposed to a vehicle controller that is based on many "rigid bodies" that are connected via "joints", this arcade-style vehicle controller is implemented with an approach that lends concepts from this implementation overview and this excellent talk, however it's a mix of the over-simplification of the latter and the close-to-simulation approach of the former. The implementation details can be found here. Aktivate the debug mode to see how the physics are modelled.
  • Keyboard navigation: As it is with many games, the game Threltemania can be controlled with only the keyboard. This makes it feel more like a game and less like a regular website.
  • URL Statemanagement: When a game is started, it typically starts from the very beginning. The web as a platform provides a very powerful statemanagement tool: The URL. SvelteKit's routing is used to determine the current app state. This means that reloading the page will get you where you left off.
  • The perfect tool for the job: Svelte components make managing Three.js objects a breeze. Slot props โ€“ one of my favorite features โ€“ allow truely magical component compositions. The component lifecycle is used to never miss the disposal of an object.
  • DOM UI and Three.js objects side by side: In game development, the management of UI is always a bit of a pain because UI normally cannot be co-located with actual gameplay elements. The web provides the ultimate UI-engine: the DOM. Using Svelte portals, the UI can be placed next to actual Three.js objects and allows for ultra-transparent game and UI state references.

This outline does not contain the work that has gone into Threlte v6. If you want to learn more about the upcoming version of Threlte, visit the Documentation or join our Discord community.

Demo Video

Bildschirmaufnahme-3.mp4

Screenshots

  • Main Menu

hack threltemania xyz_menu_main

  • Track Selection

localhost_5173_

  • On-Track Intro

localhost_5173_campaign_Track-o5of60o_time-attack

  • Track Editor

localhost_5173_campaign_Track-o5of60o_time-attack (2)

  • Track Element Transformation

localhost_5173_campaign_Track-o5of60o_time-attack (5)

  • Track Editor Info

localhost_5173_campaign_Track-o5of60o_time-attack (3)

  • Track validation

localhost_5173_campaign_Track-o5of60o_time-attack (4)

Known Issues

  • The physics are arguably the hardest part to get right. Rapier allows for deterministic physics, but the vehicle controller is not ready for that yet. This means that no two runs are the same (even if the inputs are) and the tracks should not be too fast paced.
  • Responsiveness. This game is best played on a decently-sized screen.
  • Safari sometimes (rarely) hangs on loading without any clear reason.

Roadmap

  • Deterministic physics
  • Responsive UI
  • UI transitions
  • Back-porting the vehicle controller to a Svelte component available at @threlte/rapier
  • Creation of more owned assets
  • Multiplayer
  • Some game-related mechanics: Auto-reset after falling off, โ€ฆ
  • More campaign tracks
  • A track-making challenge for the release of Threlte v6
  • Maybe add a little bit of storytelling to it

threlter's People

Contributors

grischaerbe avatar marwie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.